Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2d51bff2 authored by Romain Guy's avatar Romain Guy
Browse files

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.
parent 5dbe0c75
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -2781,10 +2781,10 @@ public class ListView extends AbsListView {
            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 @@ public class ListView extends AbsListView {
            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);
            }