Tweaking the apps list fast scroller.

- Making the view span the full width so that you can grab the scroller on the edge of the screen.
- Offsetting the fast-scoll popup so that you can see it as you scrub.

Change-Id: If1b1934bbeac0660d829cfc29c9e588df927c5e5
This commit is contained in:
Winson Chung
2015-03-16 12:39:05 -07:00
parent c13b994c04
commit aa2ab254ea
14 changed files with 114 additions and 30 deletions

View File

@@ -84,12 +84,13 @@ class AppsGridAdapter extends RecyclerView.Adapter<AppsGridAdapter.ViewHolder> {
mSectionTextPaint.getTextBounds(section, 0, section.length(),
mTmpBounds);
if (mIsRtl) {
c.drawText(section, parent.getWidth() - mStartMargin +
(mStartMargin - mTmpBounds.width()) / 2,
int left = parent.getWidth() - mPaddingStart - mStartMargin;
c.drawText(section, left + (mStartMargin - mTmpBounds.width()) / 2,
child.getTop() + (2 * child.getPaddingTop()) +
mTmpBounds.height(), mSectionTextPaint);
} else {
c.drawText(section, (mStartMargin - mTmpBounds.width()) / 2,
int left = mPaddingStart;
c.drawText(section, left + (mStartMargin - mTmpBounds.width()) / 2,
child.getTop() + (2 * child.getPaddingTop()) +
mTmpBounds.height(), mSectionTextPaint);
}
@@ -118,6 +119,7 @@ class AppsGridAdapter extends RecyclerView.Adapter<AppsGridAdapter.ViewHolder> {
private String mEmptySearchText;
// Section drawing
private int mPaddingStart;
private int mStartMargin;
private Paint mSectionTextPaint;
private Rect mTmpBounds = new Rect();
@@ -136,6 +138,7 @@ class AppsGridAdapter extends RecyclerView.Adapter<AppsGridAdapter.ViewHolder> {
mIconClickListener = iconClickListener;
mIconLongClickListener = iconLongClickListener;
mStartMargin = res.getDimensionPixelSize(R.dimen.apps_grid_view_start_margin);
mPaddingStart = res.getDimensionPixelSize(R.dimen.apps_container_inset);
mSectionTextPaint = new Paint();
mSectionTextPaint.setTextSize(res.getDimensionPixelSize(
R.dimen.apps_view_section_text_size));