You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.
I stumbled on a bug while using the expansion panel in a recycler view.
I need to handle the expansion manually, so I'm using collapse(boolean animated) and expand(boolean animated) to update the expansion layout accordingly.
It works fine, except when initializing the layout state to expanded. The layout is not expanded by default (in the XML) but set to expanded (expand(false)) by the adapter when the activity starts.
I think the cause is:
expand(false) is called by the adapter. expanded is set to true, but we don't have a height yet
the ViewTreeObserver for preDraw is called
the preDraw callback tries to update the height of the layout since it's expanded
Hello, thank you for the library.
I stumbled on a bug while using the expansion panel in a recycler view.
I need to handle the expansion manually, so I'm using
collapse(boolean animated)
andexpand(boolean animated)
to update the expansion layout accordingly.It works fine, except when initializing the layout state to expanded. The layout is not expanded by default (in the XML) but set to expanded (
expand(false)
) by the adapter when the activity starts.I think the cause is:
expand(false)
is called by the adapter.expanded
is set to true, but we don't have a height yetViewTreeObserver
for preDraw is calledpreDraw
callback tries to update the height of the layout since it'sexpanded
ExpansionPanel/expansionpanel/src/main/java/com/github/florent37/expansionpanel/ExpansionLayout.java
Lines 133 to 136 in ffd431d
expand(false)
is called but returns early sinceexpanded
is trueExpansionPanel/expansionpanel/src/main/java/com/github/florent37/expansionpanel/ExpansionLayout.java
Lines 207 to 210 in ffd431d
setHeight
is never called with the expanded heightIf that's the case, I think updating the preDraw callback to
might be the fix. I can do a PR for this if you want.
The same problem seem to be present in the horizontal version, though I haven't tested it.
The text was updated successfully, but these errors were encountered: