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

Commit 54af32d2 authored by Adnan Begovic's avatar Adnan Begovic Committed by Ricardo Cerqueira
Browse files

Revert "listview: ensure active views are filled prior than scrap views"

This reverts commit 830a0024.

See http://review.cyanogenmod.org/#/c/67348/

Change-Id: I066e6ee8d9dc478c752ecfa161fd638bce7cee40
parent 602d851b
Loading
Loading
Loading
Loading
+0 −14
Original line number Original line Diff line number Diff line
@@ -6500,12 +6500,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
        private SparseArray<View> mTransientStateViews;
        private SparseArray<View> mTransientStateViews;
        private LongSparseArray<View> mTransientStateViewsById;
        private LongSparseArray<View> mTransientStateViewsById;


        private boolean mIsActiveViewsInitialized;

        boolean isActiveViewsInitialized() {
            return mIsActiveViewsInitialized;
        }

        public void setViewTypeCount(int viewTypeCount) {
        public void setViewTypeCount(int viewTypeCount) {
            if (viewTypeCount < 1) {
            if (viewTypeCount < 1) {
                throw new IllegalArgumentException("Can't have a viewTypeCount < 1");
                throw new IllegalArgumentException("Can't have a viewTypeCount < 1");
@@ -6577,9 +6571,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
            }
            }


            clearTransientStateViews();
            clearTransientStateViews();

            // We want to a refresh of mActiveViews
            mIsActiveViewsInitialized = false;
        }
        }


        /**
        /**
@@ -6590,11 +6581,6 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
         *        mActiveViews
         *        mActiveViews
         */
         */
        void fillActiveViews(int childCount, int firstActivePosition) {
        void fillActiveViews(int childCount, int firstActivePosition) {
            // The recyclebin is initialized when we have some active views.
            if (childCount > 0) {
                mIsActiveViewsInitialized = true;
            }

            if (mActiveViews.length < childCount) {
            if (mActiveViews.length < childCount) {
                mActiveViews = new View[childCount];
                mActiveViews = new View[childCount];
            }
            }
+1 −1
Original line number Original line Diff line number Diff line
@@ -1207,7 +1207,7 @@ public class GridView extends AbsListView {
            final int firstPosition = mFirstPosition;
            final int firstPosition = mFirstPosition;
            final RecycleBin recycleBin = mRecycler;
            final RecycleBin recycleBin = mRecycler;


            if (mRecycler.isActiveViewsInitialized() && dataChanged) {
            if (dataChanged) {
                for (int i = 0; i < childCount; i++) {
                for (int i = 0; i < childCount; i++) {
                    recycleBin.addScrapView(getChildAt(i), firstPosition+i);
                    recycleBin.addScrapView(getChildAt(i), firstPosition+i);
                }
                }
+1 −1
Original line number Original line Diff line number Diff line
@@ -1584,7 +1584,7 @@ public class ListView extends AbsListView {
            // These views will be reused if possible
            // These views will be reused if possible
            final int firstPosition = mFirstPosition;
            final int firstPosition = mFirstPosition;
            final RecycleBin recycleBin = mRecycler;
            final RecycleBin recycleBin = mRecycler;
            if (mRecycler.isActiveViewsInitialized() && dataChanged) {
            if (dataChanged) {
                for (int i = 0; i < childCount; i++) {
                for (int i = 0; i < childCount; i++) {
                    recycleBin.addScrapView(getChildAt(i), firstPosition+i);
                    recycleBin.addScrapView(getChildAt(i), firstPosition+i);
                }
                }