Loading core/java/android/widget/FastScroller.java +27 −4 Original line number Original line Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.content.res.TypedArray; import android.graphics.Rect; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Build; import android.text.TextUtils; import android.text.TextUtils.TruncateAt; import android.text.TextUtils.TruncateAt; import android.util.IntProperty; import android.util.IntProperty; import android.util.MathUtils; import android.util.MathUtils; Loading Loading @@ -176,6 +177,9 @@ class FastScroller { */ */ private int mState; private int mState; /** Whether the preview image is visible. */ private boolean mShowingPreview; private BaseAdapter mListAdapter; private BaseAdapter mListAdapter; private SectionIndexer mSectionIndexer; private SectionIndexer mSectionIndexer; Loading Loading @@ -769,6 +773,8 @@ class FastScroller { mDecorAnimation = new AnimatorSet(); mDecorAnimation = new AnimatorSet(); mDecorAnimation.playTogether(fadeOut, slideOut); mDecorAnimation.playTogether(fadeOut, slideOut); mDecorAnimation.start(); mDecorAnimation.start(); mShowingPreview = false; } } /** /** Loading @@ -790,6 +796,8 @@ class FastScroller { mDecorAnimation = new AnimatorSet(); mDecorAnimation = new AnimatorSet(); mDecorAnimation.playTogether(fadeIn, fadeOut, slideIn); mDecorAnimation.playTogether(fadeIn, fadeOut, slideIn); mDecorAnimation.start(); mDecorAnimation.start(); mShowingPreview = false; } } /** /** Loading @@ -809,6 +817,8 @@ class FastScroller { mDecorAnimation = new AnimatorSet(); mDecorAnimation = new AnimatorSet(); mDecorAnimation.playTogether(fadeIn, slideIn); mDecorAnimation.playTogether(fadeIn, slideIn); mDecorAnimation.start(); mDecorAnimation.start(); mShowingPreview = true; } } private void postAutoHide() { private void postAutoHide() { Loading Loading @@ -982,9 +992,10 @@ class FastScroller { if (mCurrentSection != sectionIndex) { if (mCurrentSection != sectionIndex) { mCurrentSection = sectionIndex; mCurrentSection = sectionIndex; if (transitionPreviewLayout(sectionIndex)) { final boolean hasPreview = transitionPreviewLayout(sectionIndex); if (!mShowingPreview && hasPreview) { transitionToDragging(); transitionToDragging(); } else { } else if (mShowingPreview && !hasPreview) { transitionToVisible(); transitionToVisible(); } } } } Loading Loading @@ -1072,7 +1083,7 @@ class FastScroller { mPreviewAnimation.start(); mPreviewAnimation.start(); return (text != null && text.length() > 0); return !TextUtils.isEmpty(text); } } /** /** Loading Loading @@ -1184,7 +1195,19 @@ class FastScroller { / positionsInSection; / positionsInSection; } } return (section + posWithinSection) / sectionCount; float result = (section + posWithinSection) / sectionCount; // Fake out the scroll bar for the last item. Since the section indexer // won't ever actually move the list in this end space, make scrolling // across the last item account for whatever space is remaining. if (firstVisibleItem > 0 && firstVisibleItem + visibleItemCount == totalItemCount) { final View lastChild = mList.getChildAt(visibleItemCount - 1); final float lastItemVisible = (float) (mList.getHeight() - mList.getPaddingBottom() - lastChild.getTop()) / lastChild.getHeight(); result += (1 - result) * lastItemVisible; } return result; } } /** /** Loading core/res/res/values/dimens.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -53,7 +53,7 @@ <!-- Minimum size of the fastscroll overlay --> <!-- Minimum size of the fastscroll overlay --> <dimen name="fastscroll_overlay_size">104dp</dimen> <dimen name="fastscroll_overlay_size">104dp</dimen> <!-- Text size of the fastscroll overlay --> <!-- Text size of the fastscroll overlay --> <dimen name="fastscroll_overlay_text_size">24sp</dimen> <dimen name="fastscroll_overlay_text_size">52sp</dimen> <!-- Padding of the fastscroll overlay --> <!-- Padding of the fastscroll overlay --> <dimen name="fastscroll_overlay_padding">16dp</dimen> <dimen name="fastscroll_overlay_padding">16dp</dimen> <!-- Width of the fastscroll thumb --> <!-- Width of the fastscroll thumb --> Loading Loading
core/java/android/widget/FastScroller.java +27 −4 Original line number Original line Diff line number Diff line Loading @@ -29,6 +29,7 @@ import android.content.res.TypedArray; import android.graphics.Rect; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable; import android.os.Build; import android.os.Build; import android.text.TextUtils; import android.text.TextUtils.TruncateAt; import android.text.TextUtils.TruncateAt; import android.util.IntProperty; import android.util.IntProperty; import android.util.MathUtils; import android.util.MathUtils; Loading Loading @@ -176,6 +177,9 @@ class FastScroller { */ */ private int mState; private int mState; /** Whether the preview image is visible. */ private boolean mShowingPreview; private BaseAdapter mListAdapter; private BaseAdapter mListAdapter; private SectionIndexer mSectionIndexer; private SectionIndexer mSectionIndexer; Loading Loading @@ -769,6 +773,8 @@ class FastScroller { mDecorAnimation = new AnimatorSet(); mDecorAnimation = new AnimatorSet(); mDecorAnimation.playTogether(fadeOut, slideOut); mDecorAnimation.playTogether(fadeOut, slideOut); mDecorAnimation.start(); mDecorAnimation.start(); mShowingPreview = false; } } /** /** Loading @@ -790,6 +796,8 @@ class FastScroller { mDecorAnimation = new AnimatorSet(); mDecorAnimation = new AnimatorSet(); mDecorAnimation.playTogether(fadeIn, fadeOut, slideIn); mDecorAnimation.playTogether(fadeIn, fadeOut, slideIn); mDecorAnimation.start(); mDecorAnimation.start(); mShowingPreview = false; } } /** /** Loading @@ -809,6 +817,8 @@ class FastScroller { mDecorAnimation = new AnimatorSet(); mDecorAnimation = new AnimatorSet(); mDecorAnimation.playTogether(fadeIn, slideIn); mDecorAnimation.playTogether(fadeIn, slideIn); mDecorAnimation.start(); mDecorAnimation.start(); mShowingPreview = true; } } private void postAutoHide() { private void postAutoHide() { Loading Loading @@ -982,9 +992,10 @@ class FastScroller { if (mCurrentSection != sectionIndex) { if (mCurrentSection != sectionIndex) { mCurrentSection = sectionIndex; mCurrentSection = sectionIndex; if (transitionPreviewLayout(sectionIndex)) { final boolean hasPreview = transitionPreviewLayout(sectionIndex); if (!mShowingPreview && hasPreview) { transitionToDragging(); transitionToDragging(); } else { } else if (mShowingPreview && !hasPreview) { transitionToVisible(); transitionToVisible(); } } } } Loading Loading @@ -1072,7 +1083,7 @@ class FastScroller { mPreviewAnimation.start(); mPreviewAnimation.start(); return (text != null && text.length() > 0); return !TextUtils.isEmpty(text); } } /** /** Loading Loading @@ -1184,7 +1195,19 @@ class FastScroller { / positionsInSection; / positionsInSection; } } return (section + posWithinSection) / sectionCount; float result = (section + posWithinSection) / sectionCount; // Fake out the scroll bar for the last item. Since the section indexer // won't ever actually move the list in this end space, make scrolling // across the last item account for whatever space is remaining. if (firstVisibleItem > 0 && firstVisibleItem + visibleItemCount == totalItemCount) { final View lastChild = mList.getChildAt(visibleItemCount - 1); final float lastItemVisible = (float) (mList.getHeight() - mList.getPaddingBottom() - lastChild.getTop()) / lastChild.getHeight(); result += (1 - result) * lastItemVisible; } return result; } } /** /** Loading
core/res/res/values/dimens.xml +1 −1 Original line number Original line Diff line number Diff line Loading @@ -53,7 +53,7 @@ <!-- Minimum size of the fastscroll overlay --> <!-- Minimum size of the fastscroll overlay --> <dimen name="fastscroll_overlay_size">104dp</dimen> <dimen name="fastscroll_overlay_size">104dp</dimen> <!-- Text size of the fastscroll overlay --> <!-- Text size of the fastscroll overlay --> <dimen name="fastscroll_overlay_text_size">24sp</dimen> <dimen name="fastscroll_overlay_text_size">52sp</dimen> <!-- Padding of the fastscroll overlay --> <!-- Padding of the fastscroll overlay --> <dimen name="fastscroll_overlay_padding">16dp</dimen> <dimen name="fastscroll_overlay_padding">16dp</dimen> <!-- Width of the fastscroll thumb --> <!-- Width of the fastscroll thumb --> Loading