Closed jakoss closed 3 years ago
Could you maybe please try to reproduce this in the sample app? and maybe provide full sample code so I can also debug and get a better view what you see?
thanks
Sure, minimal setup reproducing issue attached
@jakoss thanks for the sample.
The problem is, that the subitem is only an ISubItem
and not a IExpandable
.
Causing this cast to fail: https://github.com/mikepenz/FastAdapter/blob/develop/fastadapter-extensions-expandable/src/main/java/com/mikepenz/fastadapter/expandable/ExpandableExtension.kt#L42
Will look if that's something we can improve
v5.4.1 will fix this for you :)
Awesome, thanks. Implementing IExpandable
in subitem seems counterintuitive if this subitem isn't really expandable :)
Yeah indeed. In the sample we use the AbstractExpandableItem
as base as such this was not seen.
Thanks again for the report
5.4.1 works perfectly, thanks
About this issue
I'm not sure if it's my fault or the expanded implementation is broken somehow.
I implemented parent item like that:
Then i'm adding items to adapter like that:
The issue is that if one item is expanded and i'm trying to expand other one - it won't collapse the old one. I checked under debugger that the flag
isOnlyOneExpandedItem
is true. I also traced theonClick
call.In file
ExpandableExtension
, on line 173, the lineval expandedItems = getExpandedItemsSameLevel(pos)
is always empty. ThegetExpandedItemsRootLevel
always get's called (as expected i think) but here's the issue. We have checkfastAdapter.getItem(i).ifExpandableParent
, so the body won't ever be called, since this is root level and the parent is null. Am i doing something wrong here?Details
recyclerview:1.2.0
,fragment-ktx:1.3.2
)Checklist