Merge "Rename methods for readability"

main
Tadashi G. Takaoka 2013-06-03 09:57:47 +00:00 committed by Android (Google) Code Review
commit b4ae86f0de
5 changed files with 33 additions and 33 deletions

View File

@ -274,30 +274,30 @@ public final class KeyboardSwitcher implements KeyboardState.SwitchActions {
// Implements {@link KeyboardState.SwitchActions}. // Implements {@link KeyboardState.SwitchActions}.
@Override @Override
public void startDoubleTapTimer() { public void startDoubleTapShiftKeyTimer() {
final MainKeyboardView keyboardView = getMainKeyboardView(); final MainKeyboardView keyboardView = getMainKeyboardView();
if (keyboardView != null) { if (keyboardView != null) {
final TimerProxy timer = keyboardView.getTimerProxy(); final TimerProxy timer = keyboardView.getTimerProxy();
timer.startDoubleTapTimer(); timer.startDoubleTapShiftKeyTimer();
} }
} }
// Implements {@link KeyboardState.SwitchActions}. // Implements {@link KeyboardState.SwitchActions}.
@Override @Override
public void cancelDoubleTapTimer() { public void cancelDoubleTapShiftKeyTimer() {
final MainKeyboardView keyboardView = getMainKeyboardView(); final MainKeyboardView keyboardView = getMainKeyboardView();
if (keyboardView != null) { if (keyboardView != null) {
final TimerProxy timer = keyboardView.getTimerProxy(); final TimerProxy timer = keyboardView.getTimerProxy();
timer.cancelDoubleTapTimer(); timer.cancelDoubleTapShiftKeyTimer();
} }
} }
// Implements {@link KeyboardState.SwitchActions}. // Implements {@link KeyboardState.SwitchActions}.
@Override @Override
public boolean isInDoubleTapTimeout() { public boolean isInDoubleTapShiftKeyTimeout() {
final MainKeyboardView keyboardView = getMainKeyboardView(); final MainKeyboardView keyboardView = getMainKeyboardView();
return (keyboardView != null) return (keyboardView != null)
? keyboardView.getTimerProxy().isInDoubleTapTimeout() : false; ? keyboardView.getTimerProxy().isInDoubleTapShiftKeyTimeout() : false;
} }
// Implements {@link KeyboardState.SwitchActions}. // Implements {@link KeyboardState.SwitchActions}.

View File

@ -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_TYPING_STATE_EXPIRED = 0;
private static final int MSG_REPEAT_KEY = 1; private static final int MSG_REPEAT_KEY = 1;
private static final int MSG_LONGPRESS_KEY = 2; 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 static final int MSG_UPDATE_BATCH_INPUT = 4;
private final int mKeyRepeatStartTimeout; private final int mKeyRepeatStartTimeout;
@ -392,19 +392,19 @@ public final class MainKeyboardView extends KeyboardView implements PointerTrack
} }
@Override @Override
public void startDoubleTapTimer() { public void startDoubleTapShiftKeyTimer() {
sendMessageDelayed(obtainMessage(MSG_DOUBLE_TAP), sendMessageDelayed(obtainMessage(MSG_DOUBLE_TAP_SHIFT_KEY),
ViewConfiguration.getDoubleTapTimeout()); ViewConfiguration.getDoubleTapTimeout());
} }
@Override @Override
public void cancelDoubleTapTimer() { public void cancelDoubleTapShiftKeyTimer() {
removeMessages(MSG_DOUBLE_TAP); removeMessages(MSG_DOUBLE_TAP_SHIFT_KEY);
} }
@Override @Override
public boolean isInDoubleTapTimeout() { public boolean isInDoubleTapShiftKeyTimeout() {
return hasMessages(MSG_DOUBLE_TAP); return hasMessages(MSG_DOUBLE_TAP_SHIFT_KEY);
} }
@Override @Override

View File

