am 591ec83e: Merge "Use slightly dimmed text color for functional keys"
* commit '591ec83e40a8046a802691c2ae0cfd08b7de258b': Use slightly dimmed text color for functional keysmain
commit
1d17d6f774
|
@ -311,6 +311,9 @@
|
||||||
<flag name="shiftedLetterActivated" value="0x20000" />
|
<flag name="shiftedLetterActivated" value="0x20000" />
|
||||||
<!-- If true, use EditorInfo.actionLabel for the key label. -->
|
<!-- If true, use EditorInfo.actionLabel for the key label. -->
|
||||||
<flag name="fromCustomActionLabel" value="0x40000" />
|
<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. -->
|
<!-- If true, disable keyHintLabel. -->
|
||||||
<flag name="disableKeyHintLabel" value="0x40000000" />
|
<flag name="disableKeyHintLabel" value="0x40000000" />
|
||||||
<!-- If true, disable additionalMoreKeys. -->
|
<!-- If true, disable additionalMoreKeys. -->
|
||||||
|
@ -367,6 +370,8 @@
|
||||||
<attr name="keyTextShadowColor" format="color" />
|
<attr name="keyTextShadowColor" format="color" />
|
||||||
<!-- Color to use for the label in a key when in inactivated state. -->
|
<!-- Color to use for the label in a key when in inactivated state. -->
|
||||||
<attr name="keyTextInactivatedColor" format="color" />
|
<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 -->
|
<!-- Key hint letter (= one character hint label) color -->
|
||||||
<attr name="keyHintLetterColor" format="color" />
|
<attr name="keyHintLetterColor" format="color" />
|
||||||
<!-- Key hint label color -->
|
<!-- Key hint label color -->
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
<item name="keyTypeface">bold</item>
|
<item name="keyTypeface">bold</item>
|
||||||
<item name="keyTextColor">@color/key_text_color_holo</item>
|
<item name="keyTextColor">@color/key_text_color_holo</item>
|
||||||
<item name="keyTextInactivatedColor">@color/key_text_inactivated_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="keyHintLetterColor">@color/key_hint_letter_color_holo</item>
|
||||||
<item name="keyHintLabelColor">@color/key_hint_label_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>
|
<item name="keyShiftedLetterHintInactivatedColor">@color/key_shifted_letter_hint_inactivated_color_holo</item>
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
<item name="keyTypeface">bold</item>
|
<item name="keyTypeface">bold</item>
|
||||||
<item name="keyTextColor">@color/key_text_color_holo</item>
|
<item name="keyTextColor">@color/key_text_color_holo</item>
|
||||||
<item name="keyTextInactivatedColor">@color/key_text_inactivated_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="keyHintLetterColor">@color/key_hint_letter_color_holo</item>
|
||||||
<item name="keyHintLabelColor">@color/key_hint_label_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>
|
<item name="keyShiftedLetterHintInactivatedColor">@color/key_shifted_letter_hint_inactivated_color_holo</item>
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
<item name="keyTypeface">bold</item>
|
<item name="keyTypeface">bold</item>
|
||||||
<item name="keyTextColor">@color/key_text_color_holo</item>
|
<item name="keyTextColor">@color/key_text_color_holo</item>
|
||||||
<item name="keyTextInactivatedColor">@color/key_text_inactive_color_lxx</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="keyHintLetterColor">@color/key_hint_letter_color_lxx</item>
|
||||||
<item name="keyHintLabelColor">@color/key_text_inactive_color_lxx</item>
|
<item name="keyHintLabelColor">@color/key_text_inactive_color_lxx</item>
|
||||||
<item name="keyShiftedLetterHintInactivatedColor">@color/key_text_inactive_color_lxx</item>
|
<item name="keyShiftedLetterHintInactivatedColor">@color/key_text_inactive_color_lxx</item>
|
||||||
|
|
|
@ -140,7 +140,7 @@
|
||||||
</switch>
|
</switch>
|
||||||
<key-style
|
<key-style
|
||||||
latin:styleName="baseForLayoutSwitchKeyStyle"
|
latin:styleName="baseForLayoutSwitchKeyStyle"
|
||||||
latin:keyLabelFlags="preserveCase"
|
latin:keyLabelFlags="preserveCase|followFunctionalTextColor"
|
||||||
latin:keyActionFlags="noKeyPreview"
|
latin:keyActionFlags="noKeyPreview"
|
||||||
latin:backgroundType="functional" />
|
latin:backgroundType="functional" />
|
||||||
<key-style
|
<key-style
|
||||||
|
|
|
@ -100,7 +100,7 @@
|
||||||
<key-style
|
<key-style
|
||||||
latin:styleName="defaultEnterKeyStyle"
|
latin:styleName="defaultEnterKeyStyle"
|
||||||
latin:keySpec="!icon/enter_key|!code/key_enter"
|
latin:keySpec="!icon/enter_key|!code/key_enter"
|
||||||
latin:keyLabelFlags="preserveCase|autoXScale|followKeyLabelRatio"
|
latin:keyLabelFlags="preserveCase|autoXScale|followKeyLabelRatio|followFunctionalTextColor"
|
||||||
latin:keyActionFlags="noKeyPreview"
|
latin:keyActionFlags="noKeyPreview"
|
||||||
latin:backgroundType="functional"
|
latin:backgroundType="functional"
|
||||||
latin:parentStyle="navigateMoreKeysStyle" />
|
latin:parentStyle="navigateMoreKeysStyle" />
|
||||||
|
|
|
@ -128,7 +128,7 @@
|
||||||
latin:keyIconPreview="!icon/tab_key_preview" />
|
latin:keyIconPreview="!icon/tab_key_preview" />
|
||||||
<key-style
|
<key-style
|
||||||
latin:styleName="baseForLayoutSwitchKeyStyle"
|
latin:styleName="baseForLayoutSwitchKeyStyle"
|
||||||
latin:keyLabelFlags="preserveCase"
|
latin:keyLabelFlags="preserveCase|followFunctionalTextColor"
|
||||||
latin:keyActionFlags="noKeyPreview"
|
latin:keyActionFlags="noKeyPreview"
|
||||||
latin:backgroundType="functional" />
|
latin:backgroundType="functional" />
|
||||||
<key-style
|
<key-style
|
||||||
|
|
|
@ -255,7 +255,7 @@
|
||||||
<!-- Enter key style -->
|
<!-- Enter key style -->
|
||||||
<key-style
|
<key-style
|
||||||
latin:styleName="defaultEnterKeyStyle"
|
latin:styleName="defaultEnterKeyStyle"
|
||||||
latin:keyLabelFlags="preserveCase|autoXScale|followKeyLabelRatio"
|
latin:keyLabelFlags="preserveCase|autoXScale|followKeyLabelRatio|followFunctionalTextColor"
|
||||||
latin:keyActionFlags="noKeyPreview"
|
latin:keyActionFlags="noKeyPreview"
|
||||||
latin:backgroundType="functional"
|
latin:backgroundType="functional"
|
||||||
latin:parentStyle="navigateMoreKeysStyle" />
|
latin:parentStyle="navigateMoreKeysStyle" />
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
latin:parentStyle="numKeyBaseStyle" />
|
latin:parentStyle="numKeyBaseStyle" />
|
||||||
<key-style
|
<key-style
|
||||||
latin:styleName="numModeKeyStyle"
|
latin:styleName="numModeKeyStyle"
|
||||||
latin:keyLabelFlags="fontNormal|followKeyLetterRatio"
|
latin:keyLabelFlags="fontNormal|followKeyLetterRatio|followFunctionalTextColor"
|
||||||
latin:parentStyle="numKeyBaseStyle" />
|
latin:parentStyle="numKeyBaseStyle" />
|
||||||
<key-style
|
<key-style
|
||||||
latin:styleName="numFunctionalKeyStyle"
|
latin:styleName="numFunctionalKeyStyle"
|
||||||
|
|
|
@ -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_PRESERVE_CASE = 0x10000;
|
||||||
private static final int LABEL_FLAGS_SHIFTED_LETTER_ACTIVATED = 0x20000;
|
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_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_HINT_LABEL = 0x40000000;
|
||||||
private static final int LABEL_FLAGS_DISABLE_ADDITIONAL_MORE_KEYS = 0x80000000;
|
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) {
|
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;
|
return isShiftedLetterActivated() ? params.mTextInactivatedColor : params.mTextColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ public final class KeyDrawParams {
|
||||||
public int mTextColor;
|
public int mTextColor;
|
||||||
public int mTextInactivatedColor;
|
public int mTextInactivatedColor;
|
||||||
public int mTextShadowColor;
|
public int mTextShadowColor;
|
||||||
|
public int mFunctionalTextColor;
|
||||||
public int mHintLetterColor;
|
public int mHintLetterColor;
|
||||||
public int mHintLabelColor;
|
public int mHintLabelColor;
|
||||||
public int mShiftedLetterHintInactivatedColor;
|
public int mShiftedLetterHintInactivatedColor;
|
||||||
|
@ -60,6 +61,7 @@ public final class KeyDrawParams {
|
||||||
mTextColor = copyFrom.mTextColor;
|
mTextColor = copyFrom.mTextColor;
|
||||||
mTextInactivatedColor = copyFrom.mTextInactivatedColor;
|
mTextInactivatedColor = copyFrom.mTextInactivatedColor;
|
||||||
mTextShadowColor = copyFrom.mTextShadowColor;
|
mTextShadowColor = copyFrom.mTextShadowColor;
|
||||||
|
mFunctionalTextColor = copyFrom.mFunctionalTextColor;
|
||||||
mHintLetterColor = copyFrom.mHintLetterColor;
|
mHintLetterColor = copyFrom.mHintLetterColor;
|
||||||
mHintLabelColor = copyFrom.mHintLabelColor;
|
mHintLabelColor = copyFrom.mHintLabelColor;
|
||||||
mShiftedLetterHintInactivatedColor = copyFrom.mShiftedLetterHintInactivatedColor;
|
mShiftedLetterHintInactivatedColor = copyFrom.mShiftedLetterHintInactivatedColor;
|
||||||
|
@ -93,6 +95,7 @@ public final class KeyDrawParams {
|
||||||
mTextColor = selectColor(attr.mTextColor, mTextColor);
|
mTextColor = selectColor(attr.mTextColor, mTextColor);
|
||||||
mTextInactivatedColor = selectColor(attr.mTextInactivatedColor, mTextInactivatedColor);
|
mTextInactivatedColor = selectColor(attr.mTextInactivatedColor, mTextInactivatedColor);
|
||||||
mTextShadowColor = selectColor(attr.mTextShadowColor, mTextShadowColor);
|
mTextShadowColor = selectColor(attr.mTextShadowColor, mTextShadowColor);
|
||||||
|
mFunctionalTextColor = selectColor(attr.mFunctionalTextColor, mFunctionalTextColor);
|
||||||
mHintLetterColor = selectColor(attr.mHintLetterColor, mHintLetterColor);
|
mHintLetterColor = selectColor(attr.mHintLetterColor, mHintLetterColor);
|
||||||
mHintLabelColor = selectColor(attr.mHintLabelColor, mHintLabelColor);
|
mHintLabelColor = selectColor(attr.mHintLabelColor, mHintLabelColor);
|
||||||
mShiftedLetterHintInactivatedColor = selectColor(
|
mShiftedLetterHintInactivatedColor = selectColor(
|
||||||
|
|
|
@ -40,6 +40,7 @@ public final class KeyVisualAttributes {
|
||||||
public final int mTextColor;
|
public final int mTextColor;
|
||||||
public final int mTextInactivatedColor;
|
public final int mTextInactivatedColor;
|
||||||
public final int mTextShadowColor;
|
public final int mTextShadowColor;
|
||||||
|
public final int mFunctionalTextColor;
|
||||||
public final int mHintLetterColor;
|
public final int mHintLetterColor;
|
||||||
public final int mHintLabelColor;
|
public final int mHintLabelColor;
|
||||||
public final int mShiftedLetterHintInactivatedColor;
|
public final int mShiftedLetterHintInactivatedColor;
|
||||||
|
@ -61,6 +62,7 @@ public final class KeyVisualAttributes {
|
||||||
R.styleable.Keyboard_Key_keyTextColor,
|
R.styleable.Keyboard_Key_keyTextColor,
|
||||||
R.styleable.Keyboard_Key_keyTextInactivatedColor,
|
R.styleable.Keyboard_Key_keyTextInactivatedColor,
|
||||||
R.styleable.Keyboard_Key_keyTextShadowColor,
|
R.styleable.Keyboard_Key_keyTextShadowColor,
|
||||||
|
R.styleable.Keyboard_Key_functionalTextColor,
|
||||||
R.styleable.Keyboard_Key_keyHintLetterColor,
|
R.styleable.Keyboard_Key_keyHintLetterColor,
|
||||||
R.styleable.Keyboard_Key_keyHintLabelColor,
|
R.styleable.Keyboard_Key_keyHintLabelColor,
|
||||||
R.styleable.Keyboard_Key_keyShiftedLetterHintInactivatedColor,
|
R.styleable.Keyboard_Key_keyShiftedLetterHintInactivatedColor,
|
||||||
|
@ -122,6 +124,7 @@ public final class KeyVisualAttributes {
|
||||||
mTextInactivatedColor = keyAttr.getColor(
|
mTextInactivatedColor = keyAttr.getColor(
|
||||||
R.styleable.Keyboard_Key_keyTextInactivatedColor, 0);
|
R.styleable.Keyboard_Key_keyTextInactivatedColor, 0);
|
||||||
mTextShadowColor = keyAttr.getColor(R.styleable.Keyboard_Key_keyTextShadowColor, 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);
|
mHintLetterColor = keyAttr.getColor(R.styleable.Keyboard_Key_keyHintLetterColor, 0);
|
||||||
mHintLabelColor = keyAttr.getColor(R.styleable.Keyboard_Key_keyHintLabelColor, 0);
|
mHintLabelColor = keyAttr.getColor(R.styleable.Keyboard_Key_keyHintLabelColor, 0);
|
||||||
mShiftedLetterHintInactivatedColor = keyAttr.getColor(
|
mShiftedLetterHintInactivatedColor = keyAttr.getColor(
|
||||||
|
|
Loading…
Reference in New Issue