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
@@ -18,7 +18,6 @@ package com.android.launcher3.allapps;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import com.android.launcher3.BaseRecyclerView;
import com.android.launcher3.BaseRecyclerViewFastScrollBar;
import com.android.launcher3.FastBitmapDrawable;
import com.android.launcher3.util.Thunk;
@@ -144,8 +143,8 @@ public class AllAppsFastScrollHelper implements AllAppsGridAdapter.BindViewCallb
// Calculate the full animation from the current scroll position to the final scroll
// position, and then run the animation for the duration.
int newScrollY = Math.min(availableScrollHeight,
mRv.getPaddingTop() + mRv.getTop(info.fastScrollToItem.rowIndex));
int newPosition = info.fastScrollToItem.position;
int newScrollY = Math.min(availableScrollHeight, mRv.getCurrentScrollY(newPosition, 0));
int numFrames = mFastScrollFrames.length;
for (int i = 0; i < numFrames; i++) {
// TODO(winsonc): We can interpolate this as well.