aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2013-04-10 23:16:36 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-04-10 23:16:36 -0700
commit206ce6374bb4dfcb93d059ec6795853f36cd4979 (patch)
treefd724b4eb76970c4b4a2da06791c2b0431ccdcec /java/src/com/android/inputmethod
parent93fe83a1c29e8d8671c007a7a4781c791b9864b6 (diff)
parentbd8e92d8431418929276fb739f0113e2297c9d00 (diff)
downloadlatinime-206ce6374bb4dfcb93d059ec6795853f36cd4979.tar.gz
latinime-206ce6374bb4dfcb93d059ec6795853f36cd4979.tar.xz
latinime-206ce6374bb4dfcb93d059ec6795853f36cd4979.zip
am bd8e92d8: Add debug message to detect unusual zero width condition
* commit 'bd8e92d8431418929276fb739f0113e2297c9d00': Add debug message to detect unusual zero width condition
Diffstat (limited to 'java/src/com/android/inputmethod')
-rw-r--r--java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java
index 5d14f93a3..ae08a5953 100644
--- a/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java
+++ b/java/src/com/android/inputmethod/keyboard/MoreKeysKeyboard.java
@@ -291,10 +291,22 @@ public final class MoreKeysKeyboard extends Keyboard {
// adjusted with their bottom paddings deducted.
width = keyPreviewDrawParams.mPreviewVisibleWidth;
height = keyPreviewDrawParams.mPreviewVisibleHeight + mParams.mVerticalGap;
+ // TODO: Remove this check.
+ if (width == 0) {
+ throw new IllegalArgumentException(
+ "Zero width key detected: " + parentKey + " in " + parentKeyboard.mId);
+ }
} else {
width = getMaxKeyWidth(parentKeyboardView, parentKey, mParams.mDefaultKeyWidth,
context.getResources());
height = parentKeyboard.mMostCommonKeyHeight;
+ // TODO: Remove this check.
+ if (width == 0) {
+ throw new IllegalArgumentException(
+ "Zero width calculated: " + parentKey
+ + " moreKeys=" + java.util.Arrays.toString(parentKey.mMoreKeys)
+ + " in " + parentKeyboard.mId);
+ }
}
final int dividerWidth;
if (parentKey.needsDividersInMoreKeys()) {