Merge "Revert "Remove unused Key and Keyboard attributes"" into lmp-dev
commit
5f57fe4ad0
|
@ -47,6 +47,7 @@
|
||||||
<fraction name="config_key_letter_ratio">42%</fraction>
|
<fraction name="config_key_letter_ratio">42%</fraction>
|
||||||
<fraction name="config_key_large_letter_ratio">45%</fraction>
|
<fraction name="config_key_large_letter_ratio">45%</fraction>
|
||||||
<fraction name="config_key_label_ratio">25%</fraction>
|
<fraction name="config_key_label_ratio">25%</fraction>
|
||||||
|
<fraction name="config_key_large_label_ratio">32%</fraction>
|
||||||
<fraction name="config_key_hint_letter_ratio">23%</fraction>
|
<fraction name="config_key_hint_letter_ratio">23%</fraction>
|
||||||
<fraction name="config_key_hint_label_ratio">28%</fraction>
|
<fraction name="config_key_hint_label_ratio">28%</fraction>
|
||||||
<fraction name="config_key_shifted_letter_hint_ratio">22%</fraction>
|
<fraction name="config_key_shifted_letter_hint_ratio">22%</fraction>
|
||||||
|
|
|
@ -45,6 +45,7 @@
|
||||||
<fraction name="config_key_letter_ratio">40%</fraction>
|
<fraction name="config_key_letter_ratio">40%</fraction>
|
||||||
<fraction name="config_key_large_letter_ratio">42%</fraction>
|
<fraction name="config_key_large_letter_ratio">42%</fraction>
|
||||||
<fraction name="config_key_label_ratio">28%</fraction>
|
<fraction name="config_key_label_ratio">28%</fraction>
|
||||||
|
<fraction name="config_key_large_label_ratio">28%</fraction>
|
||||||
<fraction name="config_key_hint_letter_ratio">23%</fraction>
|
<fraction name="config_key_hint_letter_ratio">23%</fraction>
|
||||||
<fraction name="config_key_hint_label_ratio">28%</fraction>
|
<fraction name="config_key_hint_label_ratio">28%</fraction>
|
||||||
<fraction name="config_key_shifted_letter_hint_ratio">26%</fraction>
|
<fraction name="config_key_shifted_letter_hint_ratio">26%</fraction>
|
||||||
|
|
|
@ -300,6 +300,7 @@
|
||||||
<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" />
|
||||||
|
<flag name="followKeyLargeLabelRatio" value="0x100" />
|
||||||
<flag name="followKeyHintLabelRatio" value="0x140" />
|
<flag name="followKeyHintLabelRatio" value="0x140" />
|
||||||
<flag name="hasPopupHint" value="0x200" />
|
<flag name="hasPopupHint" value="0x200" />
|
||||||
<flag name="hasShiftedLetterHint" value="0x400" />
|
<flag name="hasShiftedLetterHint" value="0x400" />
|
||||||
|
@ -358,6 +359,8 @@
|
||||||
<attr name="keyLabelSize" format="dimension|fraction" />
|
<attr name="keyLabelSize" format="dimension|fraction" />
|
||||||
<!-- Large size of the text for one letter keys, in the proportion of key height. -->
|
<!-- Large size of the text for one letter keys, in the proportion of key height. -->
|
||||||
<attr name="keyLargeLetterRatio" format="fraction" />
|
<attr name="keyLargeLetterRatio" format="fraction" />
|
||||||
|
<!-- Large size of the text for keys with multiple letters, in the proportion of key height. -->
|
||||||
|
<attr name="keyLargeLabelRatio" format="fraction" />
|
||||||
<!-- Size of the text for hint letter (= one character hint label), in the proportion of
|
<!-- Size of the text for hint letter (= one character hint label), in the proportion of
|
||||||
key height. -->
|
key height. -->
|
||||||
<attr name="keyHintLetterRatio" format="fraction" />
|
<attr name="keyHintLetterRatio" format="fraction" />
|
||||||
|
|
|
@ -49,6 +49,7 @@
|
||||||
<fraction name="config_key_letter_ratio">55%</fraction>
|
<fraction name="config_key_letter_ratio">55%</fraction>
|
||||||
<fraction name="config_key_large_letter_ratio">65%</fraction>
|
<fraction name="config_key_large_letter_ratio">65%</fraction>
|
||||||
<fraction name="config_key_label_ratio">34%</fraction>
|
<fraction name="config_key_label_ratio">34%</fraction>
|
||||||
|
<fraction name="config_key_large_label_ratio">40%</fraction>
|
||||||
<fraction name="config_key_hint_letter_ratio">25%</fraction>
|
<fraction name="config_key_hint_letter_ratio">25%</fraction>
|
||||||
<fraction name="config_key_hint_label_ratio">44%</fraction>
|
<fraction name="config_key_hint_label_ratio">44%</fraction>
|
||||||
<fraction name="config_key_shifted_letter_hint_ratio">35%</fraction>
|
<fraction name="config_key_shifted_letter_hint_ratio">35%</fraction>
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
<item name="keyLetterSize">@fraction/config_key_letter_ratio</item>
|
<item name="keyLetterSize">@fraction/config_key_letter_ratio</item>
|
||||||
<item name="keyLargeLetterRatio">@fraction/config_key_large_letter_ratio</item>
|
<item name="keyLargeLetterRatio">@fraction/config_key_large_letter_ratio</item>
|
||||||
<item name="keyLabelSize">@fraction/config_key_label_ratio</item>
|
<item name="keyLabelSize">@fraction/config_key_label_ratio</item>
|
||||||
|
<item name="keyLargeLabelRatio">@fraction/config_key_large_label_ratio</item>
|
||||||
<item name="keyHintLetterRatio">@fraction/config_key_hint_letter_ratio</item>
|
<item name="keyHintLetterRatio">@fraction/config_key_hint_letter_ratio</item>
|
||||||
<item name="keyHintLabelRatio">@fraction/config_key_hint_label_ratio</item>
|
<item name="keyHintLabelRatio">@fraction/config_key_hint_label_ratio</item>
|
||||||
<item name="keyShiftedLetterHintRatio">@fraction/config_key_shifted_letter_hint_ratio</item>
|
<item name="keyShiftedLetterHintRatio">@fraction/config_key_shifted_letter_hint_ratio</item>
|
||||||
|
|
|
@ -70,6 +70,7 @@ public class Key implements Comparable<Key> {
|
||||||
private static final int LABEL_FLAGS_FOLLOW_KEY_LARGE_LETTER_RATIO = 0x40;
|
private static final int LABEL_FLAGS_FOLLOW_KEY_LARGE_LETTER_RATIO = 0x40;
|
||||||
private static final int LABEL_FLAGS_FOLLOW_KEY_LETTER_RATIO = 0x80;
|
private static final int LABEL_FLAGS_FOLLOW_KEY_LETTER_RATIO = 0x80;
|
||||||
private static final int LABEL_FLAGS_FOLLOW_KEY_LABEL_RATIO = 0xC0;
|
private static final int LABEL_FLAGS_FOLLOW_KEY_LABEL_RATIO = 0xC0;
|
||||||
|
private static final int LABEL_FLAGS_FOLLOW_KEY_LARGE_LABEL_RATIO = 0x100;
|
||||||
private static final int LABEL_FLAGS_FOLLOW_KEY_HINT_LABEL_RATIO = 0x140;
|
private static final int LABEL_FLAGS_FOLLOW_KEY_HINT_LABEL_RATIO = 0x140;
|
||||||
// End of key text ratio mask enum values
|
// End of key text ratio mask enum values
|
||||||
private static final int LABEL_FLAGS_HAS_POPUP_HINT = 0x200;
|
private static final int LABEL_FLAGS_HAS_POPUP_HINT = 0x200;
|
||||||
|
@ -579,6 +580,8 @@ public class Key implements Comparable<Key> {
|
||||||
return params.mLargeLetterSize;
|
return params.mLargeLetterSize;
|
||||||
case LABEL_FLAGS_FOLLOW_KEY_LABEL_RATIO:
|
case LABEL_FLAGS_FOLLOW_KEY_LABEL_RATIO:
|
||||||
return params.mLabelSize;
|
return params.mLabelSize;
|
||||||
|
case LABEL_FLAGS_FOLLOW_KEY_LARGE_LABEL_RATIO:
|
||||||
|
return params.mLargeLabelSize;
|
||||||
case LABEL_FLAGS_FOLLOW_KEY_HINT_LABEL_RATIO:
|
case LABEL_FLAGS_FOLLOW_KEY_HINT_LABEL_RATIO:
|
||||||
return params.mHintLabelSize;
|
return params.mHintLabelSize;
|
||||||
default: // No follow key ratio flag specified.
|
default: // No follow key ratio flag specified.
|
||||||
|
|
|
@ -26,6 +26,7 @@ public final class KeyDrawParams {
|
||||||
public int mLetterSize;
|
public int mLetterSize;
|
||||||
public int mLabelSize;
|
public int mLabelSize;
|
||||||
public int mLargeLetterSize;
|
public int mLargeLetterSize;
|
||||||
|
public int mLargeLabelSize;
|
||||||
public int mHintLetterSize;
|
public int mHintLetterSize;
|
||||||
public int mShiftedLetterHintSize;
|
public int mShiftedLetterHintSize;
|
||||||
public int mHintLabelSize;
|
public int mHintLabelSize;
|
||||||
|
@ -55,6 +56,7 @@ public final class KeyDrawParams {
|
||||||
mLetterSize = copyFrom.mLetterSize;
|
mLetterSize = copyFrom.mLetterSize;
|
||||||
mLabelSize = copyFrom.mLabelSize;
|
mLabelSize = copyFrom.mLabelSize;
|
||||||
mLargeLetterSize = copyFrom.mLargeLetterSize;
|
mLargeLetterSize = copyFrom.mLargeLetterSize;
|
||||||
|
mLargeLabelSize = copyFrom.mLargeLabelSize;
|
||||||
mHintLetterSize = copyFrom.mHintLetterSize;
|
mHintLetterSize = copyFrom.mHintLetterSize;
|
||||||
mShiftedLetterHintSize = copyFrom.mShiftedLetterHintSize;
|
mShiftedLetterHintSize = copyFrom.mShiftedLetterHintSize;
|
||||||
mHintLabelSize = copyFrom.mHintLabelSize;
|
mHintLabelSize = copyFrom.mHintLabelSize;
|
||||||
|
@ -90,6 +92,7 @@ public final class KeyDrawParams {
|
||||||
attr.mLetterSize, attr.mLetterRatio, mLetterSize);
|
attr.mLetterSize, attr.mLetterRatio, mLetterSize);
|
||||||
mLabelSize = selectTextSizeFromDimensionOrRatio(keyHeight,
|
mLabelSize = selectTextSizeFromDimensionOrRatio(keyHeight,
|
||||||
attr.mLabelSize, attr.mLabelRatio, mLabelSize);
|
attr.mLabelSize, attr.mLabelRatio, mLabelSize);
|
||||||
|
mLargeLabelSize = selectTextSize(keyHeight, attr.mLargeLabelRatio, mLargeLabelSize);
|
||||||
mLargeLetterSize = selectTextSize(keyHeight, attr.mLargeLetterRatio, mLargeLetterSize);
|
mLargeLetterSize = selectTextSize(keyHeight, attr.mLargeLetterRatio, mLargeLetterSize);
|
||||||
mHintLetterSize = selectTextSize(keyHeight, attr.mHintLetterRatio, mHintLetterSize);
|
mHintLetterSize = selectTextSize(keyHeight, attr.mHintLetterRatio, mHintLetterSize);
|
||||||
mShiftedLetterHintSize = selectTextSize(keyHeight,
|
mShiftedLetterHintSize = selectTextSize(keyHeight,
|
||||||
|
|
|
@ -31,6 +31,7 @@ public final class KeyVisualAttributes {
|
||||||
public final float mLabelRatio;
|
public final float mLabelRatio;
|
||||||
public final int mLabelSize;
|
public final int mLabelSize;
|
||||||
public final float mLargeLetterRatio;
|
public final float mLargeLetterRatio;
|
||||||
|
public final float mLargeLabelRatio;
|
||||||
public final float mHintLetterRatio;
|
public final float mHintLetterRatio;
|
||||||
public final float mShiftedLetterHintRatio;
|
public final float mShiftedLetterHintRatio;
|
||||||
public final float mHintLabelRatio;
|
public final float mHintLabelRatio;
|
||||||
|
@ -55,6 +56,7 @@ public final class KeyVisualAttributes {
|
||||||
R.styleable.Keyboard_Key_keyLetterSize,
|
R.styleable.Keyboard_Key_keyLetterSize,
|
||||||
R.styleable.Keyboard_Key_keyLabelSize,
|
R.styleable.Keyboard_Key_keyLabelSize,
|
||||||
R.styleable.Keyboard_Key_keyLargeLetterRatio,
|
R.styleable.Keyboard_Key_keyLargeLetterRatio,
|
||||||
|
R.styleable.Keyboard_Key_keyLargeLabelRatio,
|
||||||
R.styleable.Keyboard_Key_keyHintLetterRatio,
|
R.styleable.Keyboard_Key_keyHintLetterRatio,
|
||||||
R.styleable.Keyboard_Key_keyShiftedLetterHintRatio,
|
R.styleable.Keyboard_Key_keyShiftedLetterHintRatio,
|
||||||
R.styleable.Keyboard_Key_keyHintLabelRatio,
|
R.styleable.Keyboard_Key_keyHintLabelRatio,
|
||||||
|
@ -111,6 +113,8 @@ public final class KeyVisualAttributes {
|
||||||
R.styleable.Keyboard_Key_keyLabelSize);
|
R.styleable.Keyboard_Key_keyLabelSize);
|
||||||
mLargeLetterRatio = ResourceUtils.getFraction(keyAttr,
|
mLargeLetterRatio = ResourceUtils.getFraction(keyAttr,
|
||||||
R.styleable.Keyboard_Key_keyLargeLetterRatio);
|
R.styleable.Keyboard_Key_keyLargeLetterRatio);
|
||||||
|
mLargeLabelRatio = ResourceUtils.getFraction(keyAttr,
|
||||||
|
R.styleable.Keyboard_Key_keyLargeLabelRatio);
|
||||||
mHintLetterRatio = ResourceUtils.getFraction(keyAttr,
|
mHintLetterRatio = ResourceUtils.getFraction(keyAttr,
|
||||||
R.styleable.Keyboard_Key_keyHintLetterRatio);
|
R.styleable.Keyboard_Key_keyHintLetterRatio);
|
||||||
mShiftedLetterHintRatio = ResourceUtils.getFraction(keyAttr,
|
mShiftedLetterHintRatio = ResourceUtils.getFraction(keyAttr,
|
||||||
|
|
Loading…
Reference in New Issue