am 7b09a4e5: am e910a7ce: Merge "DO NOT MERGE Check item type before re-binding transient state views" into klp-dev

* commit '7b09a4e5df908783a95dbfef3bc9fabda339c3a1':
  DO NOT MERGE Check item type before re-binding transient state views
This commit is contained in:
Alan Viverette
2014-03-13 10:01:35 +00:00
committed by Android Git Automerger

View File

@@ -2233,10 +2233,16 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
// data and discard the view if we fail.
final View transientView = mRecycler.getTransientStateView(position);
if (transientView != null) {
final View updatedView = mAdapter.getView(position, transientView, this);
if (updatedView != transientView) {
// Failed to re-bind the data, scrap the obtained view.
mRecycler.addScrapView(updatedView, position);
final LayoutParams params = (LayoutParams) transientView.getLayoutParams();
// If the view type hasn't changed, attempt to re-bind the data.
if (params.viewType == mAdapter.getItemViewType(position)) {
final View updatedView = mAdapter.getView(position, transientView, this);
// If we failed to re-bind the data, scrap the obtained view.
if (updatedView != transientView) {
mRecycler.addScrapView(updatedView, position);
}
}
// Scrap view implies temporary detachment.