am 9eb68042: Merge "Fix Sinhala keyboard for tablet device"

* commit '9eb68042703f8bec1a73a3d4554f8db9f0937856':
  Fix Sinhala keyboard for tablet device
Tadashi G. Takaoka 2014-07-07 08:49:57 +00:00 committed by Android Git Automerger
commit 6174460178
4 changed files with 18 additions and 7 deletions

View File

@ -298,6 +298,7 @@
<flag name="alignLeftOfCenter" value="0x08" /> <flag name="alignLeftOfCenter" value="0x08" />
<flag name="fontNormal" value="0x10" /> <flag name="fontNormal" value="0x10" />
<flag name="fontMonoSpace" value="0x20" /> <flag name="fontMonoSpace" value="0x20" />
<flag name="fontDefault" value="0x30" />
<flag name="followKeyLargeLetterRatio" value="0x40" /> <flag name="followKeyLargeLetterRatio" value="0x40" />
<flag name="followKeyLetterRatio" value="0x80" /> <flag name="followKeyLetterRatio" value="0x80" />
<flag name="followKeyLabelRatio" value="0xC0" /> <flag name="followKeyLabelRatio" value="0xC0" />

View File

@ -23,8 +23,10 @@
> >
<Key <Key
latin:keySpec="!" latin:keySpec="!"
latin:moreKeys="!text/morekeys_exclamation" /> latin:moreKeys="!text/morekeys_exclamation"
latin:keyLabelFlags="fontDefault" />
<Key <Key
latin:keySpec="\?" latin:keySpec="\?"
latin:moreKeys="!text/morekeys_question" /> latin:moreKeys="!text/morekeys_question"
latin:keyLabelFlags="fontDefault" />
</merge> </merge>

View File

@ -25,6 +25,7 @@
latin:keyboardLayout="@xml/key_styles_common" /> latin:keyboardLayout="@xml/key_styles_common" />
<Row <Row
latin:keyWidth="8.182%p" latin:keyWidth="8.182%p"
latin:keyLabelFlags="fontNormal|autoXScale"
> >
<include <include
latin:keyboardLayout="@xml/rowkeys_sinhala1" /> latin:keyboardLayout="@xml/rowkeys_sinhala1" />
@ -34,6 +35,7 @@
</Row> </Row>
<Row <Row
latin:keyWidth="8.182%p" latin:keyWidth="8.182%p"
latin:keyLabelFlags="fontNormal|autoXScale"
> >
<include <include
latin:keyboardLayout="@xml/rowkeys_sinhala2" /> latin:keyboardLayout="@xml/rowkeys_sinhala2" />
@ -43,6 +45,7 @@
</Row> </Row>
<Row <Row
latin:keyWidth="8.182%p" latin:keyWidth="8.182%p"
latin:keyLabelFlags="fontNormal|autoXScale"
> >
<Key <Key
latin:keyStyle="shiftKeyStyle" latin:keyStyle="shiftKeyStyle"

View File

@ -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_RIGHT = 0x02;
private static final int LABEL_FLAGS_ALIGN_BUTTOM = 0x04; private static final int LABEL_FLAGS_ALIGN_BUTTOM = 0x04;
private static final int LABEL_FLAGS_ALIGN_LEFT_OF_CENTER = 0x08; 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_NORMAL = 0x10;
private static final int LABEL_FLAGS_FONT_MONO_SPACE = 0x20; 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 // 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_TEXT_RATIO_MASK = 0x1C0;
private static final int LABEL_FLAGS_FOLLOW_KEY_LARGE_LETTER_RATIO = 0x40; 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) { public final Typeface selectTypeface(final KeyDrawParams params) {
// TODO: Handle "bold" here too? switch (mLabelFlags & LABEL_FLAGS_FONT_MASK) {
if ((mLabelFlags & LABEL_FLAGS_FONT_NORMAL) != 0) { case LABEL_FLAGS_FONT_NORMAL:
return Typeface.DEFAULT; return Typeface.DEFAULT;
} case LABEL_FLAGS_FONT_MONO_SPACE:
if ((mLabelFlags & LABEL_FLAGS_FONT_MONO_SPACE) != 0) {
return Typeface.MONOSPACE; 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) { public final int selectTextSize(final KeyDrawParams params) {