aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2011-08-15 19:58:23 +0900
committerKen Wakasa <kwakasa@google.com>2011-08-15 20:10:28 +0900
commit286a5bf1c68c8dd06ece9701a904593af2457586 (patch)
tree6acb8ce342afb567f75d3037551874e0f2c74e7f /java/src
parentbb5504c47d847c1c164a2d30a24cd444c1325590 (diff)
downloadlatinime-286a5bf1c68c8dd06ece9701a904593af2457586.tar.gz
latinime-286a5bf1c68c8dd06ece9701a904593af2457586.tar.xz
latinime-286a5bf1c68c8dd06ece9701a904593af2457586.zip
Update shift state in onSizeChanged()
bug: 5130446 Change-Id: I830de4d184dffa2b263206c3f078de054e227b9e
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java15
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/KeyboardShiftState.java2
2 files changed, 10 insertions, 7 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index 811470c26..21477a992 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -280,7 +280,6 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
mSymbolsKeyboardId = getKeyboardId(editorInfo, true, false, settingsValues);
mSymbolsShiftedKeyboardId = getKeyboardId(editorInfo, true, true, settingsValues);
setKeyboard(getKeyboard(mSavedKeyboardState.getKeyboardId()));
- updateShiftState();
} catch (RuntimeException e) {
Log.w(TAG, "loading keyboard failed: " + mMainKeyboardId, e);
LatinImeLogger.logOnException(mMainKeyboardId.toString(), e);
@@ -331,6 +330,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
final boolean localeChanged = (oldKeyboard == null)
|| !keyboard.mId.mLocale.equals(oldKeyboard.mId.mLocale);
mInputMethodService.mHandler.startDisplayLanguageOnSpacebar(localeChanged);
+ updateShiftState();
}
private int getSwitchState(KeyboardId id) {
@@ -543,11 +543,12 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
}
private void setAutomaticTemporaryUpperCase() {
- LatinKeyboard latinKeyboard = getLatinKeyboard();
- if (latinKeyboard != null) {
- latinKeyboard.setAutomaticTemporaryUpperCase();
- mKeyboardView.invalidateAllKeys();
+ if (mKeyboardView == null) return;
+ final Keyboard keyboard = mKeyboardView.getKeyboard();
+ if (keyboard != null) {
+ keyboard.setAutomaticTemporaryUpperCase();
}
+ mKeyboardView.invalidateAllKeys();
}
/**
@@ -559,7 +560,9 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
Log.d(TAG, "updateShiftState:"
+ " autoCaps=" + mInputMethodService.getCurrentAutoCapsState()
+ " keyboard=" + getLatinKeyboard().getKeyboardShiftState()
- + " shiftKeyState=" + shiftKeyState);
+ + " shiftKeyState=" + shiftKeyState
+ + " isAlphabetMode=" + isAlphabetMode()
+ + " isShiftLocked=" + isShiftLocked());
if (isAlphabetMode()) {
if (!isShiftLocked() && !shiftKeyState.isIgnoring()) {
if (shiftKeyState.isReleasing() && mInputMethodService.getCurrentAutoCapsState()) {
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardShiftState.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardShiftState.java
index 0cde4e5b5..fd98456a8 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardShiftState.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardShiftState.java
@@ -21,7 +21,7 @@ import android.util.Log;
import com.android.inputmethod.keyboard.KeyboardSwitcher;
public class KeyboardShiftState {
- private static final String TAG = "KeyboardShiftState";
+ private static final String TAG = KeyboardShiftState.class.getSimpleName();
private static final boolean DEBUG = KeyboardSwitcher.DEBUG_STATE;
private static final int NORMAL = 0;