aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-01-12 17:46:36 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-01-12 17:46:36 -0800
commitd650ab53036c6177502b6fb3c2ece776a22a882a (patch)
treeae103964c4430d05edf32c687d851e36e96f41e0 /java/src/com/android/inputmethod/latin/LatinKeyboardView.java
parent5cc23550429ea12be7ecdb07fc7b9060c8465dc7 (diff)
parent07a0fd0f5100a0cee978ba07751d63595c9d27ac (diff)
downloadlatinime-d650ab53036c6177502b6fb3c2ece776a22a882a.tar.gz
latinime-d650ab53036c6177502b6fb3c2ece776a22a882a.tar.xz
latinime-d650ab53036c6177502b6fb3c2ece776a22a882a.zip
am 07a0fd0f: Reset old keyboard state before switching to new keyboard (DO NOT MERGE)
* commit '07a0fd0f5100a0cee978ba07751d63595c9d27ac': Reset old keyboard state before switching to new keyboard (DO NOT MERGE)
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinKeyboardView.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinKeyboardView.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
index 22d39f7aa..a5476e457 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
@@ -76,14 +76,19 @@ public class LatinKeyboardView extends LatinKeyboardBaseView {
}
@Override
- public void setKeyboard(Keyboard k) {
- super.setKeyboard(k);
+ public void setKeyboard(Keyboard newKeyboard) {
+ final Keyboard oldKeyboard = getKeyboard();
+ if (oldKeyboard instanceof LatinKeyboard) {
+ // Reset old keyboard state before switching to new keyboard.
+ ((LatinKeyboard)oldKeyboard).keyReleased();
+ }
+ super.setKeyboard(newKeyboard);
// One-seventh of the keyboard width seems like a reasonable threshold
- mJumpThresholdSquare = k.getMinWidth() / 7;
+ mJumpThresholdSquare = newKeyboard.getMinWidth() / 7;
mJumpThresholdSquare *= mJumpThresholdSquare;
// Assuming there are 4 rows, this is the coordinate of the last row
- mLastRowY = (k.getHeight() * 3) / 4;
- setKeyboardLocal(k);
+ mLastRowY = (newKeyboard.getHeight() * 3) / 4;
+ setKeyboardLocal(newKeyboard);
}
@Override