Question about re-using expandable header items?
See original GitHub issueBasically, is it possible?
I have a screen where 1st level items upon click will expand and show 2nd level items below it. The 2nd level items themselves look just like the 1st level items, only difference is a transparent indentation in the left. The 2nd level items themselves can also be clicked and show 3rd level items, which again looks like the 1st and 2nd level items with only another indentation in the left side. The hierarchy depends on the data returned from the database and the levels are not fixed. So I am looking for a solution where I can re-use the header items but I can’t seem to wrap my head around how to implement it using the AbstractExpandableHeaderItem
and AbsractExpandableItem
. I have used this library before but only got until 2nd level items so I quite know the specifics of setting it up
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
I found that
ExpandableItems
hasaddSubItem
method andsubItems
fields that I can use to add subItems. Thank you very much for the help@dev-JE02, yes there are such methods for subItems, but pay attention that if you add them expanded (already visible), adapter must be called also with
addItemToSection
: Read Headers-and-Sections#following-the-use-case-2. Otherwise you don’t need to call this method.