Merge "Don't orphan footers with transient state Bug #8725945" into jb-mr2-dev

This commit is contained in:
Romain Guy
2013-06-10 17:23:24 +00:00
committed by Android (Google) Code Review
2 changed files with 3 additions and 2 deletions

View File

@@ -2829,6 +2829,7 @@ public final class ViewRootImpl implements ViewParent,
setAccessibilityFocus(null, null);
mView.assignParent(null);
mView = null;
mAttachInfo.mRootView = null;
mAttachInfo.mSurface = null;

View File

@@ -6390,7 +6390,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
int viewType = lp.viewType;
final boolean scrapHasTransientState = scrap.hasTransientState();
if (!shouldRecycleViewType(viewType) || scrapHasTransientState) {
if (viewType != ITEM_VIEW_TYPE_HEADER_OR_FOOTER || scrapHasTransientState) {
if (viewType != ITEM_VIEW_TYPE_HEADER_OR_FOOTER && scrapHasTransientState) {
if (mSkippedScrap == null) {
mSkippedScrap = new ArrayList<View>();
}
@@ -6464,7 +6464,7 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
final boolean scrapHasTransientState = victim.hasTransientState();
if (!shouldRecycleViewType(whichScrap) || scrapHasTransientState) {
// Do not move views that should be ignored
if (whichScrap != ITEM_VIEW_TYPE_HEADER_OR_FOOTER ||
if (whichScrap != ITEM_VIEW_TYPE_HEADER_OR_FOOTER &&
scrapHasTransientState) {
removeDetachedView(victim, false);
}