Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expandable list of the TextInputModule #96

Open
emartynov opened this issue Feb 7, 2022 · 3 comments
Open

Expandable list of the TextInputModule #96

emartynov opened this issue Feb 7, 2022 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@emartynov
Copy link

emartynov commented Feb 7, 2022

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
Copy link
Author

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
Copy link
Author

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

@pandulapeter
Copy link
Owner

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 pandulapeter added the enhancement New feature or request label Feb 7, 2022
@pandulapeter pandulapeter self-assigned this Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants