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

Commit 6b8c4bbb authored by Android Build Merger (Role)'s avatar Android Build Merger (Role) Committed by Android (Google) Code Review
Browse files

Merge "Merge "Fix QS crash with RTL rotate" into nyc-dev am: 4a19a204 am:...

Merge "Merge "Fix QS crash with RTL rotate" into nyc-dev am: 4a19a204 am: 705e67b3" into nyc-mr1-dev-plus-aosp
parents 49ac8e2f 71116262
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -134,7 +134,8 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
            TileRecord tile = mTiles.get(i);
            if (mPages.get(index).isFull()) {
                if (++index == mPages.size()) {
                    if (DEBUG) Log.d(TAG, "Adding page for " + tile.tile.getClass().getSimpleName());
                    if (DEBUG) Log.d(TAG, "Adding page for "
                            + tile.tile.getClass().getSimpleName());
                    mPages.add((TilePage) LayoutInflater.from(mContext)
                            .inflate(R.layout.qs_paged_page, this, false));
                }
@@ -145,7 +146,12 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
        }
        if (mNumPages != index + 1) {
            mNumPages = index + 1;
            while (mPages.size() > mNumPages) {
                mPages.remove(mPages.size() - 1);
            }
            if (DEBUG) Log.d(TAG, "Size: " + mNumPages);
            mPageIndicator.setNumPages(mNumPages);
            setAdapter(mAdapter);
            mAdapter.notifyDataSetChanged();
            setCurrentItem(0, false);
        }
@@ -231,7 +237,6 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout {
    private final PagerAdapter mAdapter = new PagerAdapter() {
        public void destroyItem(ViewGroup container, int position, Object object) {
            if (DEBUG) Log.d(TAG, "Destantiating " + position);
            // TODO: Find way to clean up the extra pages.
            container.removeView((View) object);
        }