aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-02-20 14:44:59 +0900
committerTadashi G. Takaoka <takaoka@google.com>2011-02-20 18:59:25 +0900
commit4adf5d9ae5d8c449510bf1f93cf678f63109a1cc (patch)
tree5831b0fc55d5206c682a0bda5f105d2e898f1231 /java/src
parenta9f2fe2d5925d509c8676d0d081e5f3c2ee12f9a (diff)
downloadlatinime-4adf5d9ae5d8c449510bf1f93cf678f63109a1cc.tar.gz
latinime-4adf5d9ae5d8c449510bf1f93cf678f63109a1cc.tar.xz
latinime-4adf5d9ae5d8c449510bf1f93cf678f63109a1cc.zip
Disable non-ASCII symbol keys in password input
Bug: 3384942 Change-Id: Ifa10e84f22bb6ff85dfc397fac95a0294b2a6bea
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardParser.java6
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardView.java10
2 files changed, 11 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardParser.java b/java/src/com/android/inputmethod/keyboard/KeyboardParser.java
index 89208dd5d..df64ad5af 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardParser.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardParser.java
@@ -103,7 +103,7 @@ import java.util.List;
*/
public class KeyboardParser {
- private static final String TAG = "KeyboardParser";
+ private static final String TAG = KeyboardParser.class.getSimpleName();
private static final boolean DEBUG = false;
// Keyboard XML Tags
@@ -279,8 +279,8 @@ public class KeyboardParser {
checkEndTag(TAG_KEY, parser);
} else {
Key key = new Key(mResources, row, mCurrentX, mCurrentY, parser, mKeyStyles);
- if (DEBUG) Log.d(TAG, String.format("<%s keyLabel=%s code=%d popupCharacters=%s />",
- TAG_KEY, key.mLabel, key.mCode,
+ if (DEBUG) Log.d(TAG, String.format("<%s%s keyLabel=%s code=%d popupCharacters=%s />",
+ TAG_KEY, (key.mEnabled ? "" : " disabled"), key.mLabel, key.mCode,
Arrays.toString(key.mPopupCharacters)));
checkEndTag(TAG_KEY, parser);
keys.add(key);
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index d4c5e579b..7fee022e0 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -26,6 +26,7 @@ import android.content.res.Resources;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Canvas;
+import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Paint.Align;
import android.graphics.PorterDuff;
@@ -705,8 +706,13 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
} else {
paint.setColor(mKeyTextColor);
}
- // Set a drop shadow for the text
- paint.setShadowLayer(mShadowRadius, 0, 0, mShadowColor);
+ if (key.mEnabled) {
+ // Set a drop shadow for the text
+ paint.setShadowLayer(mShadowRadius, 0, 0, mShadowColor);
+ } else {
+ // Make label invisible
+ paint.setColor(Color.TRANSPARENT);
+ }
canvas.drawText(label, positionX, baseline, paint);
// Turn off drop shadow
paint.setShadowLayer(0, 0, 0, 0);