aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2013-04-11 03:51:42 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-04-11 03:51:42 +0000
commitcee512b63ed74ed6d9dab25bd1c19376fe98e1ce (patch)
tree160968cf74797a2bd718afd2a81ceffcb2c43b6d /java/src
parent3722f0877e1a8032b0cce71778832b80c269abfb (diff)
parenta4463d7a9a9b97ad0fba764698f75cd3bf036c12 (diff)
downloadlatinime-cee512b63ed74ed6d9dab25bd1c19376fe98e1ce.tar.gz
latinime-cee512b63ed74ed6d9dab25bd1c19376fe98e1ce.tar.xz
latinime-cee512b63ed74ed6d9dab25bd1c19376fe98e1ce.zip
Merge "More precise geometry checking for more keys keyboard"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java
index 66c30149c..f81ab8dd6 100644
--- a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java
@@ -73,10 +73,11 @@ public final class MoreKeysKeyboard extends Keyboard {
final int rowHeight, final int coordXInParent, final int parentKeyboardWidth,
final boolean isFixedColumnOrder, final int dividerWidth) {
mIsFixedOrder = isFixedColumnOrder;
- if (parentKeyboardWidth / keyWidth < maxColumns) {
+ if (parentKeyboardWidth / keyWidth < Math.min(numKeys, maxColumns)) {
throw new IllegalArgumentException(
"Keyboard is too small to hold more keys keyboard: "
- + parentKeyboardWidth + " " + keyWidth + " " + maxColumns);
+ + parentKeyboardWidth + " " + keyWidth + " "
+ + numKeys + " " + maxColumns);
}
mDefaultKeyWidth = keyWidth;
mDefaultRowHeight = rowHeight;