diff options
author | Alan Viverette <alanv@google.com> | 2015-07-07 11:04:32 -0700 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2015-07-07 11:04:32 -0700 |
commit | 1638133b3ff5e94af10c325fdd8482f1e82c5558 (patch) | |
tree | 2c56343590d38de029bb2732e4c97b3ca68901d6 | |
parent | 401aa9d807bdc568f26cd40bfc96d26449267678 (diff) | |
download | frameworks_base-1638133b3ff5e94af10c325fdd8482f1e82c5558.zip frameworks_base-1638133b3ff5e94af10c325fdd8482f1e82c5558.tar.gz frameworks_base-1638133b3ff5e94af10c325fdd8482f1e82c5558.tar.bz2 |
Never fully detach header or footer views in AbsListView
AbsListView has special handling of header and footer views that avoids
full attachment; however, we still need to fully detach and reattach
non-header/footer views that cannot be recycled.
Bug: 22239425
Bug: 22238597
Bug: 22214485
Change-Id: Iae5f954fc76522c0a52d0c25e19985ae0196efa2
-rw-r--r-- | core/java/android/widget/AbsListView.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 8bf6992..b2b98db 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -6605,8 +6605,8 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te void addScrapView(View scrap, int position) { final AbsListView.LayoutParams lp = (AbsListView.LayoutParams) scrap.getLayoutParams(); if (lp == null) { - // Can't recycle, skip the scrap heap. - getSkippedScrap().add(scrap); + // Can't recycle, but we don't know anything about the view. + // Ignore it completely. return; } @@ -6616,8 +6616,12 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te // should otherwise not be recycled. final int viewType = lp.viewType; if (!shouldRecycleViewType(viewType)) { - // Can't recycle, skip the scrap heap. - getSkippedScrap().add(scrap); + // Can't recycle. If it's not a header or footer, which have + // special handling and should be ignored, then skip the scrap + // heap and we'll fully detach the view later. + if (viewType != ITEM_VIEW_TYPE_HEADER_OR_FOOTER) { + getSkippedScrap().add(scrap); + } return; } |