mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 16:26:47 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user