Add transient state tracking to Views
Transient state is temporary bookkeeping that Views need to perform that the app should not need to be aware of. Examples include text selection regions and animation state. Transient state is a problem for AdapterViews like ListView that do view recycling. Unless the app takes responsibility for tracking and restoring transient state as if it were a part of the adapter's data set, it cannot correctly recycle views. Selections disappear when an EditText is scrolled out of sight and animations seem to play on the wrong views. Views can now flag themselves as having transient state. (As the name implies, this should be a temporary condition.) If a ViewGroup contains a child with transient state, that ViewGroup also has transient state. AbsListView's recycler now tracks views with transient state separately. Views with transient state will be retained, and until a data set change occurs the same view will be reused for that position instead of calling the adapter's getView() method. The API to set and check transient state is currently hidden. Change-Id: Idfd8eaac2c548337686d8d9f98fda4c64be5b8a0
Loading
Please register or sign in to comment