beagle
beagle copied to clipboard
Expandable list of the TextInputModule
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.
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
It would be probably more obvious if it would have some expandable module that has list of other modules to show/hide.
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.