diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index 77c657b09..ae47c1f82 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -196,17 +196,21 @@
-
-
+
+
+
+
+
+
-
-
-
+
+
+
@@ -221,7 +225,6 @@
-
@@ -248,8 +251,6 @@
-
-
diff --git a/java/res/xml-sw600dp/kbd_key_styles.xml b/java/res/xml-sw600dp/kbd_key_styles.xml
index a9d12ed1d..1dc932ad8 100644
--- a/java/res/xml-sw600dp/kbd_key_styles.xml
+++ b/java/res/xml-sw600dp/kbd_key_styles.xml
@@ -33,7 +33,7 @@
@@ -44,47 +44,46 @@
latin:code="@integer/key_shift"
latin:keyIcon="iconShiftKey"
latin:keyIconShifted="iconShiftedShiftKey"
- latin:keyLabelOption="noKeyPreview"
+ latin:keyActionFlags="noKeyPreview"
latin:backgroundType="sticky" />
+ latin:keyActionFlags="isRepeatable|noKeyPreview"
+ latin:backgroundType="functional" />
+ latin:keyActionFlags="noKeyPreview" />
+ latin:keyActionFlags="noKeyPreview" />
diff --git a/java/res/xml-sw600dp/kbd_qwerty_row4.xml b/java/res/xml-sw600dp/kbd_qwerty_row4.xml
index ef0292279..54ca22b67 100644
--- a/java/res/xml-sw600dp/kbd_qwerty_row4.xml
+++ b/java/res/xml-sw600dp/kbd_qwerty_row4.xml
@@ -45,7 +45,7 @@
diff --git a/java/res/xml-sw600dp/kbd_row3_comma_period.xml b/java/res/xml-sw600dp/kbd_row3_comma_period.xml
index b84443078..6a95ca1a3 100644
--- a/java/res/xml-sw600dp/kbd_row3_comma_period.xml
+++ b/java/res/xml-sw600dp/kbd_row3_comma_period.xml
@@ -33,12 +33,12 @@
diff --git a/java/res/xml-sw600dp/kbd_row3_smiley.xml b/java/res/xml-sw600dp/kbd_row3_smiley.xml
index f9b647cdf..c94ec0cee 100644
--- a/java/res/xml-sw600dp/kbd_row3_smiley.xml
+++ b/java/res/xml-sw600dp/kbd_row3_smiley.xml
@@ -35,7 +35,7 @@
>
@@ -55,7 +55,7 @@
diff --git a/java/res/xml-sw600dp/kbd_rows_arabic.xml b/java/res/xml-sw600dp/kbd_rows_arabic.xml
index c2d3cd4cc..55c02f211 100644
--- a/java/res/xml-sw600dp/kbd_rows_arabic.xml
+++ b/java/res/xml-sw600dp/kbd_rows_arabic.xml
@@ -158,7 +158,7 @@
>
@@ -167,7 +167,7 @@
>
diff --git a/java/res/xml-sw600dp/kbd_rows_azerty.xml b/java/res/xml-sw600dp/kbd_rows_azerty.xml
index 8ae74557c..46967899b 100644
--- a/java/res/xml-sw600dp/kbd_rows_azerty.xml
+++ b/java/res/xml-sw600dp/kbd_rows_azerty.xml
@@ -132,12 +132,12 @@
diff --git a/java/res/xml-sw600dp/kbd_rows_hebrew.xml b/java/res/xml-sw600dp/kbd_rows_hebrew.xml
index a8adbd34c..4166745b7 100644
--- a/java/res/xml-sw600dp/kbd_rows_hebrew.xml
+++ b/java/res/xml-sw600dp/kbd_rows_hebrew.xml
@@ -94,7 +94,7 @@
>
@@ -104,7 +104,7 @@
>
diff --git a/java/res/xml-sw600dp/kbd_rows_qwertz.xml b/java/res/xml-sw600dp/kbd_rows_qwertz.xml
index 98667e09c..d7d13d5d1 100644
--- a/java/res/xml-sw600dp/kbd_rows_qwertz.xml
+++ b/java/res/xml-sw600dp/kbd_rows_qwertz.xml
@@ -99,12 +99,12 @@
diff --git a/java/res/xml-sw600dp/kbd_rows_russian.xml b/java/res/xml-sw600dp/kbd_rows_russian.xml
index cc9ad3aa7..3395065ed 100644
--- a/java/res/xml-sw600dp/kbd_rows_russian.xml
+++ b/java/res/xml-sw600dp/kbd_rows_russian.xml
@@ -122,12 +122,12 @@
diff --git a/java/res/xml-sw768dp/kbd_key_styles.xml b/java/res/xml-sw768dp/kbd_key_styles.xml
index 4e19509e7..0d8907a2f 100644
--- a/java/res/xml-sw768dp/kbd_key_styles.xml
+++ b/java/res/xml-sw768dp/kbd_key_styles.xml
@@ -26,82 +26,85 @@
latin:code="@integer/key_shift"
latin:keyIcon="iconShiftKey"
latin:keyIconShifted="iconShiftedShiftKey"
- latin:keyLabelOption="noKeyPreview"
+ latin:keyActionFlags="noKeyPreview"
latin:backgroundType="sticky" />
+ latin:keyActionFlags="isRepeatable|noKeyPreview"
+ latin:backgroundType="functional" />
+ latin:keyActionFlags="noKeyPreview" />
+ latin:keyActionFlags="noKeyPreview" />
diff --git a/java/res/xml-sw768dp/kbd_qwerty_row1.xml b/java/res/xml-sw768dp/kbd_qwerty_row1.xml
index 14b8bddfb..de9101331 100644
--- a/java/res/xml-sw768dp/kbd_qwerty_row1.xml
+++ b/java/res/xml-sw768dp/kbd_qwerty_row1.xml
@@ -26,7 +26,7 @@
>
@@ -76,7 +76,7 @@
diff --git a/java/res/xml-sw768dp/kbd_row3_comma_period.xml b/java/res/xml-sw768dp/kbd_row3_comma_period.xml
index b84443078..6a95ca1a3 100644
--- a/java/res/xml-sw768dp/kbd_row3_comma_period.xml
+++ b/java/res/xml-sw768dp/kbd_row3_comma_period.xml
@@ -33,12 +33,12 @@
diff --git a/java/res/xml-sw768dp/kbd_row4_apostrophe_dash.xml b/java/res/xml-sw768dp/kbd_row4_apostrophe_dash.xml
index 9536e81da..4eb82d24a 100644
--- a/java/res/xml-sw768dp/kbd_row4_apostrophe_dash.xml
+++ b/java/res/xml-sw768dp/kbd_row4_apostrophe_dash.xml
@@ -33,14 +33,14 @@
>
@@ -55,7 +55,7 @@
diff --git a/java/res/xml-sw768dp/kbd_rows_arabic.xml b/java/res/xml-sw768dp/kbd_rows_arabic.xml
index 7ec36fd94..412d5d98a 100644
--- a/java/res/xml-sw768dp/kbd_rows_arabic.xml
+++ b/java/res/xml-sw768dp/kbd_rows_arabic.xml
@@ -28,7 +28,7 @@
>
diff --git a/java/res/xml-sw768dp/kbd_rows_azerty.xml b/java/res/xml-sw768dp/kbd_rows_azerty.xml
index 4659d9924..3edfb7e5b 100644
--- a/java/res/xml-sw768dp/kbd_rows_azerty.xml
+++ b/java/res/xml-sw768dp/kbd_rows_azerty.xml
@@ -28,7 +28,7 @@
>
@@ -142,12 +142,12 @@
diff --git a/java/res/xml-sw768dp/kbd_rows_hebrew.xml b/java/res/xml-sw768dp/kbd_rows_hebrew.xml
index 27b39d1ae..5f4b556b6 100644
--- a/java/res/xml-sw768dp/kbd_rows_hebrew.xml
+++ b/java/res/xml-sw768dp/kbd_rows_hebrew.xml
@@ -28,7 +28,7 @@
>
@@ -58,7 +58,7 @@
>
diff --git a/java/res/xml-sw768dp/kbd_rows_number.xml b/java/res/xml-sw768dp/kbd_rows_number.xml
index c6a4193c3..1268987b5 100644
--- a/java/res/xml-sw768dp/kbd_rows_number.xml
+++ b/java/res/xml-sw768dp/kbd_rows_number.xml
@@ -32,7 +32,7 @@
diff --git a/java/res/xml-sw768dp/kbd_rows_russian.xml b/java/res/xml-sw768dp/kbd_rows_russian.xml
index e5f556958..eb0baf95d 100644
--- a/java/res/xml-sw768dp/kbd_rows_russian.xml
+++ b/java/res/xml-sw768dp/kbd_rows_russian.xml
@@ -28,7 +28,7 @@
>
+ latin:keyLabelFlags="alignLeft" />
diff --git a/java/res/xml-sw768dp/kbd_rows_scandinavian.xml b/java/res/xml-sw768dp/kbd_rows_scandinavian.xml
index b9d168036..c2dead230 100644
--- a/java/res/xml-sw768dp/kbd_rows_scandinavian.xml
+++ b/java/res/xml-sw768dp/kbd_rows_scandinavian.xml
@@ -28,7 +28,7 @@
>
+ latin:keyLabelFlags="alignLeft" />
diff --git a/java/res/xml-sw768dp/kbd_rows_spanish.xml b/java/res/xml-sw768dp/kbd_rows_spanish.xml
index c737f400a..7e543b2fb 100644
--- a/java/res/xml-sw768dp/kbd_rows_spanish.xml
+++ b/java/res/xml-sw768dp/kbd_rows_spanish.xml
@@ -30,7 +30,7 @@
>
diff --git a/java/res/xml-sw768dp/kbd_rows_symbols_shift.xml b/java/res/xml-sw768dp/kbd_rows_symbols_shift.xml
index 9a9c3a276..f6b47a86f 100644
--- a/java/res/xml-sw768dp/kbd_rows_symbols_shift.xml
+++ b/java/res/xml-sw768dp/kbd_rows_symbols_shift.xml
@@ -30,7 +30,7 @@
>
@@ -65,7 +65,7 @@
>
diff --git a/java/res/xml/kbd_key_styles.xml b/java/res/xml/kbd_key_styles.xml
index 3b7c3db47..5aa8811fd 100644
--- a/java/res/xml/kbd_key_styles.xml
+++ b/java/res/xml/kbd_key_styles.xml
@@ -28,7 +28,7 @@
>
@@ -38,7 +38,7 @@
>
@@ -48,7 +48,7 @@
>
@@ -56,7 +56,7 @@
@@ -67,15 +67,14 @@
latin:code="@integer/key_shift"
latin:keyIcon="iconShiftKey"
latin:keyIconShifted="iconShiftedShiftKey"
- latin:keyLabelOption="noKeyPreview"
+ latin:keyActionFlags="noKeyPreview"
latin:backgroundType="sticky" />
+ latin:keyActionFlags="isRepeatable|noKeyPreview"
+ latin:backgroundType="functional" />
@@ -98,7 +97,8 @@
latin:styleName="returnKeyStyle"
latin:code="@integer/key_return"
latin:keyLabel="@string/label_go_key"
- latin:keyLabelOption="autoXScale|noKeyPreview"
+ latin:keyLabelFlags="autoXScale"
+ latin:keyActionFlags="noKeyPreview"
latin:backgroundType="action" />
@@ -146,26 +150,26 @@
latin:styleName="returnKeyStyle"
latin:code="@integer/key_return"
latin:keyIcon="iconReturnKey"
- latin:keyLabelOption="noKeyPreview"
+ latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" />
@@ -201,7 +206,7 @@
latin:styleName="toSymbolKeyStyle"
latin:code="@integer/key_switch_alpha_symbol"
latin:keyLabel="@string/label_to_symbol_key"
- latin:keyLabelOption="noKeyPreview"
+ latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" />
@@ -209,25 +214,25 @@
latin:styleName="toAlphaKeyStyle"
latin:code="@integer/key_switch_alpha_symbol"
latin:keyLabel="@string/label_to_alpha_key"
- latin:keyLabelOption="noKeyPreview"
+ latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" />
diff --git a/java/res/xml/kbd_numkey_styles.xml b/java/res/xml/kbd_numkey_styles.xml
index 42c0f6488..c2ff4d50f 100644
--- a/java/res/xml/kbd_numkey_styles.xml
+++ b/java/res/xml/kbd_numkey_styles.xml
@@ -23,23 +23,23 @@
>
+ latin:keyActionFlags="noKeyPreview" />
-
+
-
+
1
- && (mLabelOption & (LABEL_OPTION_FOLLOW_KEY_LETTER_RATIO
- | LABEL_OPTION_FOLLOW_KEY_HINT_LABEL_RATIO)) == 0) {
+ && (mLabelFlags & (LABEL_FLAGS_FOLLOW_KEY_LETTER_RATIO
+ | LABEL_FLAGS_FOLLOW_KEY_HINT_LABEL_RATIO)) == 0) {
return label;
- } else if ((mLabelOption & LABEL_OPTION_FOLLOW_KEY_HINT_LABEL_RATIO) != 0) {
+ } else if ((mLabelFlags & LABEL_FLAGS_FOLLOW_KEY_HINT_LABEL_RATIO) != 0) {
return hintLabel;
- } else if ((mLabelOption & LABEL_OPTION_LARGE_LETTER) != 0) {
+ } else if ((mLabelFlags & LABEL_FLAGS_LARGE_LETTER) != 0) {
return largeLetter;
} else {
return letter;
@@ -344,19 +351,19 @@ public class Key {
}
public boolean isAlignLeft() {
- return (mLabelOption & LABEL_OPTION_ALIGN_LEFT) != 0;
+ return (mLabelFlags & LABEL_FLAGS_ALIGN_LEFT) != 0;
}
public boolean isAlignRight() {
- return (mLabelOption & LABEL_OPTION_ALIGN_RIGHT) != 0;
+ return (mLabelFlags & LABEL_FLAGS_ALIGN_RIGHT) != 0;
}
public boolean isAlignLeftOfCenter() {
- return (mLabelOption & LABEL_OPTION_ALIGN_LEFT_OF_CENTER) != 0;
+ return (mLabelFlags & LABEL_FLAGS_ALIGN_LEFT_OF_CENTER) != 0;
}
public boolean hasPopupHint() {
- return (mLabelOption & LABEL_OPTION_HAS_POPUP_HINT) != 0;
+ return (mLabelFlags & LABEL_FLAGS_HAS_POPUP_HINT) != 0;
}
public void setNeedsSpecialPopupHint(boolean needsSpecialPopupHint) {
@@ -368,27 +375,23 @@ public class Key {
}
public boolean hasUppercaseLetter() {
- return (mLabelOption & LABEL_OPTION_HAS_UPPERCASE_LETTER) != 0;
+ return (mLabelFlags & LABEL_FLAGS_HAS_UPPERCASE_LETTER) != 0;
}
public boolean hasHintLabel() {
- return (mLabelOption & LABEL_OPTION_HAS_HINT_LABEL) != 0;
+ return (mLabelFlags & LABEL_FLAGS_HAS_HINT_LABEL) != 0;
}
public boolean hasLabelWithIconLeft() {
- return (mLabelOption & LABEL_OPTION_WITH_ICON_LEFT) != 0;
+ return (mLabelFlags & LABEL_FLAGS_WITH_ICON_LEFT) != 0;
}
public boolean hasLabelWithIconRight() {
- return (mLabelOption & LABEL_OPTION_WITH_ICON_RIGHT) != 0;
+ return (mLabelFlags & LABEL_FLAGS_WITH_ICON_RIGHT) != 0;
}
public boolean needsXScale() {
- return (mLabelOption & LABEL_OPTION_AUTO_X_SCALE) != 0;
- }
-
- public boolean noKeyPreview() {
- return (mLabelOption & LABEL_OPTION_NO_KEY_PREVIEW) != 0;
+ return (mLabelFlags & LABEL_FLAGS_AUTO_X_SCALE) != 0;
}
public Drawable getIcon() {
diff --git a/java/src/com/android/inputmethod/keyboard/PointerTracker.java b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
index a3ec37c1b..fb4021048 100644
--- a/java/src/com/android/inputmethod/keyboard/PointerTracker.java
+++ b/java/src/com/android/inputmethod/keyboard/PointerTracker.java
@@ -647,7 +647,7 @@ public class PointerTracker {
private void startRepeatKey(int keyIndex) {
final Key key = getKey(keyIndex);
- if (key != null && key.mRepeatable) {
+ if (key != null && key.isRepeatable()) {
onRepeatKey(keyIndex);
mTimerProxy.startKeyRepeatTimer(sDelayBeforeKeyRepeatStart, keyIndex, this);
mIsRepeatableKey = true;
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java b/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java
index 39fb521ea..565edb901 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyStyles.java
@@ -40,7 +40,6 @@ public class KeyStyles {
public CharSequence getText(TypedArray a, int index);
public int getInt(TypedArray a, int index, int defaultValue);
public int getFlag(TypedArray a, int index, int defaultValue);
- public boolean getBoolean(TypedArray a, int index, boolean defaultValue);
}
/* package */ static class EmptyKeyStyle implements KeyStyle {
@@ -68,11 +67,6 @@ public class KeyStyles {
return a.getInt(index, defaultValue);
}
- @Override
- public boolean getBoolean(TypedArray a, int index, boolean defaultValue) {
- return a.getBoolean(index, defaultValue);
- }
-
protected static CharSequence[] parseTextArray(TypedArray a, int index) {
if (!a.hasValue(index))
return null;
@@ -151,12 +145,6 @@ public class KeyStyles {
return super.getFlag(a, index, defaultValue) | (value != null ? value : 0);
}
- @Override
- public boolean getBoolean(TypedArray a, int index, boolean defaultValue) {
- final Boolean value = (Boolean)mAttributes.get(index);
- return super.getBoolean(a, index, (value != null) ? value : defaultValue);
- }
-
private DeclaredKeyStyle() {
super();
}
@@ -168,14 +156,13 @@ public class KeyStyles {
readText(keyAttr, R.styleable.Keyboard_Key_keyOutputText);
readText(keyAttr, R.styleable.Keyboard_Key_keyHintLabel);
readTextArray(keyAttr, R.styleable.Keyboard_Key_moreKeys);
- readFlag(keyAttr, R.styleable.Keyboard_Key_keyLabelOption);
+ readFlag(keyAttr, R.styleable.Keyboard_Key_keyLabelFlags);
readInt(keyAttr, R.styleable.Keyboard_Key_keyIcon);
readInt(keyAttr, R.styleable.Keyboard_Key_keyIconPreview);
readInt(keyAttr, R.styleable.Keyboard_Key_keyIconShifted);
readInt(keyAttr, R.styleable.Keyboard_Key_maxMoreKeysColumn);
readInt(keyAttr, R.styleable.Keyboard_Key_backgroundType);
- readBoolean(keyAttr, R.styleable.Keyboard_Key_isRepeatable);
- readBoolean(keyAttr, R.styleable.Keyboard_Key_enabled);
+ readFlag(keyAttr, R.styleable.Keyboard_Key_keyActionFlags);
}
private void readText(TypedArray a, int index) {
@@ -194,11 +181,6 @@ public class KeyStyles {
mAttributes.put(index, a.getInt(index, 0) | (value != null ? value : 0));
}
- private void readBoolean(TypedArray a, int index) {
- if (a.hasValue(index))
- mAttributes.put(index, a.getBoolean(index, false));
- }
-
private void readTextArray(TypedArray a, int index) {
final CharSequence[] value = parseTextArray(a, index);
if (value != null)