am 1dc7fd3f: am cee512b6: Merge "More precise geometry checking for more keys keyboard"

* commit '1dc7fd3f8085c5a729061a7b35f71a2024a5ce0b':
  More precise geometry checking for more keys keyboard
main
Tadashi G. Takaoka 2013-04-17 19:41:00 -07:00 committed by Android Git Automerger
commit dabcd969c5
1 changed files with 3 additions and 2 deletions

View File

@ -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;