diff options
author | Peter Schiller <peterschiller@google.com> | 2016-07-07 14:47:05 -0700 |
---|---|---|
committer | Peter Schiller <peterschiller@google.com> | 2016-07-08 15:02:03 -0700 |
commit | c2a20ff0a87f58b2be66f067b0024db7ff5185d3 (patch) | |
tree | d49af77af6962200175d705c2dc8e9726c93c5cf /src/com/android/launcher3/allapps/AllAppsRecyclerView.java | |
parent | 723657c584976c627f44683471d71a39c78c1182 (diff) | |
download | android_packages_apps_Trebuchet-c2a20ff0a87f58b2be66f067b0024db7ff5185d3.tar.gz android_packages_apps_Trebuchet-c2a20ff0a87f58b2be66f067b0024db7ff5185d3.tar.bz2 android_packages_apps_Trebuchet-c2a20ff0a87f58b2be66f067b0024db7ff5185d3.zip |
Consolidate all the dividers to provide same look and feel
Bug: 30017936
Change-Id: I072cb116dba1df555a63f3f67b730f7f9c3a235a
Diffstat (limited to 'src/com/android/launcher3/allapps/AllAppsRecyclerView.java')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsRecyclerView.java | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java index 8d5ade3fe..ac881138d 100644 --- a/src/com/android/launcher3/allapps/AllAppsRecyclerView.java +++ b/src/com/android/launcher3/allapps/AllAppsRecyclerView.java @@ -98,12 +98,14 @@ public class AllAppsRecyclerView extends BaseRecyclerView RecyclerView.RecycledViewPool pool = getRecycledViewPool(); int approxRows = (int) Math.ceil(grid.availableHeightPx / grid.allAppsIconSizePx); - pool.setMaxRecycledViews(AllAppsGridAdapter.EMPTY_SEARCH_VIEW_TYPE, 1); - pool.setMaxRecycledViews(AllAppsGridAdapter.SEARCH_MARKET_DIVIDER_VIEW_TYPE, 1); - pool.setMaxRecycledViews(AllAppsGridAdapter.SEARCH_MARKET_VIEW_TYPE, 1); - pool.setMaxRecycledViews(AllAppsGridAdapter.ICON_VIEW_TYPE, approxRows * mNumAppsPerRow); - pool.setMaxRecycledViews(AllAppsGridAdapter.PREDICTION_ICON_VIEW_TYPE, mNumAppsPerRow); - pool.setMaxRecycledViews(AllAppsGridAdapter.SECTION_BREAK_VIEW_TYPE, approxRows); + pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_EMPTY_SEARCH, 1); + pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_SEARCH_DIVIDER, 1); + pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_SEARCH_MARKET_DIVIDER, 1); + pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_SEARCH_MARKET, 1); + pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_ICON, approxRows * mNumAppsPerRow); + pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_PREDICTION_ICON, mNumAppsPerRow); + pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_PREDICTION_DIVIDER, 1); + pool.setMaxRecycledViews(AllAppsGridAdapter.VIEW_TYPE_SECTION_BREAK, approxRows); } /** @@ -176,7 +178,7 @@ public class AllAppsRecyclerView extends BaseRecyclerView if (position != NO_POSITION) { List<AlphabeticalAppsList.AdapterItem> items = mApps.getAdapterItems(); AlphabeticalAppsList.AdapterItem item = items.get(position); - if (item.viewType == AllAppsGridAdapter.PREDICTION_ICON_VIEW_TYPE) { + if (item.viewType == AllAppsGridAdapter.VIEW_TYPE_PREDICTION_ICON) { targetParent.containerType = LauncherLogProto.PREDICTION; return; } @@ -265,7 +267,7 @@ public class AllAppsRecyclerView extends BaseRecyclerView // Find the index and height of the first visible row (all rows have the same height) int rowCount = mApps.getNumAppRows(); - getCurScrollState(mScrollPosState, -1); + getCurScrollState(mScrollPosState, AllAppsGridAdapter.VIEW_TYPE_MASK_ICON); if (mScrollPosState.rowIndex < 0) { mScrollbar.setThumbOffset(-1, -1); return; @@ -352,7 +354,7 @@ public class AllAppsRecyclerView extends BaseRecyclerView int position = getChildPosition(child); if (position != NO_POSITION) { AlphabeticalAppsList.AdapterItem item = items.get(position); - if ((item.viewType & viewTypeMask) != 0) { + if (AllAppsGridAdapter.isViewType(item.viewType, viewTypeMask)) { stateOut.rowIndex = item.rowIndex; stateOut.rowTopOffset = getLayoutManager().getDecoratedTop(child); stateOut.itemPos = position; |