ExpansionPanel
ExpansionPanel copied to clipboard
ExpansionLayout do not save expanded state
Any android component with ID can save own state.
so, add id on it ?
and this doesn't work.
check in you example app. Headers and layouts with id but when screen rotate layout is back to initial state...
Oh ok, i juste have tout handle onSaveInstanceState
Le 23 févr. 2018 22:26, "Alex" [email protected] a écrit :
check in you example app. Headers and layouts with id but when screen rotate layout is back to initial state...
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/florent37/ExpansionPanel/issues/14#issuecomment-368143011, or mute the thread https://github.com/notifications/unsubscribe-auth/AFfQXAwLt6oOQn4KNJm_hLPDEBkzLpnZks5tXyztgaJpZM4SIIQZ .
I added this into 1.0.9 can you try ?
its partially work, after rotating expanded state is saved but then can't collapse view
expansionLayout is null after call setup() from onRestoreInstanceState(...)
Ok, will fix it
Le 24 févr. 2018 20:16, "Alex" [email protected] a écrit :
expansionLayout is null after call setup() from onRestoreInstanceState(...)
— You are receiving this because you commented.
Reply to this email directly, view it on GitHub https://github.com/florent37/ExpansionPanel/issues/14#issuecomment-368252229, or mute the thread https://github.com/notifications/unsubscribe-auth/AFfQXG5DGP3jGeNUqOBYo2yjCMO_P1Ehks5tYF_xgaJpZM4SIIQZ .
Problem with the call to restore super state. I fix this with extends View.BaseSavedState. But found another bug, when header use identical id's in View or RecuclerView, in this case, state is single for all headers.
I'm on this now
2018-02-25 10:21 GMT+01:00 Alex [email protected]:
Problem with the call to restore super state. I fix this with extends View.BaseSavedState. But found another bug, when header use identical id's in View or RecuclerView, in this case, state is single for all headers.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/florent37/ExpansionPanel/issues/14#issuecomment-368295004, or mute the thread https://github.com/notifications/unsubscribe-auth/AFfQXFiAM24PZgtDc9hJIrOm4OK79liXks5tYSY1gaJpZM4SIIQZ .
I fixed the saved/restore instance, but yes I have the same bug as you : if all the views have the same Identfier... I've got the same restored instance
2018-02-25 10:24 GMT+01:00 Florent Champigny [email protected]:
I'm on this now
2018-02-25 10:21 GMT+01:00 Alex [email protected]:
Problem with the call to restore super state. I fix this with extends View.BaseSavedState. But found another bug, when header use identical id's in View or RecuclerView, in this case, state is single for all headers.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/florent37/ExpansionPanel/issues/14#issuecomment-368295004, or mute the thread https://github.com/notifications/unsubscribe-auth/AFfQXFiAM24PZgtDc9hJIrOm4OK79liXks5tYSY1gaJpZM4SIIQZ .
but with differents id, it will work
2018-02-25 10:32 GMT+01:00 Florent Champigny [email protected]:
I fixed the saved/restore instance, but yes I have the same bug as you : if all the views have the same Identfier... I've got the same restored instance
2018-02-25 10:24 GMT+01:00 Florent Champigny [email protected] :
I'm on this now
2018-02-25 10:21 GMT+01:00 Alex [email protected]:
Problem with the call to restore super state. I fix this with extends View.BaseSavedState. But found another bug, when header use identical id's in View or RecuclerView, in this case, state is single for all headers.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/florent37/ExpansionPanel/issues/14#issuecomment-368295004, or mute the thread https://github.com/notifications/unsubscribe-auth/AFfQXFiAM24PZgtDc9hJIrOm4OK79liXks5tYSY1gaJpZM4SIIQZ .
for RecyclerView this is important
you've got an idea how to fix it ?
because on RecyclerView, each view can have same ids
currently, no...
Can you release latest fixes?
I already pushed it un 1.0.2, Can you clean the gradle cache for this lib ?
Le 26 févr. 2018 15:48, "Alex" [email protected] a écrit :
Can you release latest fixes?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/florent37/ExpansionPanel/issues/14#issuecomment-368526607, or mute the thread https://github.com/notifications/unsubscribe-auth/AFfQXNbIHS0AcybcSoHsQaaFxm3p3Jhkks5tYsQogaJpZM4SIIQZ .
If you can't i will publish a 1.0.3
Le 26 févr. 2018 16:34, "Florent Champigny" [email protected] a écrit :
I already pushed it un 1.0.2, Can you clean the gradle cache for this lib ?
Le 26 févr. 2018 15:48, "Alex" [email protected] a écrit :
Can you release latest fixes?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/florent37/ExpansionPanel/issues/14#issuecomment-368526607, or mute the thread https://github.com/notifications/unsubscribe-auth/AFfQXNbIHS0AcybcSoHsQaaFxm3p3Jhkks5tYsQogaJpZM4SIIQZ .
How can we fix this in recyclerview? If i expand several panels, press the home button and come back, everything is reset
I think that for the recyclerview it is best to implement something like this:
In Recyclerview the following article can be adapted Android: Handling Checkbox state in Recycler Views.
Use SparseBooleanArray for save state each expandable state
private SparseBooleanArray itemStateArray= new SparseBooleanArray();
Detect expandable state in Viewholder
expansionLayout.addListener(new ExpansionLayout.Listener() {
@Override
public void onExpansionChanged(ExpansionLayout expansionLayout, boolean expanded) {
itemStateArray.put(adapterPosition, true);
}
});
https://stackoverflow.com/questions/35424232/issue-refreshing-a-view-of-a-row-in-recyclerview?rq=1 This may help to avoid recreating all views and your state will not be changed. You can update only specific view that you need.