am 15a01d72
: Merge "Do not show key preview of settings and shortcut key" into ics-mr1
* commit '15a01d72724ce7f0a9a5814443a03b907962f3fd': Do not show key preview of settings and shortcut key
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 2.4 KiB |
|
@ -180,8 +180,6 @@
|
||||||
<attr name="iconShortcutForLabel" format="reference" />
|
<attr name="iconShortcutForLabel" format="reference" />
|
||||||
<attr name="iconShiftedShiftKey" format="reference" />
|
<attr name="iconShiftedShiftKey" format="reference" />
|
||||||
<attr name="iconPreviewTabKey" format="reference" />
|
<attr name="iconPreviewTabKey" format="reference" />
|
||||||
<attr name="iconPreviewSettingsKey" format="reference" />
|
|
||||||
<attr name="iconPreviewShortcutKey" format="reference" />
|
|
||||||
</declare-styleable>
|
</declare-styleable>
|
||||||
|
|
||||||
<declare-styleable name="Keyboard_Key">
|
<declare-styleable name="Keyboard_Key">
|
||||||
|
@ -246,8 +244,6 @@
|
||||||
<attr name="keyIconPreview" format="enum">
|
<attr name="keyIconPreview" format="enum">
|
||||||
<!-- This should be aligned with KeyboardIcons.ICON_PREVIEW_* -->
|
<!-- This should be aligned with KeyboardIcons.ICON_PREVIEW_* -->
|
||||||
<enum name="iconPreviewTabKey" value="11" />
|
<enum name="iconPreviewTabKey" value="11" />
|
||||||
<enum name="iconPreviewSettingsKey" value="12" />
|
|
||||||
<enum name="iconPreviewShortcutKey" value="13" />
|
|
||||||
</attr>
|
</attr>
|
||||||
<!-- The key style to specify a set of key attributes defined by <key_style/> -->
|
<!-- The key style to specify a set of key attributes defined by <key_style/> -->
|
||||||
<attr name="keyStyle" format="string" />
|
<attr name="keyStyle" format="string" />
|
||||||
|
|
|
@ -32,8 +32,6 @@
|
||||||
<item name="iconShortcutForLabel">@drawable/sym_bkeyboard_label_mic</item>
|
<item name="iconShortcutForLabel">@drawable/sym_bkeyboard_label_mic</item>
|
||||||
<item name="iconShiftedShiftKey">@drawable/sym_bkeyboard_shift_locked</item>
|
<item name="iconShiftedShiftKey">@drawable/sym_bkeyboard_shift_locked</item>
|
||||||
<item name="iconPreviewTabKey">@drawable/sym_keyboard_feedback_tab</item>
|
<item name="iconPreviewTabKey">@drawable/sym_keyboard_feedback_tab</item>
|
||||||
<item name="iconPreviewSettingsKey">@drawable/sym_keyboard_feedback_settings</item>
|
|
||||||
<item name="iconPreviewShortcutKey">@drawable/sym_keyboard_feedback_mic</item>
|
|
||||||
<!-- LatinKeyboard icons -->
|
<!-- LatinKeyboard icons -->
|
||||||
<item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led</item>
|
<item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led</item>
|
||||||
<item name="disabledShortcutIcon">@drawable/sym_bkeyboard_voice_off</item>
|
<item name="disabledShortcutIcon">@drawable/sym_bkeyboard_voice_off</item>
|
||||||
|
|
|
@ -31,8 +31,6 @@
|
||||||
<item name="iconShortcutForLabel">@drawable/sym_keyboard_label_mic_holo</item>
|
<item name="iconShortcutForLabel">@drawable/sym_keyboard_label_mic_holo</item>
|
||||||
<item name="iconShiftedShiftKey">@drawable/sym_keyboard_shift_locked_holo</item>
|
<item name="iconShiftedShiftKey">@drawable/sym_keyboard_shift_locked_holo</item>
|
||||||
<item name="iconPreviewTabKey">@drawable/sym_keyboard_feedback_tab</item>
|
<item name="iconPreviewTabKey">@drawable/sym_keyboard_feedback_tab</item>
|
||||||
<item name="iconPreviewSettingsKey">@drawable/sym_keyboard_feedback_settings_holo</item>
|
|
||||||
<item name="iconPreviewShortcutKey">@drawable/sym_keyboard_feedback_mic</item>
|
|
||||||
<!-- LatinKeyboard icons -->
|
<!-- LatinKeyboard icons -->
|
||||||
<item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led_holo</item>
|
<item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led_holo</item>
|
||||||
<item name="disabledShortcutIcon">@drawable/sym_keyboard_voice_off_holo</item>
|
<item name="disabledShortcutIcon">@drawable/sym_keyboard_voice_off_holo</item>
|
||||||
|
|
|
@ -28,8 +28,6 @@
|
||||||
<item name="iconShortcutForLabel">@drawable/sym_keyboard_label_mic</item>
|
<item name="iconShortcutForLabel">@drawable/sym_keyboard_label_mic</item>
|
||||||
<item name="iconShiftedShiftKey">@drawable/sym_keyboard_shift_locked</item>
|
<item name="iconShiftedShiftKey">@drawable/sym_keyboard_shift_locked</item>
|
||||||
<item name="iconPreviewTabKey">@drawable/sym_keyboard_feedback_tab</item>
|
<item name="iconPreviewTabKey">@drawable/sym_keyboard_feedback_tab</item>
|
||||||
<item name="iconPreviewSettingsKey">@drawable/sym_keyboard_feedback_settings</item>
|
|
||||||
<item name="iconPreviewShortcutKey">@drawable/sym_keyboard_feedback_mic</item>
|
|
||||||
<!-- LatinKeyboard icons -->
|
<!-- LatinKeyboard icons -->
|
||||||
<item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led</item>
|
<item name="autoCorrectionSpacebarLedIcon">@drawable/sym_keyboard_space_led</item>
|
||||||
<item name="disabledShortcutIcon">@drawable/sym_keyboard_voice_off_holo</item>
|
<item name="disabledShortcutIcon">@drawable/sym_keyboard_voice_off_holo</item>
|
||||||
|
|
|
@ -73,13 +73,11 @@
|
||||||
latin:styleName="shortcutKeyStyle"
|
latin:styleName="shortcutKeyStyle"
|
||||||
latin:code="@integer/key_shortcut"
|
latin:code="@integer/key_shortcut"
|
||||||
latin:keyIcon="iconShortcutKey"
|
latin:keyIcon="iconShortcutKey"
|
||||||
latin:keyIconPreview="iconPreviewShortcutKey"
|
|
||||||
latin:parentStyle="f2PopupStyle" />
|
latin:parentStyle="f2PopupStyle" />
|
||||||
<key-style
|
<key-style
|
||||||
latin:styleName="settingsKeyStyle"
|
latin:styleName="settingsKeyStyle"
|
||||||
latin:code="@integer/key_settings"
|
latin:code="@integer/key_settings"
|
||||||
latin:keyIcon="iconSettingsKey"
|
latin:keyIcon="iconSettingsKey"
|
||||||
latin:keyIconPreview="iconPreviewSettingsKey"
|
|
||||||
latin:backgroundType="functional" />
|
latin:backgroundType="functional" />
|
||||||
<key-style
|
<key-style
|
||||||
latin:styleName="tabKeyStyle"
|
latin:styleName="tabKeyStyle"
|
||||||
|
|
|
@ -55,13 +55,11 @@
|
||||||
latin:styleName="settingsKeyStyle"
|
latin:styleName="settingsKeyStyle"
|
||||||
latin:code="@integer/key_settings"
|
latin:code="@integer/key_settings"
|
||||||
latin:keyIcon="iconSettingsKey"
|
latin:keyIcon="iconSettingsKey"
|
||||||
latin:keyIconPreview="iconPreviewSettingsKey"
|
|
||||||
latin:backgroundType="functional" />
|
latin:backgroundType="functional" />
|
||||||
<key-style
|
<key-style
|
||||||
latin:styleName="shortcutKeyStyle"
|
latin:styleName="shortcutKeyStyle"
|
||||||
latin:code="@integer/key_shortcut"
|
latin:code="@integer/key_shortcut"
|
||||||
latin:keyIcon="iconShortcutKey"
|
latin:keyIcon="iconShortcutKey"
|
||||||
latin:keyIconPreview="iconPreviewShortcutKey"
|
|
||||||
latin:backgroundType="functional" />
|
latin:backgroundType="functional" />
|
||||||
<key-style
|
<key-style
|
||||||
latin:styleName="tabKeyStyle"
|
latin:styleName="tabKeyStyle"
|
||||||
|
|
|
@ -154,13 +154,11 @@
|
||||||
latin:styleName="shortcutKeyStyle"
|
latin:styleName="shortcutKeyStyle"
|
||||||
latin:code="@integer/key_shortcut"
|
latin:code="@integer/key_shortcut"
|
||||||
latin:keyIcon="iconShortcutKey"
|
latin:keyIcon="iconShortcutKey"
|
||||||
latin:keyIconPreview="iconPreviewShortcutKey"
|
|
||||||
latin:parentStyle="f1PopupStyle" />
|
latin:parentStyle="f1PopupStyle" />
|
||||||
<key-style
|
<key-style
|
||||||
latin:styleName="settingsKeyStyle"
|
latin:styleName="settingsKeyStyle"
|
||||||
latin:code="@integer/key_settings"
|
latin:code="@integer/key_settings"
|
||||||
latin:keyIcon="iconSettingsKey"
|
latin:keyIcon="iconSettingsKey"
|
||||||
latin:keyIconPreview="iconPreviewSettingsKey"
|
|
||||||
latin:backgroundType="functional" />
|
latin:backgroundType="functional" />
|
||||||
<key-style
|
<key-style
|
||||||
latin:styleName="tabKeyStyle"
|
latin:styleName="tabKeyStyle"
|
||||||
|
|
|
@ -354,9 +354,12 @@ public class PointerTracker {
|
||||||
// The modifier key, such as shift key, should not show its key preview.
|
// The modifier key, such as shift key, should not show its key preview.
|
||||||
private static boolean isKeyPreviewRequired(Key key) {
|
private static boolean isKeyPreviewRequired(Key key) {
|
||||||
final int code = key.mCode;
|
final int code = key.mCode;
|
||||||
if (isModifierCode(code) || code == Keyboard.CODE_DELETE
|
// TODO: Stop hard-coding these key codes here, and add a new key attribute of a key.
|
||||||
|| code == Keyboard.CODE_ENTER || code == Keyboard.CODE_SPACE)
|
if (code == Keyboard.CODE_SPACE || code == Keyboard.CODE_ENTER
|
||||||
|
|| code == Keyboard.CODE_DELETE || isModifierCode(code)
|
||||||
|
|| code == Keyboard.CODE_SETTINGS || code == Keyboard.CODE_SHORTCUT) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,10 +42,8 @@ public class KeyboardIconsSet {
|
||||||
private static final int ICON_SHIFTED_SHIFT_KEY = 10;
|
private static final int ICON_SHIFTED_SHIFT_KEY = 10;
|
||||||
// This should be aligned with Keyboard.keyIconPreview enum.
|
// This should be aligned with Keyboard.keyIconPreview enum.
|
||||||
private static final int ICON_PREVIEW_TAB_KEY = 11;
|
private static final int ICON_PREVIEW_TAB_KEY = 11;
|
||||||
private static final int ICON_PREVIEW_SETTINGS_KEY = 12;
|
|
||||||
private static final int ICON_PREVIEW_SHORTCUT_KEY = 13;
|
|
||||||
|
|
||||||
private static final int ICON_LAST = 13;
|
private static final int ICON_LAST = 11;
|
||||||
|
|
||||||
private final Drawable mIcons[] = new Drawable[ICON_LAST + 1];
|
private final Drawable mIcons[] = new Drawable[ICON_LAST + 1];
|
||||||
|
|
||||||
|
@ -73,10 +71,6 @@ public class KeyboardIconsSet {
|
||||||
return ICON_SHIFTED_SHIFT_KEY;
|
return ICON_SHIFTED_SHIFT_KEY;
|
||||||
case R.styleable.Keyboard_iconPreviewTabKey:
|
case R.styleable.Keyboard_iconPreviewTabKey:
|
||||||
return ICON_PREVIEW_TAB_KEY;
|
return ICON_PREVIEW_TAB_KEY;
|
||||||
case R.styleable.Keyboard_iconPreviewSettingsKey:
|
|
||||||
return ICON_PREVIEW_SETTINGS_KEY;
|
|
||||||
case R.styleable.Keyboard_iconPreviewShortcutKey:
|
|
||||||
return ICON_PREVIEW_SHORTCUT_KEY;
|
|
||||||
default:
|
default:
|
||||||
return ICON_UNDEFINED;
|
return ICON_UNDEFINED;
|
||||||
}
|
}
|
||||||
|
|