diff options
author | 2010-11-13 00:01:13 -0800 | |
---|---|---|
committer | 2010-11-13 01:45:12 -0800 | |
commit | 1679432d1c8a8cfe6ff09be0a49792f4af91ab35 (patch) | |
tree | f4978b3a7dd28711cdb6935ea295d7787a8cd59d /java/src/com/android/inputmethod/latin/KeyboardSwitcher.java | |
parent | 3009310283ba0e5208b047818bbd0c339f9948c7 (diff) | |
download | latinime-1679432d1c8a8cfe6ff09be0a49792f4af91ab35.tar.gz latinime-1679432d1c8a8cfe6ff09be0a49792f4af91ab35.tar.xz latinime-1679432d1c8a8cfe6ff09be0a49792f4af91ab35.zip |
Get rid of the reference to LatinKeyboard from LatinIME
Change-Id: I94286ecec0aa8dbfdfaa74d3a76b744c4a250370
Diffstat (limited to 'java/src/com/android/inputmethod/latin/KeyboardSwitcher.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/KeyboardSwitcher.java | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java index 7307fcfbb..fa3cf2224 100644 --- a/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/latin/KeyboardSwitcher.java @@ -306,8 +306,6 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha keyboard.onAutoCompletionStateChanged(mIsAutoCompletionActive); keyboard.setShifted(false); - // TODO: delete this? - keyboard.setShiftLocked(keyboard.isShiftLocked()); return keyboard; } @@ -333,11 +331,43 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha public int getKeyboardMode() { return mMode; } - + public boolean isAlphabetMode() { return mCurrentId != null && mCurrentId.isAlphabetMode(); } + public boolean isInputViewShown() { + return mInputView != null && mInputView.isShown(); + } + + public boolean isKeyboardAvailable() { + return mInputView != null && mInputView.getLatinKeyboard() != null; + } + + public void setPreferredLetters(int[] frequencies) { + LatinKeyboard latinKeyboard; + if (mInputView != null && (latinKeyboard = mInputView.getLatinKeyboard()) != null) + latinKeyboard.setPreferredLetters(frequencies); + } + + public void keyReleased() { + LatinKeyboard latinKeyboard; + if (mInputView != null && (latinKeyboard = mInputView.getLatinKeyboard()) != null) + latinKeyboard.keyReleased(); + } + + public boolean isShifted() { + LatinKeyboard latinKeyboard; + return mInputView != null && (latinKeyboard = mInputView.getLatinKeyboard()) != null + && latinKeyboard.isShifted(); + } + + public boolean isShiftLocked() { + LatinKeyboard latinKeyboard; + return mInputView != null && (latinKeyboard = mInputView.getLatinKeyboard()) != null + && latinKeyboard.isShiftLocked(); + } + public void setShifted(boolean shifted) { if (mInputView == null) return; LatinKeyboard latinKeyboard = mInputView.getLatinKeyboard(); |