Skip to content
Snippets Groups Projects
Commit a4463d7a authored by Tadashi G. Takaoka's avatar Tadashi G. Takaoka
Browse files

More precise geometry checking for more keys keyboard

Bug: 8484528
Change-Id: I0dd09530a5262fee9c19bb0f11d5830b00306944
parent cdaee868
No related branches found
No related tags found
No related merge requests found
...@@ -73,10 +73,11 @@ public final class MoreKeysKeyboard extends Keyboard { ...@@ -73,10 +73,11 @@ public final class MoreKeysKeyboard extends Keyboard {
final int rowHeight, final int coordXInParent, final int parentKeyboardWidth, final int rowHeight, final int coordXInParent, final int parentKeyboardWidth,
final boolean isFixedColumnOrder, final int dividerWidth) { final boolean isFixedColumnOrder, final int dividerWidth) {
mIsFixedOrder = isFixedColumnOrder; mIsFixedOrder = isFixedColumnOrder;
if (parentKeyboardWidth / keyWidth < maxColumns) { if (parentKeyboardWidth / keyWidth < Math.min(numKeys, maxColumns)) {
throw new IllegalArgumentException( throw new IllegalArgumentException(
"Keyboard is too small to hold more keys keyboard: " "Keyboard is too small to hold more keys keyboard: "
+ parentKeyboardWidth + " " + keyWidth + " " + maxColumns); + parentKeyboardWidth + " " + keyWidth + " "
+ numKeys + " " + maxColumns);
} }
mDefaultKeyWidth = keyWidth; mDefaultKeyWidth = keyWidth;
mDefaultRowHeight = rowHeight; mDefaultRowHeight = rowHeight;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment