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
This commit is contained in:
Winson
2016-07-11 18:59:18 -07:00
committed by Peter Schiller
parent 7ed42af339
commit b655b88500
11 changed files with 214 additions and 181 deletions

View File

@@ -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);