Loading packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java +7 −2 Original line number Original line Diff line number Diff line Loading @@ -134,7 +134,8 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { TileRecord tile = mTiles.get(i); TileRecord tile = mTiles.get(i); if (mPages.get(index).isFull()) { if (mPages.get(index).isFull()) { if (++index == mPages.size()) { 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) mPages.add((TilePage) LayoutInflater.from(mContext) .inflate(R.layout.qs_paged_page, this, false)); .inflate(R.layout.qs_paged_page, this, false)); } } Loading @@ -145,7 +146,12 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { } } if (mNumPages != index + 1) { if (mNumPages != index + 1) { 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); mPageIndicator.setNumPages(mNumPages); setAdapter(mAdapter); mAdapter.notifyDataSetChanged(); mAdapter.notifyDataSetChanged(); setCurrentItem(0, false); setCurrentItem(0, false); } } Loading Loading @@ -231,7 +237,6 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { private final PagerAdapter mAdapter = new PagerAdapter() { private final PagerAdapter mAdapter = new PagerAdapter() { public void destroyItem(ViewGroup container, int position, Object object) { public void destroyItem(ViewGroup container, int position, Object object) { if (DEBUG) Log.d(TAG, "Destantiating " + position); if (DEBUG) Log.d(TAG, "Destantiating " + position); // TODO: Find way to clean up the extra pages. container.removeView((View) object); container.removeView((View) object); } } Loading Loading
packages/SystemUI/src/com/android/systemui/qs/PagedTileLayout.java +7 −2 Original line number Original line Diff line number Diff line Loading @@ -134,7 +134,8 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { TileRecord tile = mTiles.get(i); TileRecord tile = mTiles.get(i); if (mPages.get(index).isFull()) { if (mPages.get(index).isFull()) { if (++index == mPages.size()) { 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) mPages.add((TilePage) LayoutInflater.from(mContext) .inflate(R.layout.qs_paged_page, this, false)); .inflate(R.layout.qs_paged_page, this, false)); } } Loading @@ -145,7 +146,12 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { } } if (mNumPages != index + 1) { if (mNumPages != index + 1) { 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); mPageIndicator.setNumPages(mNumPages); setAdapter(mAdapter); mAdapter.notifyDataSetChanged(); mAdapter.notifyDataSetChanged(); setCurrentItem(0, false); setCurrentItem(0, false); } } Loading Loading @@ -231,7 +237,6 @@ public class PagedTileLayout extends ViewPager implements QSTileLayout { private final PagerAdapter mAdapter = new PagerAdapter() { private final PagerAdapter mAdapter = new PagerAdapter() { public void destroyItem(ViewGroup container, int position, Object object) { public void destroyItem(ViewGroup container, int position, Object object) { if (DEBUG) Log.d(TAG, "Destantiating " + position); if (DEBUG) Log.d(TAG, "Destantiating " + position); // TODO: Find way to clean up the extra pages. container.removeView((View) object); container.removeView((View) object); } } Loading