Lines Matching defs:pointerId

208          * @param pointerId ID of the pointer touching the described edge(s)
214 public void onEdgeTouched(int edgeFlags, int pointerId) {}
234 * @param pointerId ID of the pointer touching the described edge(s)
240 public void onEdgeDragStarted(int edgeFlags, int pointerId) {}
276 * with the pointer indicated by pointerId. The callback should return true if the user
287 * @param pointerId ID of the pointer attempting the capture
290 public abstract boolean tryCaptureView(View child, int pointerId);
783 private void clearMotionHistory(int pointerId) {
787 mInitialMotionX[pointerId] = 0;
788 mInitialMotionY[pointerId] = 0;
789 mLastMotionX[pointerId] = 0;
790 mLastMotionY[pointerId] = 0;
791 mInitialEdgesTouched[pointerId] = 0;
792 mEdgeDragsInProgress[pointerId] = 0;
793 mEdgeDragsLocked[pointerId] = 0;
794 mPointersDown &= ~(1 << pointerId);
797 private void ensureMotionHistorySizeForId(int pointerId) {
798 if (mInitialMotionX == null || mInitialMotionX.length <= pointerId) {
799 float[] imx = new float[pointerId + 1];
800 float[] imy = new float[pointerId + 1];
801 float[] lmx = new float[pointerId + 1];
802 float[] lmy = new float[pointerId + 1];
803 int[] iit = new int[pointerId + 1];
804 int[] edip = new int[pointerId + 1];
805 int[] edl = new int[pointerId + 1];
827 private void saveInitialMotion(float x, float y, int pointerId) {
828 ensureMotionHistorySizeForId(pointerId);
829 mInitialMotionX[pointerId] = mLastMotionX[pointerId] = x;
830 mInitialMotionY[pointerId] = mLastMotionY[pointerId] = y;
831 mInitialEdgesTouched[pointerId] = getEdgesTouched((int) x, (int) y);
832 mPointersDown |= 1 << pointerId;
838 final int pointerId = MotionEventCompat.getPointerId(ev, i);
841 mLastMotionX[pointerId] = x;
842 mLastMotionY[pointerId] = y;
856 * @param pointerId pointer ID to check; corresponds to IDs provided by MotionEvent
859 public boolean isPointerDown(int pointerId) {
860 return (mPointersDown & 1 << pointerId) != 0;
879 * @param pointerId Pointer to capture with
882 boolean tryCaptureViewForDrag(View toCapture, int pointerId) {
883 if (toCapture == mCapturedView && mActivePointerId == pointerId) {
887 if (toCapture != null && mCallback.tryCaptureView(toCapture, pointerId)) {
888 mActivePointerId = pointerId;
889 captureChildView(toCapture, pointerId);
957 final int pointerId = MotionEventCompat.getPointerId(ev, 0);
958 saveInitialMotion(x, y, pointerId);
964 tryCaptureViewForDrag(toCapture, pointerId);
967 final int edgesTouched = mInitialEdgesTouched[pointerId];
969 mCallback.onEdgeTouched(edgesTouched & mTrackingEdges, pointerId);
975 final int pointerId = MotionEventCompat.getPointerId(ev, actionIndex);
979 saveInitialMotion(x, y, pointerId);
983 final int edgesTouched = mInitialEdgesTouched[pointerId];
985 mCallback.onEdgeTouched(edgesTouched & mTrackingEdges, pointerId);
991 tryCaptureViewForDrag(toCapture, pointerId);
1001 final int pointerId = MotionEventCompat.getPointerId(ev, i);
1004 final float dx = x - mInitialMotionX[pointerId];
1005 final float dy = y - mInitialMotionY[pointerId];
1007 reportNewEdgeDrags(dx, dy, pointerId);
1015 tryCaptureViewForDrag(toCapture, pointerId)) {
1024 final int pointerId = MotionEventCompat.getPointerId(ev, actionIndex);
1025 clearMotionHistory(pointerId);
1064 final int pointerId = MotionEventCompat.getPointerId(ev, 0);
1067 saveInitialMotion(x, y, pointerId);
1072 tryCaptureViewForDrag(toCapture, pointerId);
1074 final int edgesTouched = mInitialEdgesTouched[pointerId];
1076 mCallback.onEdgeTouched(edgesTouched & mTrackingEdges, pointerId);
1082 final int pointerId = MotionEventCompat.getPointerId(ev, actionIndex);
1086 saveInitialMotion(x, y, pointerId);
1093 tryCaptureViewForDrag(toCapture, pointerId);
1095 final int edgesTouched = mInitialEdgesTouched[pointerId];
1097 mCallback.onEdgeTouched(edgesTouched & mTrackingEdges, pointerId);
1104 tryCaptureViewForDrag(mCapturedView, pointerId);
1124 final int pointerId = MotionEventCompat.getPointerId(ev, i);
1127 final float dx = x - mInitialMotionX[pointerId];
1128 final float dy = y - mInitialMotionY[pointerId];
1130 reportNewEdgeDrags(dx, dy, pointerId);
1138 tryCaptureViewForDrag(toCapture, pointerId)) {
1148 final int pointerId = MotionEventCompat.getPointerId(ev, actionIndex);
1149 if (mDragState == STATE_DRAGGING && pointerId == mActivePointerId) {
1174 clearMotionHistory(pointerId);
1196 private void reportNewEdgeDrags(float dx, float dy, int pointerId) {
1198 if (checkNewEdgeDrag(dx, dy, pointerId, EDGE_LEFT)) {
1201 if (checkNewEdgeDrag(dy, dx, pointerId, EDGE_TOP)) {
1204 if (checkNewEdgeDrag(dx, dy, pointerId, EDGE_RIGHT)) {
1207 if (checkNewEdgeDrag(dy, dx, pointerId, EDGE_BOTTOM)) {
1212 mEdgeDragsInProgress[pointerId] |= dragsStarted;
1213 mCallback.onEdgeDragStarted(dragsStarted, pointerId);
1217 private boolean checkNewEdgeDrag(float delta, float odelta, int pointerId, int edge) {
1221 if ((mInitialEdgesTouched[pointerId] & edge) != edge || (mTrackingEdges & edge) == 0 ||
1222 (mEdgeDragsLocked[pointerId] & edge) == edge ||
1223 (mEdgeDragsInProgress[pointerId] & edge) == edge ||
1228 mEdgeDragsLocked[pointerId] |= edge;
1231 return (mEdgeDragsInProgress[pointerId] & edge) == 0 && absDelta > mTouchSlop;
1297 * @param pointerId ID of the pointer to slop check as specified by MotionEvent
1300 public boolean checkTouchSlop(int directions, int pointerId) {
1301 if (!isPointerDown(pointerId)) {
1308 final float dx = mLastMotionX[pointerId] - mInitialMotionX[pointerId];
1309 final float dy = mLastMotionY[pointerId] - mInitialMotionY[pointerId];
1350 public boolean isEdgeTouched(int edges, int pointerId) {
1351 return isPointerDown(pointerId) && (mInitialEdgesTouched[pointerId] & edges) != 0;