Merge "Resolve pointer icon over FastScroller to arrow."
This commit is contained in:
committed by
Android (Google) Code Review
commit
ceb250424a
@@ -54,6 +54,7 @@ import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.PointerIcon;
|
||||
import android.view.VelocityTracker;
|
||||
import android.view.View;
|
||||
import android.view.ViewConfiguration;
|
||||
@@ -4401,6 +4402,17 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
|
||||
return super.onInterceptHoverEvent(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PointerIcon onResolvePointerIcon(MotionEvent event, int pointerIndex) {
|
||||
if (mFastScroll != null) {
|
||||
PointerIcon pointerIcon = mFastScroll.onResolvePointerIcon(event, pointerIndex);
|
||||
if (pointerIcon != null) {
|
||||
return pointerIcon;
|
||||
}
|
||||
}
|
||||
return super.onResolvePointerIcon(event, pointerIndex);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
||||
final int actionMasked = ev.getActionMasked();
|
||||
|
||||
@@ -38,6 +38,7 @@ import android.util.Property;
|
||||
import android.util.TypedValue;
|
||||
import android.view.Gravity;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.PointerIcon;
|
||||
import android.view.View;
|
||||
import android.view.View.MeasureSpec;
|
||||
import android.view.ViewConfiguration;
|
||||
@@ -1441,6 +1442,13 @@ class FastScroller {
|
||||
return false;
|
||||
}
|
||||
|
||||
public PointerIcon onResolvePointerIcon(MotionEvent event, int pointerIndex) {
|
||||
if (mState == STATE_DRAGGING || isPointInside(event.getX(), event.getY())) {
|
||||
return PointerIcon.getSystemIcon(mList.getContext(), PointerIcon.TYPE_ARROW);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean onTouchEvent(MotionEvent me) {
|
||||
if (!isEnabled()) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user