@ -94,9 +94,9 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
public void startLongPressTimer(PointerTracker tracker); public void startLongPressTimer(PointerTracker tracker);
public void startLongPressTimer(int code); public void startLongPressTimer(int code);
public void cancelLongPressTimer(); public void cancelLongPressTimer();
public void startDoubleTapTimer(); public void startDoubleTapShiftKeyTimer();
public void cancelDoubleTapTimer(); public void cancelDoubleTapShiftKeyTimer();
public boolean isInDoubleTapTimeout(); public boolean isInDoubleTapShiftKeyTimeout();
public void cancelKeyTimers(); public void cancelKeyTimers();
public void startUpdateBatchInputTimer(PointerTracker tracker); public void startUpdateBatchInputTimer(PointerTracker tracker);
public void cancelUpdateBatchInputTimer(PointerTracker tracker); public void cancelUpdateBatchInputTimer(PointerTracker tracker);
@ -116,11 +116,11 @@ public final class PointerTracker implements PointerTrackerQueue.Element {
@Override @Override
public void cancelLongPressTimer() {} public void cancelLongPressTimer() {}
@Override @Override
public void startDoubleTapTimer() {} public void startDoubleTapShiftKeyTimer() {}
@Override @Override
public void cancelDoubleTapTimer() {} public void cancelDoubleTapShiftKeyTimer() {}
@Override @Override
public boolean isInDoubleTapTimeout() { return false; } public boolean isInDoubleTapShiftKeyTimeout() { return false; }
@Override @Override
public void cancelKeyTimers() {} public void cancelKeyTimers() {}
@Override @Override

View File

@ -53,9 +53,9 @@ public final class KeyboardState {
*/ */
public void requestUpdatingShiftState(); public void requestUpdatingShiftState();
public void startDoubleTapTimer(); public void startDoubleTapShiftKeyTimer();
public boolean isInDoubleTapTimeout(); public boolean isInDoubleTapShiftKeyTimeout();
public void cancelDoubleTapTimer(); public void cancelDoubleTapShiftKeyTimer();
public void startLongPressTimer(int code); public void startLongPressTimer(int code);
public void cancelLongPressTimer(); public void cancelLongPressTimer();
} }
@ -325,7 +325,7 @@ public final class KeyboardState {
} else if (code == Constants.CODE_SWITCH_ALPHA_SYMBOL) { } else if (code == Constants.CODE_SWITCH_ALPHA_SYMBOL) {
onPressSymbol(); onPressSymbol();
} else { } else {
mSwitchActions.cancelDoubleTapTimer(); mSwitchActions.cancelDoubleTapShiftKeyTimer();
mSwitchActions.cancelLongPressTimer(); mSwitchActions.cancelLongPressTimer();
mLongPressShiftLockFired = false; mLongPressShiftLockFired = false;
mShiftKeyState.onOtherKeyPressed(); mShiftKeyState.onOtherKeyPressed();
@ -450,10 +450,10 @@ public final class KeyboardState {
// importantly the double tap timer. // importantly the double tap timer.
if (RecapitalizeStatus.NOT_A_RECAPITALIZE_MODE != mRecapitalizeMode) return; if (RecapitalizeStatus.NOT_A_RECAPITALIZE_MODE != mRecapitalizeMode) return;
if (mIsAlphabetMode) { if (mIsAlphabetMode) {
mIsInDoubleTapShiftKey = mSwitchActions.isInDoubleTapTimeout(); mIsInDoubleTapShiftKey = mSwitchActions.isInDoubleTapShiftKeyTimeout();
if (!mIsInDoubleTapShiftKey) { if (!mIsInDoubleTapShiftKey) {
// This is first tap. // This is first tap.
mSwitchActions.startDoubleTapTimer(); mSwitchActions.startDoubleTapShiftKeyTimer();
} }
if (mIsInDoubleTapShiftKey) { if (mIsInDoubleTapShiftKey) {
if (mAlphabetShiftState.isManualShifted() || mIsInAlphabetUnshiftedFromShifted) { if (mAlphabetShiftState.isManualShifted() || mIsInAlphabetUnshiftedFromShifted) {

View File

@ -53,7 +53,7 @@ public class MockKeyboardSwitcher implements KeyboardState.SwitchActions {
// Following InputConnection's behavior. Simulating InputType.TYPE_TEXT_FLAG_CAP_WORDS. // Following InputConnection's behavior. Simulating InputType.TYPE_TEXT_FLAG_CAP_WORDS.
private int mAutoCapsState = MockConstants.CAP_MODE_OFF; private int mAutoCapsState = MockConstants.CAP_MODE_OFF;
private boolean mIsInDoubleTapTimeout; private boolean mIsInDoubleTapShiftKeyTimeout;
private int mLongPressTimeoutCode; private int mLongPressTimeoutCode;
private final KeyboardState mState = new KeyboardState(this); private final KeyboardState mState = new KeyboardState(this);
@ -81,7 +81,7 @@ public class MockKeyboardSwitcher implements KeyboardState.SwitchActions {
} }
public void expireDoubleTapTimeout() { public void expireDoubleTapTimeout() {
mIsInDoubleTapTimeout = false; mIsInDoubleTapShiftKeyTimeout = false;
} }
@Override @Override
@ -125,18 +125,18 @@ public class MockKeyboardSwitcher implements KeyboardState.SwitchActions {
} }
@Override @Override
public void startDoubleTapTimer() { public void startDoubleTapShiftKeyTimer() {
mIsInDoubleTapTimeout = true; mIsInDoubleTapShiftKeyTimeout = true;
} }
@Override @Override
public void cancelDoubleTapTimer() { public void cancelDoubleTapShiftKeyTimer() {
mIsInDoubleTapTimeout = false; mIsInDoubleTapShiftKeyTimeout = false;
} }
@Override @Override
public boolean isInDoubleTapTimeout() { public boolean isInDoubleTapShiftKeyTimeout() {
return mIsInDoubleTapTimeout; return mIsInDoubleTapShiftKeyTimeout;
} }
@Override @Override