aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-12-11 23:34:31 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2011-12-11 23:34:31 -0800
commitcfc2b1c4f7accd7146d02db30718bee6aa1ed5a8 (patch)
tree949753d750d28d615d6deeeeb26e9f64b1906e4b /java
parentb73cd74e20267c05f238e5aca5c8527a4dcfc5a7 (diff)
parent243e0347169c857e08662bdc4d245473b6ea8097 (diff)
downloadlatinime-cfc2b1c4f7accd7146d02db30718bee6aa1ed5a8.tar.gz
latinime-cfc2b1c4f7accd7146d02db30718bee6aa1ed5a8.tar.xz
latinime-cfc2b1c4f7accd7146d02db30718bee6aa1ed5a8.zip
am 243e0347: Merge "Assign Key.mCode from the label only when outputText is not specified"
* commit '243e0347169c857e08662bdc4d245473b6ea8097': Assign Key.mCode from the label only when outputText is not specified
Diffstat (limited to 'java')
-rw-r--r--java/src/com/android/inputmethod/keyboard/Key.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java
index b2b68f0ad..ced763841 100644
--- a/java/src/com/android/inputmethod/keyboard/Key.java
+++ b/java/src/com/android/inputmethod/keyboard/Key.java
@@ -22,6 +22,7 @@ import android.graphics.Rect;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
+import android.util.Log;
import android.util.Xml;
import com.android.inputmethod.keyboard.internal.KeyStyles;
@@ -42,6 +43,8 @@ import java.util.Map;
* Class for describing the position and characteristics of a single key in the keyboard.
*/
public class Key {
+ private static final String TAG = Key.class.getSimpleName();
+
/**
* The key code (unicode or custom code) that this key generates.
*/
@@ -284,7 +287,11 @@ public class Key {
// specified.
final int code = style.getInt(keyAttr, R.styleable.Keyboard_Key_code,
Keyboard.CODE_UNSPECIFIED);
- if (code == Keyboard.CODE_UNSPECIFIED && !TextUtils.isEmpty(mLabel)) {
+ if (code == Keyboard.CODE_UNSPECIFIED && mOutputText == null
+ && !TextUtils.isEmpty(mLabel)) {
+ if (mLabel.length() != 1) {
+ Log.w(TAG, "Label is not a single letter: label=" + mLabel);
+ }
final int firstChar = mLabel.charAt(0);
mCode = getRtlParenthesisCode(firstChar, params.mIsRtlKeyboard);
} else if (code != Keyboard.CODE_UNSPECIFIED) {