Merge "Rename methods for readability"
This commit is contained in:
commit
b4ae86f0de
5 changed files with 33 additions and 33 deletions
|
@ -274,30 +274,30 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
|
|||
|
||||
// Implements {@link KeyboardState.SwitchActions}.
|
||||
@Override
|
||||
public void startDoubleTapTimer() {
|
||||
public void startDoubleTapShiftKeyTimer() {
|
||||
final MainKeyboardView keyboardView = getMainKeyboardView();
|
||||
if (keyboardView != null) {
|
||||
final TimerProxy timer = keyboardView.getTimerProxy();
|
||||
timer.startDoubleTapTimer();
|
||||
timer.startDoubleTapShiftKeyTimer();
|
||||
}
|
||||
}
|
||||
|
||||
// Implements {@link KeyboardState.SwitchActions}.
|
||||
@Override
|
||||
public void cancelDoubleTapTimer() {
|
||||
public void cancelDoubleTapShiftKeyTimer() {
|
||||
final MainKeyboardView keyboardView = getMainKeyboardView();
|
||||
if (keyboardView != null) {
|
||||
final TimerProxy timer = keyboardView.getTimerProxy();
|
||||
timer.cancelDoubleTapTimer();
|
||||
timer.cancelDoubleTapShiftKeyTimer();
|
||||
}
|
||||
}
|
||||
|
||||
// Implements {@link KeyboardState.SwitchActions}.
|
||||
@Override
|
||||
public boolean isInDoubleTapTimeout() {
|
||||
public boolean isInDoubleTapShiftKeyTimeout() {
|
||||
final MainKeyboardView keyboardView = getMainKeyboardView();
|
||||
return (keyboardView != null)
|
||||
? keyboardView.getTimerProxy().isInDoubleTapTimeout() : false;
|
||||
? keyboardView.getTimerProxy().isInDoubleTapShiftKeyTimeout() : false;
|
||||
}
|
||||
|
||||
// Implements {@link KeyboardState.SwitchActions}.
|
||||
|
|
|
@ -202,7 +202,7 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
|
|||
private static final int MSG_TYPING_STATE_EXPIRED = 0;
|
||||
private static final int MSG_REPEAT_KEY = 1;
|
||||
private static final int MSG_LONGPRESS_KEY = 2;
|
||||
private static final int MSG_DOUBLE_TAP = 3;
|
||||
private static final int MSG_DOUBLE_TAP_SHIFT_KEY = 3;
|
||||
private static final int MSG_UPDATE_BATCH_INPUT = 4;
|
||||
|
||||
private final int mKeyRepeatStartTimeout;
|
||||
|
@ -392,19 +392,19 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
|
|||
}
|
||||
|
||||
@Override
|
||||
public void startDoubleTapTimer() {
|
||||
sendMessageDelayed(obtainMessage(MSG_DOUBLE_TAP),
|
||||
public void startDoubleTapShiftKeyTimer() {
|
||||
sendMessageDelayed(obtainMessage(MSG_DOUBLE_TAP_SHIFT_KEY),
|
||||
ViewConfiguration.getDoubleTapTimeout());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelDoubleTapTimer() {
|
||||
removeMessages(MSG_DOUBLE_TAP);
|
||||
public void cancelDoubleTapShiftKeyTimer() {
|
||||
removeMessages(MSG_DOUBLE_TAP_SHIFT_KEY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInDoubleTapTimeout() {
|
||||
return hasMessages(MSG_DOUBLE_TAP);
|
||||
public boolean isInDoubleTapShiftKeyTimeout() {
|
||||
return hasMessages(MSG_DOUBLE_TAP_SHIFT_KEY);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -94,9 +94,9 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
|
|||
public void startLongPressTimer(PointerTracker tracker);
|
||||
public void startLongPressTimer(int code);
|
||||
public void cancelLongPressTimer();
|
||||
public void startDoubleTapTimer();
|
||||
public void cancelDoubleTapTimer();
|
||||
public boolean isInDoubleTapTimeout();
|
||||
public void startDoubleTapShiftKeyTimer();
|
||||
public void cancelDoubleTapShiftKeyTimer();
|
||||
public boolean isInDoubleTapShiftKeyTimeout();
|
||||
public void cancelKeyTimers();
|
||||
public void startUpdateBatchInputTimer(PointerTracker tracker);
|
||||
public void cancelUpdateBatchInputTimer(PointerTracker tracker);
|
||||
|
@ -116,11 +116,11 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
|
|||
@Override
|
||||
public void cancelLongPressTimer() {}
|
||||
@Override
|
||||
public void startDoubleTapTimer() {}
|
||||
public void startDoubleTapShiftKeyTimer() {}
|
||||
@Override
|
||||
public void cancelDoubleTapTimer() {}
|
||||
public void cancelDoubleTapShiftKeyTimer() {}
|
||||
@Override
|
||||
public boolean isInDoubleTapTimeout() { return false; }
|
||||
public boolean isInDoubleTapShiftKeyTimeout() { return false; }
|
||||
@Override
|
||||
public void cancelKeyTimers() {}
|
||||
@Override
|
||||
|
|
|
@ -53,9 +53,9 @@ public final class KeyboardState {
|
|||
*/
|
||||
public void requestUpdatingShiftState();
|
||||
|
||||
public void startDoubleTapTimer();
|
||||
public boolean isInDoubleTapTimeout();
|
||||
public void cancelDoubleTapTimer();
|
||||
public void startDoubleTapShiftKeyTimer();
|
||||
public boolean isInDoubleTapShiftKeyTimeout();
|
||||
public void cancelDoubleTapShiftKeyTimer();
|
||||
public void startLongPressTimer(int code);
|
||||
public void cancelLongPressTimer();
|
||||
}
|
||||
|
@ -325,7 +325,7 @@ public final class KeyboardState {
|
|||
} else if (code == Constants.CODE_SWITCH_ALPHA_SYMBOL) {
|
||||
onPressSymbol();
|
||||
} else {
|
||||
mSwitchActions.cancelDoubleTapTimer();
|
||||
mSwitchActions.cancelDoubleTapShiftKeyTimer();
|
||||
mSwitchActions.cancelLongPressTimer();
|
||||
mLongPressShiftLockFired = false;
|
||||
mShiftKeyState.onOtherKeyPressed();
|
||||
|
@ -450,10 +450,10 @@ public final class KeyboardState {
|
|||
// importantly the double tap timer.
|
||||
if (RecapitalizeStatus.NOT_A_RECAPITALIZE_MODE != mRecapitalizeMode) return;
|
||||
if (mIsAlphabetMode) {
|
||||
mIsInDoubleTapShiftKey = mSwitchActions.isInDoubleTapTimeout();
|
||||
mIsInDoubleTapShiftKey = mSwitchActions.isInDoubleTapShiftKeyTimeout();
|
||||
if (!mIsInDoubleTapShiftKey) {
|
||||
// This is first tap.
|
||||
mSwitchActions.startDoubleTapTimer();
|
||||
mSwitchActions.startDoubleTapShiftKeyTimer();
|
||||
}
|
||||
if (mIsInDoubleTapShiftKey) {
|
||||
if (mAlphabetShiftState.isManualShifted() || mIsInAlphabetUnshiftedFromShifted) {
|
||||
|
|
|
@ -53,7 +53,7 @@ public class MockKeyboardSwitcher implements KeyboardState.SwitchActions {
|
|||
// Following InputConnection's behavior. Simulating InputType.TYPE_TEXT_FLAG_CAP_WORDS.
|
||||
private int mAutoCapsState = MockConstants.CAP_MODE_OFF;
|
||||
|
||||
private boolean mIsInDoubleTapTimeout;
|
||||
private boolean mIsInDoubleTapShiftKeyTimeout;
|
||||
private int mLongPressTimeoutCode;
|
||||
|
||||
private final KeyboardState mState = new KeyboardState(this);
|
||||
|
@ -81,7 +81,7 @@ public class MockKeyboardSwitcher implements KeyboardState.SwitchActions {
|
|||
}
|
||||
|
||||
public void expireDoubleTapTimeout() {
|
||||
mIsInDoubleTapTimeout = false;
|
||||
mIsInDoubleTapShiftKeyTimeout = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -125,18 +125,18 @@ public class MockKeyboardSwitcher implements KeyboardState.SwitchActions {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void startDoubleTapTimer() {
|
||||
mIsInDoubleTapTimeout = true;
|
||||
public void startDoubleTapShiftKeyTimer() {
|
||||
mIsInDoubleTapShiftKeyTimeout = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cancelDoubleTapTimer() {
|
||||
mIsInDoubleTapTimeout = false;
|
||||
public void cancelDoubleTapShiftKeyTimer() {
|
||||
mIsInDoubleTapShiftKeyTimeout = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isInDoubleTapTimeout() {
|
||||
return mIsInDoubleTapTimeout;
|
||||
public boolean isInDoubleTapShiftKeyTimeout() {
|
||||
return mIsInDoubleTapShiftKeyTimeout;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue