Merge "Adding utility method to temporarily hide scrollbar" into ub-launcher3-dorval-polish

This commit is contained in:
TreeHugger Robot
2017-06-08 01:38:36 +00:00
committed by Android (Google) Code Review
2 changed files with 18 additions and 2 deletions
@@ -48,6 +48,8 @@ public abstract class BaseRecyclerView extends RecyclerView
private int mDownY;
private int mLastY;
private boolean mScrollBarVisible = true;
public BaseRecyclerView(Context context) {
this(context, null);
}
@@ -199,8 +201,18 @@ public abstract class BaseRecyclerView extends RecyclerView
@Override
protected void dispatchDraw(Canvas canvas) {
super.dispatchDraw(canvas);
onUpdateScrollbar(0);
mScrollbar.draw(canvas);
if (mScrollBarVisible) {
onUpdateScrollbar(0);
mScrollbar.draw(canvas);
}
}
/**
* Sets the scrollbar visibility. The call does not refresh the UI, its the responsibility
* of the caller to call {@link #invalidate()}.
*/
public void setScrollBarVisible(boolean visible) {
mScrollBarVisible = visible;
}
/**
@@ -97,6 +97,10 @@ public class AllAppsRecyclerView extends BaseRecyclerView {
mFastScrollHelper = new AllAppsFastScrollHelper(this, apps);
}
public AlphabeticalAppsList getApps() {
return mApps;
}
/**
* Sets the number of apps per row in this recycler view.
*/