From 2a9882a433e2372ac32fbc0def578d4d9a97a676 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Mon, 3 Jun 2013 17:50:48 +0900 Subject: [PATCH] Rename methods for readability Change-Id: I8fc2c90cf8d3dce11740f8e61edf6dfde9b1c116 --- .../inputmethod/keyboard/KeyboardSwitcher.java | 12 ++++++------ .../inputmethod/keyboard/MainKeyboardView.java | 14 +++++++------- .../inputmethod/keyboard/PointerTracker.java | 12 ++++++------ .../keyboard/internal/KeyboardState.java | 12 ++++++------ .../keyboard/internal/MockKeyboardSwitcher.java | 16 ++++++++-------- 5 files changed, 33 insertions(+), 33 deletions(-) diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index 83f109014..7295efab1 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -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}. diff --git a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java index 7493df874..435adb6f5 100644 --- a/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/MainKeyboardView.java @@ -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 diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java index 5df7011cb..a28bd1a1e 100644 --- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java +++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java @@ -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 diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java index 9f6374bf7..bb6dec69e 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardState.java @@ -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) { diff --git a/tests/src/com/android/inputmethod/keyboard/internal/MockKeyboardSwitcher.java b/tests/src/com/android/inputmethod/keyboard/internal/MockKeyboardSwitcher.java index 2cb964805..90dbaabc9 100644 --- a/tests/src/com/android/inputmethod/keyboard/internal/MockKeyboardSwitcher.java +++ b/tests/src/com/android/inputmethod/keyboard/internal/MockKeyboardSwitcher.java @@ -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