aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/android/inputmethod/latin/KeyboardSwitcher.java
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2009-09-30 21:15:47 -0700
committerAmith Yamasani <yamasani@google.com>2009-09-30 21:15:47 -0700
commit12e582c79c4e8028bb03971377633440aa95cefb (patch)
treedd4399ce3f6a19a0724961686f234f46c356a367 /src/com/android/inputmethod/latin/KeyboardSwitcher.java
parent56f96fe05b2b01c488ce569eb2eefc13ee917fd3 (diff)
downloadlatinime-12e582c79c4e8028bb03971377633440aa95cefb.tar.gz
latinime-12e582c79c4e8028bb03971377633440aa95cefb.tar.xz
latinime-12e582c79c4e8028bb03971377633440aa95cefb.zip
Fix 2146178: On-screen keyboard is wider than screen
Sometimes the keyboard is getting confused about it's width when switching between hard keyboard open and close state and portrait-forced home. Force creation of keyboard layouts after a configuration change to fix the inconsistent state. Don't force create when just switching between input fields, too expensive. Also fixes the problem of keyboard not changing layout after a locale change, unless there's an orientation change.
Diffstat (limited to 'src/com/android/inputmethod/latin/KeyboardSwitcher.java')
-rw-r--r--src/com/android/inputmethod/latin/KeyboardSwitcher.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/android/inputmethod/latin/KeyboardSwitcher.java b/src/com/android/inputmethod/latin/KeyboardSwitcher.java
index 2da703632..c82587b71 100644
--- a/src/com/android/inputmethod/latin/KeyboardSwitcher.java
+++ b/src/com/android/inputmethod/latin/KeyboardSwitcher.java
@@ -70,14 +70,15 @@ public class KeyboardSwitcher {
mInputView = inputView;
}
- void makeKeyboards() {
+ void makeKeyboards(boolean forceCreate) {
+ if (forceCreate) mKeyboards.clear();
// Configuration change is coming after the keyboard gets recreated. So don't rely on that.
// If keyboards have already been made, check if we have a screen width change and
// create the keyboard layouts again at the correct orientation
int displayWidth = mContext.getMaxWidth();
if (displayWidth == mLastDisplayWidth) return;
mLastDisplayWidth = displayWidth;
- mKeyboards.clear();
+ if (!forceCreate) mKeyboards.clear();
mSymbolsId = new KeyboardId(R.xml.kbd_symbols);
mSymbolsShiftedId = new KeyboardId(R.xml.kbd_symbols_shift);
}