GridLayoutManager Fix child state restoring bug
A regression of ag/630154: detached and reattached child is
assigned with obsolete state saved at opening activity.
The (correct) logic is now:
1. Child state is saved when child is unbound (onViewRecycled)
2. When being asked for onSaveInstanceState(), copy the states
saved in (1) and save current onscreen views state into bundle.
Bug in ag/630154 is that in (2) we saved onscreen views state in
the GridView offscreen states and that information can be invalidated
after a while (e.g. selection of a row can change) and it's later
incorrectly used when a view is detached/re-attached.
added test case.
Bug 19937291
Change-Id: Iac6bd849fdd9755471bce6c7763316d0264cc7a2
5 files changed