am 90433ee7: am e89c65fb: am 8830db0a: Merge "Never fully detach header or footer views in AbsListView" into mnc-dev

* commit '90433ee758b164d74a2beb42ef79ca7c10263741':
  Never fully detach header or footer views in AbsListView
This commit is contained in:
Alan Viverette
2015-07-07 21:42:18 +00:00
committed by Android Git Automerger

View File

@@ -6605,8 +6605,8 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
void addScrapView(View scrap, int position) { void addScrapView(View scrap, int position) {
final AbsListView.LayoutParams lp = (AbsListView.LayoutParams) scrap.getLayoutParams(); final AbsListView.LayoutParams lp = (AbsListView.LayoutParams) scrap.getLayoutParams();
if (lp == null) { if (lp == null) {
// Can't recycle, skip the scrap heap. // Can't recycle, but we don't know anything about the view.
getSkippedScrap().add(scrap); // Ignore it completely.
return; return;
} }
@@ -6616,8 +6616,12 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
// should otherwise not be recycled. // should otherwise not be recycled.
final int viewType = lp.viewType; final int viewType = lp.viewType;
if (!shouldRecycleViewType(viewType)) { if (!shouldRecycleViewType(viewType)) {
// Can't recycle, skip the scrap heap. // Can't recycle. If it's not a header or footer, which have
getSkippedScrap().add(scrap); // 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; return;
} }