aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-07-07 08:08:41 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-07-02 20:35:42 +0000
commit9eb68042703f8bec1a73a3d4554f8db9f0937856 (patch)
tree0fe6bb63a3f169c89cdb3cbf90d24b8242ec48e9 /java/src
parent7f102e389ddd8191d398423a5c8d22698754a253 (diff)
parent649de3f544d8e320ab812e829f637cd5f78b3d55 (diff)
downloadlatinime-9eb68042703f8bec1a73a3d4554f8db9f0937856.tar.gz
latinime-9eb68042703f8bec1a73a3d4554f8db9f0937856.tar.xz
latinime-9eb68042703f8bec1a73a3d4554f8db9f0937856.zip
Merge "Fix Sinhala keyboard for tablet device"
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/keyboard/Key.java15
1 files changed, 10 insertions, 5 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java
index 88cde1111..ed3b2b347 100644
--- a/java/src/com/android/inputmethod/keyboard/Key.java
+++ b/java/src/com/android/inputmethod/keyboard/Key.java
@@ -62,8 +62,11 @@ public class Key implements Comparable<Key> {
private static final int LABEL_FLAGS_ALIGN_RIGHT = 0x02;
private static final int LABEL_FLAGS_ALIGN_BUTTOM = 0x04;
private static final int LABEL_FLAGS_ALIGN_LEFT_OF_CENTER = 0x08;
+ // Font typeface specification.
+ private static final int LABEL_FLAGS_FONT_MASK = 0x30;
private static final int LABEL_FLAGS_FONT_NORMAL = 0x10;
private static final int LABEL_FLAGS_FONT_MONO_SPACE = 0x20;
+ private static final int LABEL_FLAGS_FONT_DEFAULT = 0x30;
// Start of key text ratio enum values
private static final int LABEL_FLAGS_FOLLOW_KEY_TEXT_RATIO_MASK = 0x1C0;
private static final int LABEL_FLAGS_FOLLOW_KEY_LARGE_LETTER_RATIO = 0x40;
@@ -567,14 +570,16 @@ public class Key implements Comparable<Key> {
}
public final Typeface selectTypeface(final KeyDrawParams params) {
- // TODO: Handle "bold" here too?
- if ((mLabelFlags & LABEL_FLAGS_FONT_NORMAL) != 0) {
+ switch (mLabelFlags & LABEL_FLAGS_FONT_MASK) {
+ case LABEL_FLAGS_FONT_NORMAL:
return Typeface.DEFAULT;
- }
- if ((mLabelFlags & LABEL_FLAGS_FONT_MONO_SPACE) != 0) {
+ case LABEL_FLAGS_FONT_MONO_SPACE:
return Typeface.MONOSPACE;
+ case LABEL_FLAGS_FONT_DEFAULT:
+ default:
+ // The type-face is specified by keyTypeface attribute.
+ return params.mTypeface;
}
- return params.mTypeface;
}
public final int selectTextSize(final KeyDrawParams params) {