Dpad based scrolling in ListView was mishandling the recycler:
recyclable views were removed instead of detached and non-recyclables views
were detached instead of removed.
diff --git a/core/java/android/widget/ListView.java b/core/java/android/widget/ListView.java
index c63774a..401e7ff 100644
--- a/core/java/android/widget/ListView.java
+++ b/core/java/android/widget/ListView.java
@@ -2781,10 +2781,10 @@
while (first.getBottom() < listTop) {
AbsListView.LayoutParams layoutParams = (LayoutParams) first.getLayoutParams();
if (recycleBin.shouldRecycleViewType(layoutParams.viewType)) {
- removeViewInLayout(first);
+ detachViewFromParent(first);
recycleBin.addScrapView(first);
} else {
- detachViewFromParent(first);
+ removeViewInLayout(first);
}
first = getChildAt(0);
mFirstPosition++;
@@ -2812,10 +2812,10 @@
while (last.getTop() > listBottom) {
AbsListView.LayoutParams layoutParams = (LayoutParams) last.getLayoutParams();
if (recycleBin.shouldRecycleViewType(layoutParams.viewType)) {
- removeViewInLayout(last);
+ detachViewFromParent(last);
recycleBin.addScrapView(last);
} else {
- detachViewFromParent(last);
+ removeViewInLayout(last);
}
last = getChildAt(--lastIndex);
}