summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-03-13 10:01:35 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-13 10:01:35 +0000
commitc25dbb50c30816c97227b9a26cc46afec4e5318e (patch)
tree4a31ebe6872b0c9dec923f0885978626a7f6db54 /core/java
parentaf6288b721110ffc4b4e68d55398b5ca31fc32e8 (diff)
parent7b09a4e5df908783a95dbfef3bc9fabda339c3a1 (diff)
downloadframeworks_base-c25dbb50c30816c97227b9a26cc46afec4e5318e.zip
frameworks_base-c25dbb50c30816c97227b9a26cc46afec4e5318e.tar.gz
frameworks_base-c25dbb50c30816c97227b9a26cc46afec4e5318e.tar.bz2
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
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/widget/AbsListView.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java
index ac3fb01..ff7463c 100644
--- a/core/java/android/widget/AbsListView.java
+++ b/core/java/android/widget/AbsListView.java
@@ -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.