diff --git a/java/res/drawable/btn_keyboard_key.xml b/java/res/drawable/btn_keyboard_key.xml
index 797bc105e..112ac2636 100644
--- a/java/res/drawable/btn_keyboard_key.xml
+++ b/java/res/drawable/btn_keyboard_key.xml
@@ -15,9 +15,7 @@
-->
-
-
@@ -28,11 +26,12 @@
-
+
+
+
-
-
+
diff --git a/java/res/drawable/btn_keyboard_key3.xml b/java/res/drawable/btn_keyboard_key3.xml
index dbe82d5fd..080b1f326 100644
--- a/java/res/drawable/btn_keyboard_key3.xml
+++ b/java/res/drawable/btn_keyboard_key3.xml
@@ -15,9 +15,7 @@
-->
-
-
@@ -28,8 +26,11 @@
-
+
+
+
diff --git a/java/res/drawable/btn_keyboard_key_gingerbread.xml b/java/res/drawable/btn_keyboard_key_gingerbread.xml
index 5b4399e1b..3fc253e85 100644
--- a/java/res/drawable/btn_keyboard_key_gingerbread.xml
+++ b/java/res/drawable/btn_keyboard_key_gingerbread.xml
@@ -15,23 +15,19 @@
-->
-
-
-
-
-
+
+
+
diff --git a/java/res/drawable/btn_keyboard_key_ics.xml b/java/res/drawable/btn_keyboard_key_ics.xml
index e893da133..0c86e163e 100644
--- a/java/res/drawable/btn_keyboard_key_ics.xml
+++ b/java/res/drawable/btn_keyboard_key_ics.xml
@@ -15,23 +15,19 @@
-->
-
-
-
-
-
+
+
+
diff --git a/java/res/drawable/btn_keyboard_key_stone.xml b/java/res/drawable/btn_keyboard_key_stone.xml
index 9bc3f18d6..70a2ad444 100644
--- a/java/res/drawable/btn_keyboard_key_stone.xml
+++ b/java/res/drawable/btn_keyboard_key_stone.xml
@@ -15,23 +15,19 @@
-->
-
-
-
-
@@ -42,8 +38,11 @@
-
+
+
+
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index eef9116da..5c59f5f68 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -240,11 +240,12 @@
-
-
-
-
-
+
+
+
+
+
+
diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java
index 61805286d..16c79eb8e 100644
--- a/java/src/com/android/inputmethod/keyboard/Key.java
+++ b/java/src/com/android/inputmethod/keyboard/Key.java
@@ -122,11 +122,12 @@ public class Key implements Comparable {
/** Background type that represents different key background visual than normal one. */
public final int mBackgroundType;
- public static final int BACKGROUND_TYPE_NORMAL = 0;
- public static final int BACKGROUND_TYPE_FUNCTIONAL = 1;
- public static final int BACKGROUND_TYPE_ACTION = 2;
- public static final int BACKGROUND_TYPE_STICKY_OFF = 3;
- public static final int BACKGROUND_TYPE_STICKY_ON = 4;
+ public static final int BACKGROUND_TYPE_EMPTY = 0;
+ public static final int BACKGROUND_TYPE_NORMAL = 1;
+ public static final int BACKGROUND_TYPE_FUNCTIONAL = 2;
+ public static final int BACKGROUND_TYPE_ACTION = 3;
+ public static final int BACKGROUND_TYPE_STICKY_OFF = 4;
+ public static final int BACKGROUND_TYPE_STICKY_ON = 5;
private final int mActionFlags;
private static final int ACTION_FLAGS_IS_REPEATABLE = 0x01;
@@ -175,7 +176,7 @@ public class Key implements Comparable {
public Key(final KeyboardParams params, final MoreKeySpec moreKeySpec, final int x, final int y,
final int width, final int height, final int labelFlags) {
this(params, moreKeySpec.mLabel, null, moreKeySpec.mIconId, moreKeySpec.mCode,
- moreKeySpec.mOutputText, x, y, width, height, labelFlags);
+ moreKeySpec.mOutputText, x, y, width, height, labelFlags, BACKGROUND_TYPE_NORMAL);
}
/**
@@ -183,12 +184,12 @@ public class Key implements Comparable {
*/
public Key(final KeyboardParams params, final String label, final String hintLabel,
final int iconId, final int code, final String outputText, final int x, final int y,
- final int width, final int height, final int labelFlags) {
+ final int width, final int height, final int labelFlags, final int backgroundType) {
mHeight = height - params.mVerticalGap;
mWidth = width - params.mHorizontalGap;
mHintLabel = hintLabel;
mLabelFlags = labelFlags;
- mBackgroundType = BACKGROUND_TYPE_NORMAL;
+ mBackgroundType = backgroundType;
mActionFlags = 0;
mMoreKeys = null;
mMoreKeysColumnAndFlags = 0;
@@ -465,6 +466,7 @@ public class Key implements Comparable {
private static String backgroundName(final int backgroundType) {
switch (backgroundType) {
+ case BACKGROUND_TYPE_EMPTY: return "empty";
case BACKGROUND_TYPE_NORMAL: return "normal";
case BACKGROUND_TYPE_FUNCTIONAL: return "functional";
case BACKGROUND_TYPE_ACTION: return "action";
@@ -788,6 +790,10 @@ public class Key implements Comparable {
android.R.attr.state_pressed
};
+ private final static int[] KEY_STATE_EMPTY = {
+ android.R.attr.state_empty
+ };
+
// functional normal state (with properties)
private static final int[] KEY_STATE_FUNCTIONAL_NORMAL = {
android.R.attr.state_single
@@ -825,6 +831,8 @@ public class Key implements Comparable {
return mPressed ? KEY_STATE_PRESSED_HIGHLIGHT_OFF : KEY_STATE_NORMAL_HIGHLIGHT_OFF;
case BACKGROUND_TYPE_STICKY_ON:
return mPressed ? KEY_STATE_PRESSED_HIGHLIGHT_ON : KEY_STATE_NORMAL_HIGHLIGHT_ON;
+ case BACKGROUND_TYPE_EMPTY:
+ return mPressed ? KEY_STATE_PRESSED : KEY_STATE_EMPTY;
default: /* BACKGROUND_TYPE_NORMAL */
return mPressed ? KEY_STATE_PRESSED : KEY_STATE_NORMAL;
}
@@ -842,7 +850,7 @@ public class Key implements Comparable {
protected Spacer(final KeyboardParams params, final int x, final int y, final int width,
final int height) {
super(params, null, null, ICON_UNDEFINED, CODE_UNSPECIFIED,
- null, x, y, width, height, 0);
+ null, x, y, width, height, 0, BACKGROUND_TYPE_EMPTY);
}
}
}
diff --git a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java
index e97069dff..acd47450b 100644
--- a/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java
+++ b/java/src/com/android/inputmethod/latin/suggestions/MoreSuggestions.java
@@ -210,7 +210,8 @@ public final class MoreSuggestions extends Keyboard {
final int indexInMoreSuggestions = index + SUGGESTION_CODE_BASE;
final Key key = new Key(
params, word, info, KeyboardIconsSet.ICON_UNDEFINED, indexInMoreSuggestions,
- null, x, y, width, params.mDefaultRowHeight, 0);
+ null /* outputText */, x, y, width, params.mDefaultRowHeight,
+ 0 /* labelFlags */, Key.BACKGROUND_TYPE_NORMAL);
params.markAsEdgeKey(key, index);
params.onAddKey(key);
final int columnNumber = params.getColumnNumber(index);