Loading core/java/android/widget/AbsListView.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -3783,6 +3783,15 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te super.requestDisallowInterceptTouchEvent(disallowIntercept); super.requestDisallowInterceptTouchEvent(disallowIntercept); } } @Override public boolean onInterceptHoverEvent(MotionEvent event) { if (mFastScroller != null && mFastScroller.onInterceptHoverEvent(event)) { return true; } return super.onInterceptHoverEvent(event); } @Override @Override public boolean onInterceptTouchEvent(MotionEvent ev) { public boolean onInterceptTouchEvent(MotionEvent ev) { int action = ev.getAction(); int action = ev.getAction(); Loading core/java/android/widget/FastScroller.java +25 −5 Original line number Original line Diff line number Diff line Loading @@ -300,8 +300,7 @@ class FastScroller { getSectionsFromIndexer(); getSectionsFromIndexer(); refreshDrawablePressedState(); refreshDrawablePressedState(); setScrollbarPosition(mList.getVerticalScrollbarPosition()); setScrollbarPosition(mList.getVerticalScrollbarPosition()); postAutoHide(); mList.postDelayed(mDeferHide, FADE_TIMEOUT); } } /** /** Loading Loading @@ -346,7 +345,7 @@ class FastScroller { if (alwaysShow) { if (alwaysShow) { setState(STATE_VISIBLE); setState(STATE_VISIBLE); } else if (mState == STATE_VISIBLE) { } else if (mState == STATE_VISIBLE) { mList.postDelayed(mDeferHide, FADE_TIMEOUT); postAutoHide(); } } } } Loading Loading @@ -708,6 +707,11 @@ class FastScroller { mDecorAnimation.start(); mDecorAnimation.start(); } } private void postAutoHide() { mList.removeCallbacks(mDeferHide); mList.postDelayed(mDeferHide, FADE_TIMEOUT); } private boolean isLongList(int visibleItemCount, int totalItemCount) { private boolean isLongList(int visibleItemCount, int totalItemCount) { // Are there enough pages to require fast scroll? Recompute only if // Are there enough pages to require fast scroll? Recompute only if // total count changes. // total count changes. Loading Loading @@ -738,7 +742,7 @@ class FastScroller { // Show the thumb, if necessary, and set up auto-fade. // Show the thumb, if necessary, and set up auto-fade. if (mState != STATE_DRAGGING) { if (mState != STATE_DRAGGING) { setState(STATE_VISIBLE); setState(STATE_VISIBLE); mList.postDelayed(mDeferHide, FADE_TIMEOUT); postAutoHide(); } } } } } } Loading Loading @@ -1161,6 +1165,22 @@ class FastScroller { return false; return false; } } public boolean onInterceptHoverEvent(MotionEvent ev) { if (!mEnabled) { return false; } final int actionMasked = ev.getActionMasked(); if ((actionMasked == MotionEvent.ACTION_HOVER_ENTER || actionMasked == MotionEvent.ACTION_HOVER_MOVE) && mState == STATE_NONE && isPointInside(ev.getX(), ev.getY())) { setState(STATE_VISIBLE); postAutoHide(); } return false; } public boolean onTouchEvent(MotionEvent me) { public boolean onTouchEvent(MotionEvent me) { if (!mEnabled) { if (!mEnabled) { return false; return false; Loading Loading @@ -1197,7 +1217,7 @@ class FastScroller { } } setState(STATE_VISIBLE); setState(STATE_VISIBLE); mList.postDelayed(mDeferHide, FADE_TIMEOUT); postAutoHide(); return true; return true; } } Loading Loading
core/java/android/widget/AbsListView.java +9 −0 Original line number Original line Diff line number Diff line Loading @@ -3783,6 +3783,15 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te super.requestDisallowInterceptTouchEvent(disallowIntercept); super.requestDisallowInterceptTouchEvent(disallowIntercept); } } @Override public boolean onInterceptHoverEvent(MotionEvent event) { if (mFastScroller != null && mFastScroller.onInterceptHoverEvent(event)) { return true; } return super.onInterceptHoverEvent(event); } @Override @Override public boolean onInterceptTouchEvent(MotionEvent ev) { public boolean onInterceptTouchEvent(MotionEvent ev) { int action = ev.getAction(); int action = ev.getAction(); Loading
core/java/android/widget/FastScroller.java +25 −5 Original line number Original line Diff line number Diff line Loading @@ -300,8 +300,7 @@ class FastScroller { getSectionsFromIndexer(); getSectionsFromIndexer(); refreshDrawablePressedState(); refreshDrawablePressedState(); setScrollbarPosition(mList.getVerticalScrollbarPosition()); setScrollbarPosition(mList.getVerticalScrollbarPosition()); postAutoHide(); mList.postDelayed(mDeferHide, FADE_TIMEOUT); } } /** /** Loading Loading @@ -346,7 +345,7 @@ class FastScroller { if (alwaysShow) { if (alwaysShow) { setState(STATE_VISIBLE); setState(STATE_VISIBLE); } else if (mState == STATE_VISIBLE) { } else if (mState == STATE_VISIBLE) { mList.postDelayed(mDeferHide, FADE_TIMEOUT); postAutoHide(); } } } } Loading Loading @@ -708,6 +707,11 @@ class FastScroller { mDecorAnimation.start(); mDecorAnimation.start(); } } private void postAutoHide() { mList.removeCallbacks(mDeferHide); mList.postDelayed(mDeferHide, FADE_TIMEOUT); } private boolean isLongList(int visibleItemCount, int totalItemCount) { private boolean isLongList(int visibleItemCount, int totalItemCount) { // Are there enough pages to require fast scroll? Recompute only if // Are there enough pages to require fast scroll? Recompute only if // total count changes. // total count changes. Loading Loading @@ -738,7 +742,7 @@ class FastScroller { // Show the thumb, if necessary, and set up auto-fade. // Show the thumb, if necessary, and set up auto-fade. if (mState != STATE_DRAGGING) { if (mState != STATE_DRAGGING) { setState(STATE_VISIBLE); setState(STATE_VISIBLE); mList.postDelayed(mDeferHide, FADE_TIMEOUT); postAutoHide(); } } } } } } Loading Loading @@ -1161,6 +1165,22 @@ class FastScroller { return false; return false; } } public boolean onInterceptHoverEvent(MotionEvent ev) { if (!mEnabled) { return false; } final int actionMasked = ev.getActionMasked(); if ((actionMasked == MotionEvent.ACTION_HOVER_ENTER || actionMasked == MotionEvent.ACTION_HOVER_MOVE) && mState == STATE_NONE && isPointInside(ev.getX(), ev.getY())) { setState(STATE_VISIBLE); postAutoHide(); } return false; } public boolean onTouchEvent(MotionEvent me) { public boolean onTouchEvent(MotionEvent me) { if (!mEnabled) { if (!mEnabled) { return false; return false; Loading Loading @@ -1197,7 +1217,7 @@ class FastScroller { } } setState(STATE_VISIBLE); setState(STATE_VISIBLE); mList.postDelayed(mDeferHide, FADE_TIMEOUT); postAutoHide(); return true; return true; } } Loading