@@ -120,7 +120,7 @@ public class ViewDragHelper {
120
120
121
121
private float [] mLastMotionY ;
122
122
123
- private int [] mInitialEdgesTouched ;
123
+ private int [] mInitialEdgeTouched ;
124
124
125
125
private int [] mEdgeDragsInProgress ;
126
126
@@ -857,7 +857,7 @@ private void clearMotionHistory() {
857
857
Arrays .fill (mInitialMotionY , 0 );
858
858
Arrays .fill (mLastMotionX , 0 );
859
859
Arrays .fill (mLastMotionY , 0 );
860
- Arrays .fill (mInitialEdgesTouched , 0 );
860
+ Arrays .fill (mInitialEdgeTouched , 0 );
861
861
Arrays .fill (mEdgeDragsInProgress , 0 );
862
862
Arrays .fill (mEdgeDragsLocked , 0 );
863
863
mPointersDown = 0 ;
@@ -871,7 +871,7 @@ private void clearMotionHistory(int pointerId) {
871
871
mInitialMotionY [pointerId ] = 0 ;
872
872
mLastMotionX [pointerId ] = 0 ;
873
873
mLastMotionY [pointerId ] = 0 ;
874
- mInitialEdgesTouched [pointerId ] = 0 ;
874
+ mInitialEdgeTouched [pointerId ] = 0 ;
875
875
mEdgeDragsInProgress [pointerId ] = 0 ;
876
876
mEdgeDragsLocked [pointerId ] = 0 ;
877
877
mPointersDown &= ~(1 << pointerId );
@@ -892,7 +892,7 @@ private void ensureMotionHistorySizeForId(int pointerId) {
892
892
System .arraycopy (mInitialMotionY , 0 , imy , 0 , mInitialMotionY .length );
893
893
System .arraycopy (mLastMotionX , 0 , lmx , 0 , mLastMotionX .length );
894
894
System .arraycopy (mLastMotionY , 0 , lmy , 0 , mLastMotionY .length );
895
- System .arraycopy (mInitialEdgesTouched , 0 , iit , 0 , mInitialEdgesTouched .length );
895
+ System .arraycopy (mInitialEdgeTouched , 0 , iit , 0 , mInitialEdgeTouched .length );
896
896
System .arraycopy (mEdgeDragsInProgress , 0 , edip , 0 , mEdgeDragsInProgress .length );
897
897
System .arraycopy (mEdgeDragsLocked , 0 , edl , 0 , mEdgeDragsLocked .length );
898
898
}
@@ -901,7 +901,7 @@ private void ensureMotionHistorySizeForId(int pointerId) {
901
901
mInitialMotionY = imy ;
902
902
mLastMotionX = lmx ;
903
903
mLastMotionY = lmy ;
904
- mInitialEdgesTouched = iit ;
904
+ mInitialEdgeTouched = iit ;
905
905
mEdgeDragsInProgress = edip ;
906
906
mEdgeDragsLocked = edl ;
907
907
}
@@ -911,7 +911,7 @@ private void saveInitialMotion(float x, float y, int pointerId) {
911
911
ensureMotionHistorySizeForId (pointerId );
912
912
mInitialMotionX [pointerId ] = mLastMotionX [pointerId ] = x ;
913
913
mInitialMotionY [pointerId ] = mLastMotionY [pointerId ] = y ;
914
- mInitialEdgesTouched [pointerId ] = getEdgesTouched ((int ) x , (int ) y );
914
+ mInitialEdgeTouched [pointerId ] = getEdgeTouched ((int ) x , (int ) y );
915
915
mPointersDown |= 1 << pointerId ;
916
916
}
917
917
@@ -1056,7 +1056,7 @@ public boolean shouldInterceptTouchEvent(MotionEvent ev) {
1056
1056
tryCaptureViewForDrag (toCapture , pointerId );
1057
1057
}
1058
1058
1059
- final int edgesTouched = mInitialEdgesTouched [pointerId ];
1059
+ final int edgesTouched = mInitialEdgeTouched [pointerId ];
1060
1060
if ((edgesTouched & mTrackingEdges ) != 0 ) {
1061
1061
mCallback .onEdgeTouched (edgesTouched & mTrackingEdges , pointerId );
1062
1062
}
@@ -1072,7 +1072,7 @@ public boolean shouldInterceptTouchEvent(MotionEvent ev) {
1072
1072
1073
1073
// A ViewDragHelper can only manipulate one view at a time.
1074
1074
if (mDragState == STATE_IDLE ) {
1075
- final int edgesTouched = mInitialEdgesTouched [pointerId ];
1075
+ final int edgesTouched = mInitialEdgeTouched [pointerId ];
1076
1076
if ((edgesTouched & mTrackingEdges ) != 0 ) {
1077
1077
mCallback .onEdgeTouched (edgesTouched & mTrackingEdges , pointerId );
1078
1078
}
@@ -1166,7 +1166,7 @@ public void processTouchEvent(MotionEvent ev) {
1166
1166
// Start immediately if possible.
1167
1167
tryCaptureViewForDrag (toCapture , pointerId );
1168
1168
1169
- final int edgesTouched = mInitialEdgesTouched [pointerId ];
1169
+ final int edgesTouched = mInitialEdgeTouched [pointerId ];
1170
1170
if ((edgesTouched & mTrackingEdges ) != 0 ) {
1171
1171
mCallback .onEdgeTouched (edgesTouched & mTrackingEdges , pointerId );
1172
1172
}
@@ -1188,7 +1188,7 @@ public void processTouchEvent(MotionEvent ev) {
1188
1188
final View toCapture = findTopChildUnder ((int ) x , (int ) y );
1189
1189
tryCaptureViewForDrag (toCapture , pointerId );
1190
1190
1191
- final int edgesTouched = mInitialEdgesTouched [pointerId ];
1191
+ final int edgesTouched = mInitialEdgeTouched [pointerId ];
1192
1192
if ((edgesTouched & mTrackingEdges ) != 0 ) {
1193
1193
mCallback .onEdgeTouched (edgesTouched & mTrackingEdges , pointerId );
1194
1194
}
@@ -1319,7 +1319,7 @@ private boolean checkNewEdgeDrag(float delta, float odelta, int pointerId, int e
1319
1319
final float absDelta = Math .abs (delta );
1320
1320
final float absODelta = Math .abs (odelta );
1321
1321
1322
- if ((mInitialEdgesTouched [pointerId ] & edge ) != edge || (mTrackingEdges & edge ) == 0
1322
+ if ((mInitialEdgeTouched [pointerId ] & edge ) != edge || (mTrackingEdges & edge ) == 0
1323
1323
|| (mEdgeDragsLocked [pointerId ] & edge ) == edge
1324
1324
|| (mEdgeDragsInProgress [pointerId ] & edge ) == edge
1325
1325
|| (absDelta <= mTouchSlop && absODelta <= mTouchSlop )) {
@@ -1436,7 +1436,7 @@ public boolean checkTouchSlop(int directions, int pointerId) {
1436
1436
* current gesture
1437
1437
*/
1438
1438
public boolean isEdgeTouched (int edges ) {
1439
- final int count = mInitialEdgesTouched .length ;
1439
+ final int count = mInitialEdgeTouched .length ;
1440
1440
for (int i = 0 ; i < count ; i ++) {
1441
1441
if (isEdgeTouched (edges , i )) {
1442
1442
return true ;
@@ -1458,7 +1458,7 @@ public boolean isEdgeTouched(int edges) {
1458
1458
* current gesture
1459
1459
*/
1460
1460
public boolean isEdgeTouched (int edges , int pointerId ) {
1461
- return isPointerDown (pointerId ) && (mInitialEdgesTouched [pointerId ] & edges ) != 0 ;
1461
+ return isPointerDown (pointerId ) && (mInitialEdgeTouched [pointerId ] & edges ) != 0 ;
1462
1462
}
1463
1463
1464
1464
private void releaseViewForPointerUp () {
@@ -1548,17 +1548,17 @@ public View findTopChildUnder(int x, int y) {
1548
1548
return null ;
1549
1549
}
1550
1550
1551
- private int getEdgesTouched (int x , int y ) {
1551
+ private int getEdgeTouched (int x , int y ) {
1552
1552
int result = 0 ;
1553
1553
1554
1554
if (x < mParentView .getLeft () + mEdgeSize )
1555
- result | = EDGE_LEFT ;
1555
+ result = EDGE_LEFT ;
1556
1556
if (y < mParentView .getTop () + mEdgeSize )
1557
- result | = EDGE_TOP ;
1557
+ result = EDGE_TOP ;
1558
1558
if (x > mParentView .getRight () - mEdgeSize )
1559
- result | = EDGE_RIGHT ;
1559
+ result = EDGE_RIGHT ;
1560
1560
if (y > mParentView .getBottom () - mEdgeSize )
1561
- result | = EDGE_BOTTOM ;
1561
+ result = EDGE_BOTTOM ;
1562
1562
1563
1563
return result ;
1564
1564
}
0 commit comments