Fixes for fast-scrollbar when using work profile tabs in all apps.

- do not hide scrollbar between switching tabs
- full scrollbar height
- show predictionrow only when fully scrolled to top

Bug: 70037972
Bug: 68713881

Change-Id: Icaa434ce2726b75d22ec4ac3287ab2b0e18ce42b
This commit is contained in:
Mario Bertschler
2017-11-27 13:10:44 -08:00
parent 4018f3df14
commit 2d3157a0bf
8 changed files with 41 additions and 54 deletions

View File

@@ -68,6 +68,7 @@ public abstract class BaseRecyclerView extends RecyclerView
ViewGroup parent = (ViewGroup) getParent().getParent();
mScrollbar = parent.findViewById(R.id.fast_scroller);
mScrollbar.setRecyclerView(this, parent.findViewById(R.id.fast_scroller_popup));
onUpdateScrollbar(0);
}
/**
@@ -112,7 +113,7 @@ public abstract class BaseRecyclerView extends RecyclerView
* Returns the height of the fast scroll bar
*/
public int getScrollbarTrackHeight() {
return getHeight() - getScrollBarTop() - getPaddingBottom();
return mScrollbar.getHeight() - getScrollBarTop() - getPaddingBottom();
}
/**
@@ -130,12 +131,6 @@ public abstract class BaseRecyclerView extends RecyclerView
return availableScrollBarHeight;
}
@Override
protected void dispatchDraw(Canvas canvas) {
onUpdateScrollbar(0);
super.dispatchDraw(canvas);
}
/**
* Updates the scrollbar thumb offset to match the visible scroll of the recycler view. It does
* this by mapping the available scroll area of the recycler view to the available space for the