beagle icon indicating copy to clipboard operation
beagle copied to clipboard

Expandable list of the TextInputModule

Open emartynov opened this issue 3 years ago • 3 comments

Am I right there is no way to write own Expandable module?

I have list of some editable values and I want to embed it in the expandable section.

I was planing to produce list of TextInputModule for each value, and would like to not pollute already heavy options drawer.

emartynov avatar Feb 07 '22 14:02 emartynov

Ah wait, I think I can do something similar looking to example of the MultipleSelectionListModule :ExpandableModule<MultipleSelectionListModule<T>>, ValueWrapperModule<Set<String>, MultipleSelectionListModule<T>> or maybe not

emartynov avatar Feb 07 '22 14:02 emartynov

It would be probably more obvious if it would have some expandable module that has list of other modules to show/hide.

emartynov avatar Feb 07 '22 14:02 emartynov

Good question! Writing custom Modules should be possible, but you're the first person to ask about this feature, it's not a very well maintained part of the library. The idea is to also create a Module.Delegate for your new Module, that describes what kind of Cells should be created, based on the Module instance.

Unfortunately, you won't be able to re-use the code for the ExpandableModule delegate, as it's internal to the library. "It would be probably more obvious if it would have some expandable module that has list of other modules to show/hide." - that's a good idea, let me give it a try, but we might run into issues if nesting multiple expandable modules becomes allowed.

At this point it would be easier if you created the functionality you want using TextModules that you show / hide manually. There's an example for this in the demo app under "Examples" -> "Navigating within the menu", here's the relevant part of the code.

pandulapeter avatar Feb 07 '22 15:02 pandulapeter