diff options
author | 2014-05-15 07:09:52 +0000 | |
---|---|---|
committer | 2014-05-15 07:09:53 +0000 | |
commit | 591ec83e40a8046a802691c2ae0cfd08b7de258b (patch) | |
tree | cb3de83010d4624ef9aa2b1f5f6f2c8951d623e4 | |
parent | 28289ece59ea85566c0e2b659c65b483052bcd5b (diff) | |
parent | 37ec0fe9840aeb3fdf4a5749945045f7a76fd16b (diff) | |
download | latinime-591ec83e40a8046a802691c2ae0cfd08b7de258b.tar.gz latinime-591ec83e40a8046a802691c2ae0cfd08b7de258b.tar.xz latinime-591ec83e40a8046a802691c2ae0cfd08b7de258b.zip |
Merge "Use slightly dimmed text color for functional keys"
-rw-r--r-- | java/res/values/attrs.xml | 5 | ||||
-rw-r--r-- | java/res/values/themes-ics.xml | 1 | ||||
-rw-r--r-- | java/res/values/themes-klp.xml | 1 | ||||
-rw-r--r-- | java/res/values/themes-lxx.xml | 1 | ||||
-rw-r--r-- | java/res/xml-sw600dp/key_styles_common.xml | 2 | ||||
-rw-r--r-- | java/res/xml-sw600dp/key_styles_enter.xml | 2 | ||||
-rw-r--r-- | java/res/xml/key_styles_common.xml | 2 | ||||
-rw-r--r-- | java/res/xml/key_styles_enter.xml | 2 | ||||
-rw-r--r-- | java/res/xml/key_styles_number.xml | 2 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/Key.java | 4 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/internal/KeyDrawParams.java | 3 | ||||
-rw-r--r-- | java/src/com/android/inputmethod/keyboard/internal/KeyVisualAttributes.java | 3 |
12 files changed, 23 insertions, 5 deletions
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index 79cc139a2..701d19572 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -311,6 +311,9 @@ <flag name="shiftedLetterActivated" value="0x20000" /> <!-- If true, use EditorInfo.actionLabel for the key label. --> <flag name="fromCustomActionLabel" value="0x40000" /> + <!-- If true, use functionalTextColor instead of ketTextColor to drawing the label on + the key --> + <flag name="followFunctionalTextColor" value="0x80000" /> <!-- If true, disable keyHintLabel. --> <flag name="disableKeyHintLabel" value="0x40000000" /> <!-- If true, disable additionalMoreKeys. --> @@ -367,6 +370,8 @@ <attr name="keyTextShadowColor" format="color" /> <!-- Color to use for the label in a key when in inactivated state. --> <attr name="keyTextInactivatedColor" format="color" /> + <!-- Color to use for the label in a key that has followFunctionalTextColor keyLabelFlags. --> + <attr name="functionalTextColor" format="color" /> <!-- Key hint letter (= one character hint label) color --> <attr name="keyHintLetterColor" format="color" /> <!-- Key hint label color --> diff --git a/java/res/values/themes-ics.xml b/java/res/values/themes-ics.xml index 560cfc505..79f90365b 100644 --- a/java/res/values/themes-ics.xml +++ b/java/res/values/themes-ics.xml @@ -53,6 +53,7 @@ <item name="keyTypeface">bold</item> <item name="keyTextColor">@color/key_text_color_holo</item> <item name="keyTextInactivatedColor">@color/key_text_inactivated_color_holo</item> + <item name="functionalTextColor">@color/key_text_color_holo</item> <item name="keyHintLetterColor">@color/key_hint_letter_color_holo</item> <item name="keyHintLabelColor">@color/key_hint_label_color_holo</item> <item name="keyShiftedLetterHintInactivatedColor">@color/key_shifted_letter_hint_inactivated_color_holo</item> diff --git a/java/res/values/themes-klp.xml b/java/res/values/themes-klp.xml index 453e5cbce..dfeca1c27 100644 --- a/java/res/values/themes-klp.xml +++ b/java/res/values/themes-klp.xml @@ -53,6 +53,7 @@ <item name="keyTypeface">bold</item> <item name="keyTextColor">@color/key_text_color_holo</item> <item name="keyTextInactivatedColor">@color/key_text_inactivated_color_holo</item> + <item name="functionalTextColor">@color/key_text_color_holo</item> <item name="keyHintLetterColor">@color/key_hint_letter_color_holo</item> <item name="keyHintLabelColor">@color/key_hint_label_color_holo</item> <item name="keyShiftedLetterHintInactivatedColor">@color/key_shifted_letter_hint_inactivated_color_holo</item> diff --git a/java/res/values/themes-lxx.xml b/java/res/values/themes-lxx.xml index 4f3ee80c9..899d26a7e 100644 --- a/java/res/values/themes-lxx.xml +++ b/java/res/values/themes-lxx.xml @@ -53,6 +53,7 @@ <item name="keyTypeface">bold</item> <item name="keyTextColor">@color/key_text_color_holo</item> <item name="keyTextInactivatedColor">@color/key_text_inactive_color_lxx</item> + <item name="functionalTextColor">@color/key_hint_letter_color_lxx</item> <item name="keyHintLetterColor">@color/key_hint_letter_color_lxx</item> <item name="keyHintLabelColor">@color/key_text_inactive_color_lxx</item> <item name="keyShiftedLetterHintInactivatedColor">@color/key_text_inactive_color_lxx</item> diff --git a/java/res/xml-sw600dp/key_styles_common.xml b/java/res/xml-sw600dp/key_styles_common.xml index f9b959b76..35b3576af 100644 --- a/java/res/xml-sw600dp/key_styles_common.xml +++ b/java/res/xml-sw600dp/key_styles_common.xml @@ -140,7 +140,7 @@ </switch> <key-style latin:styleName="baseForLayoutSwitchKeyStyle" - latin:keyLabelFlags="preserveCase" + latin:keyLabelFlags="preserveCase|followFunctionalTextColor" latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style diff --git a/java/res/xml-sw600dp/key_styles_enter.xml b/java/res/xml-sw600dp/key_styles_enter.xml index 99ac10873..742bb3ec3 100644 --- a/java/res/xml-sw600dp/key_styles_enter.xml +++ b/java/res/xml-sw600dp/key_styles_enter.xml @@ -100,7 +100,7 @@ <key-style latin:styleName="defaultEnterKeyStyle" latin:keySpec="!icon/enter_key|!code/key_enter" - latin:keyLabelFlags="preserveCase|autoXScale|followKeyLabelRatio" + latin:keyLabelFlags="preserveCase|autoXScale|followKeyLabelRatio|followFunctionalTextColor" latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" latin:parentStyle="navigateMoreKeysStyle" /> diff --git a/java/res/xml/key_styles_common.xml b/java/res/xml/key_styles_common.xml index 773995fa8..f8b4a2a60 100644 --- a/java/res/xml/key_styles_common.xml +++ b/java/res/xml/key_styles_common.xml @@ -128,7 +128,7 @@ latin:keyIconPreview="!icon/tab_key_preview" /> <key-style latin:styleName="baseForLayoutSwitchKeyStyle" - latin:keyLabelFlags="preserveCase" + latin:keyLabelFlags="preserveCase|followFunctionalTextColor" latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" /> <key-style diff --git a/java/res/xml/key_styles_enter.xml b/java/res/xml/key_styles_enter.xml index 8bba136bd..1d46dd523 100644 --- a/java/res/xml/key_styles_enter.xml +++ b/java/res/xml/key_styles_enter.xml @@ -255,7 +255,7 @@ <!-- Enter key style --> <key-style latin:styleName="defaultEnterKeyStyle" - latin:keyLabelFlags="preserveCase|autoXScale|followKeyLabelRatio" + latin:keyLabelFlags="preserveCase|autoXScale|followKeyLabelRatio|followFunctionalTextColor" latin:keyActionFlags="noKeyPreview" latin:backgroundType="functional" latin:parentStyle="navigateMoreKeysStyle" /> diff --git a/java/res/xml/key_styles_number.xml b/java/res/xml/key_styles_number.xml index 5c108cf58..df4448c25 100644 --- a/java/res/xml/key_styles_number.xml +++ b/java/res/xml/key_styles_number.xml @@ -30,7 +30,7 @@ latin:parentStyle="numKeyBaseStyle" /> <key-style latin:styleName="numModeKeyStyle" - latin:keyLabelFlags="fontNormal|followKeyLetterRatio" + latin:keyLabelFlags="fontNormal|followKeyLetterRatio|followFunctionalTextColor" latin:parentStyle="numKeyBaseStyle" /> <key-style latin:styleName="numFunctionalKeyStyle" diff --git a/java/src/com/android/inputmethod/keyboard/Key.java b/java/src/com/android/inputmethod/keyboard/Key.java index 4c2250740..a1269c801 100644 --- a/java/src/com/android/inputmethod/keyboard/Key.java +++ b/java/src/com/android/inputmethod/keyboard/Key.java @@ -86,6 +86,7 @@ public class Key implements Comparable<Key> { private static final int LABEL_FLAGS_PRESERVE_CASE = 0x10000; private static final int LABEL_FLAGS_SHIFTED_LETTER_ACTIVATED = 0x20000; private static final int LABEL_FLAGS_FROM_CUSTOM_ACTION_LABEL = 0x40000; + private static final int LABEL_FLAGS_FOLLOW_FUNCTIONAL_TEXT_COLOR = 0x80000; private static final int LABEL_FLAGS_DISABLE_HINT_LABEL = 0x40000000; private static final int LABEL_FLAGS_DISABLE_ADDITIONAL_MORE_KEYS = 0x80000000; @@ -583,6 +584,9 @@ public class Key implements Comparable<Key> { } public final int selectTextColor(final KeyDrawParams params) { + if ((mLabelFlags & LABEL_FLAGS_FOLLOW_FUNCTIONAL_TEXT_COLOR) != 0) { + return params.mFunctionalTextColor; + } return isShiftedLetterActivated() ? params.mTextInactivatedColor : params.mTextColor; } diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyDrawParams.java b/java/src/com/android/inputmethod/keyboard/internal/KeyDrawParams.java index 1716fa049..07ac06bab 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyDrawParams.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyDrawParams.java @@ -35,6 +35,7 @@ public final class KeyDrawParams { public int mTextColor; public int mTextInactivatedColor; public int mTextShadowColor; + public int mFunctionalTextColor; public int mHintLetterColor; public int mHintLabelColor; public int mShiftedLetterHintInactivatedColor; @@ -60,6 +61,7 @@ public final class KeyDrawParams { mTextColor = copyFrom.mTextColor; mTextInactivatedColor = copyFrom.mTextInactivatedColor; mTextShadowColor = copyFrom.mTextShadowColor; + mFunctionalTextColor = copyFrom.mFunctionalTextColor; mHintLetterColor = copyFrom.mHintLetterColor; mHintLabelColor = copyFrom.mHintLabelColor; mShiftedLetterHintInactivatedColor = copyFrom.mShiftedLetterHintInactivatedColor; @@ -93,6 +95,7 @@ public final class KeyDrawParams { mTextColor = selectColor(attr.mTextColor, mTextColor); mTextInactivatedColor = selectColor(attr.mTextInactivatedColor, mTextInactivatedColor); mTextShadowColor = selectColor(attr.mTextShadowColor, mTextShadowColor); + mFunctionalTextColor = selectColor(attr.mFunctionalTextColor, mFunctionalTextColor); mHintLetterColor = selectColor(attr.mHintLetterColor, mHintLetterColor); mHintLabelColor = selectColor(attr.mHintLabelColor, mHintLabelColor); mShiftedLetterHintInactivatedColor = selectColor( diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyVisualAttributes.java b/java/src/com/android/inputmethod/keyboard/internal/KeyVisualAttributes.java index df386fce4..133462ac7 100644 --- a/java/src/com/android/inputmethod/keyboard/internal/KeyVisualAttributes.java +++ b/java/src/com/android/inputmethod/keyboard/internal/KeyVisualAttributes.java @@ -40,6 +40,7 @@ public final class KeyVisualAttributes { public final int mTextColor; public final int mTextInactivatedColor; public final int mTextShadowColor; + public final int mFunctionalTextColor; public final int mHintLetterColor; public final int mHintLabelColor; public final int mShiftedLetterHintInactivatedColor; @@ -61,6 +62,7 @@ public final class KeyVisualAttributes { R.styleable.Keyboard_Key_keyTextColor, R.styleable.Keyboard_Key_keyTextInactivatedColor, R.styleable.Keyboard_Key_keyTextShadowColor, + R.styleable.Keyboard_Key_functionalTextColor, R.styleable.Keyboard_Key_keyHintLetterColor, R.styleable.Keyboard_Key_keyHintLabelColor, R.styleable.Keyboard_Key_keyShiftedLetterHintInactivatedColor, @@ -122,6 +124,7 @@ public final class KeyVisualAttributes { mTextInactivatedColor = keyAttr.getColor( R.styleable.Keyboard_Key_keyTextInactivatedColor, 0); mTextShadowColor = keyAttr.getColor(R.styleable.Keyboard_Key_keyTextShadowColor, 0); + mFunctionalTextColor = keyAttr.getColor(R.styleable.Keyboard_Key_functionalTextColor, 0); mHintLetterColor = keyAttr.getColor(R.styleable.Keyboard_Key_keyHintLetterColor, 0); mHintLabelColor = keyAttr.getColor(R.styleable.Keyboard_Key_keyHintLabelColor, 0); mShiftedLetterHintInactivatedColor = keyAttr.getColor( |