diff options
author | Winson <winsonc@google.com> | 2016-07-11 18:59:18 -0700 |
---|---|---|
committer | Peter Schiller <peterschiller@google.com> | 2016-07-12 12:16:26 -0700 |
commit | b655b8850064cc4f8e59652b4e3bffc09090769a (patch) | |
tree | 35903c193119dbea9f704ad0449f45398ffd1d3e /src/com/android/launcher3/allapps/AllAppsContainerView.java | |
parent | 7ed42af3398c1764424ebbf2dd6e2a51e05eaf5f (diff) | |
download | android_packages_apps_Trebuchet-b655b8850064cc4f8e59652b4e3bffc09090769a.tar.gz android_packages_apps_Trebuchet-b655b8850064cc4f8e59652b4e3bffc09090769a.tar.bz2 android_packages_apps_Trebuchet-b655b8850064cc4f8e59652b4e3bffc09090769a.zip |
Cleaning up scrollbar logic to properly calculate stable extents.
- Removing old logic which assumed that views were the same size,
especially now we can have variable dividers, etc.
- Simplifying old scroll position logic.
- Removing unnecessary prediction icon layout (same as normal icon)
Bug: 30023608
Change-Id: I39e1126fa586a76a9bdd3ff38cd6e360ac3021e6
Diffstat (limited to 'src/com/android/launcher3/allapps/AllAppsContainerView.java')
-rw-r--r-- | src/com/android/launcher3/allapps/AllAppsContainerView.java | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index 717ce74c7..a9cc8f379 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -364,26 +364,9 @@ public class AllAppsContainerView extends BaseContainerView implements DragSourc FocusedItemDecorator focusedItemDecorator = new FocusedItemDecorator(mAppsRecyclerView); mAppsRecyclerView.addItemDecoration(focusedItemDecorator); + mAppsRecyclerView.preMeasureViews(mAdapter); mAdapter.setIconFocusListener(focusedItemDecorator.getFocusListener()); - // Precalculate the prediction icon and normal icon sizes - LayoutInflater layoutInflater = LayoutInflater.from(getContext()); - final int widthMeasureSpec = MeasureSpec.makeMeasureSpec( - getResources().getDisplayMetrics().widthPixels, MeasureSpec.AT_MOST); - final int heightMeasureSpec = MeasureSpec.makeMeasureSpec( - getResources().getDisplayMetrics().heightPixels, MeasureSpec.AT_MOST); - - BubbleTextView icon = (BubbleTextView) layoutInflater.inflate( - R.layout.all_apps_icon, this, false); - icon.applyDummyInfo(); - icon.measure(widthMeasureSpec, heightMeasureSpec); - BubbleTextView predIcon = (BubbleTextView) layoutInflater.inflate( - R.layout.all_apps_prediction_bar_icon, this, false); - predIcon.applyDummyInfo(); - predIcon.measure(widthMeasureSpec, heightMeasureSpec); - mAppsRecyclerView.setPremeasuredIconHeights(predIcon.getMeasuredHeight(), - icon.getMeasuredHeight()); - // TODO(hyunyoungs): clean up setting the content and the reveal view. if (FeatureFlags.LAUNCHER3_ALL_APPS_PULL_UP) { getContentView().setBackground(null); |