-
Notifications
You must be signed in to change notification settings - Fork 242
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
State for a MultiKey only stores the last View that save() was called for #229
Comments
I noticed this too and held off on any attempt to build compound layouts using multiple keys. |
Keep in mind: views don't always have ids. But I think the running convention is to only expect views with ids to be saved. |
Good catch. This is another weird wrinkle related to MultiKeys being keys themselves. I like the idea of making State's This does add a requirement that views have ids to be persisted, but that's fine IMO. Should be added to javadoc. |
Cool, I'll work on a PR |
Should I blow up if somebody calls |
blowing up sounds right. |
KeyDispatcher
passesKeyChanger
aMap
of contexts, but only oneincomingState
. State.save() looks like this:Unfortunately this means if you're saving view state of multiple keys, only the last one actually gets stored in the bundle 😭 Should probably have a
Map<Int, SparseArray<Parcelable>> viewState
instead and use view ids as the key?The text was updated successfully, but these errors were encountered: