Merge "Straighten an if-else-if blocks into if-return blocks"
commit
0c8a08c141
|
@ -1167,7 +1167,11 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
|
|||
final Key curKey = mCurrentKey;
|
||||
if (newKey == curKey) {
|
||||
return false;
|
||||
} else if (curKey != null) {
|
||||
}
|
||||
if (curKey == null /* && newKey != null */) {
|
||||
return true;
|
||||
}
|
||||
// Here curKey points to the different key from newKey.
|
||||
final int keyHysteresisDistanceSquared = mKeyDetector.getKeyHysteresisDistanceSquared(
|
||||
mIsInSlidingKeyInputFromModifier);
|
||||
final int distanceFromKeyEdgeSquared = curKey.squaredDistanceToEdge(x, y);
|
||||
|
@ -1176,8 +1180,7 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
|
|||
final float distanceToEdgeRatio = (float)Math.sqrt(distanceFromKeyEdgeSquared)
|
||||
/ mKeyboard.mMostCommonKeyWidth;
|
||||
Log.d(TAG, String.format("[%d] isMajorEnoughMoveToBeOnNewKey:"
|
||||
+" %.2f key width from key edge",
|
||||
mPointerId, distanceToEdgeRatio));
|
||||
+" %.2f key width from key edge", mPointerId, distanceToEdgeRatio));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -1196,9 +1199,6 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
|
|||
return true;
|
||||
}
|
||||
return false;
|
||||
} else { // curKey == null && newKey != null
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private void startLongPressTimer(final Key key) {
|
||||
|
|
Loading…
Reference in New Issue