Fix voice key on phone device
This change, - changes voice key code back to -102 - renames some key code names and method names - adds mic_slash_holo to drawable-hdpi Change-Id: I8be3a20921f472ece4298edad2d275f29a7e4955main
parent
cfb24365f9
commit
e18bd3e323
Binary file not shown.
After Width: | Height: | Size: 4.2 KiB |
|
@ -19,13 +19,13 @@
|
|||
-->
|
||||
|
||||
<resources>
|
||||
<!-- These code should be aligned with Keyboard.CODE_*. -->
|
||||
<integer name="key_tab">9</integer>
|
||||
<integer name="key_return">10</integer>
|
||||
<integer name="key_space">32</integer>
|
||||
<integer name="key_shift">-1</integer>
|
||||
<integer name="key_switch_alpha_symbol">-2</integer>
|
||||
<integer name="key_delete">-5</integer>
|
||||
<!-- Keycode for F1 (function) key. This one switches between language switch & comma/.com -->
|
||||
<integer name="key_settings">-100</integer>
|
||||
<integer name="key_voice">-102</integer>
|
||||
</resources>
|
||||
|
|
|
@ -410,7 +410,7 @@
|
|||
<string name="subtype_mode_sr_keyboard">Serbian Keyboard</string>
|
||||
<string name="subtype_mode_sv_keyboard">Swedish Keyboard</string>
|
||||
|
||||
<string name="subtype_mode_cs_voice">Czech Voice</string>
|
||||
<string name="subtype_mode_cs_voice">Czech Voice</string>
|
||||
<string name="subtype_mode_de_voice">German Voice</string>
|
||||
<string name="subtype_mode_en_AU_voice">English (Australia) Voice</string>
|
||||
<string name="subtype_mode_en_GB_voice">English (Great Britain) Voice</string>
|
||||
|
|
|
@ -59,25 +59,26 @@ public class Keyboard {
|
|||
public static final int EDGE_TOP = 0x04;
|
||||
public static final int EDGE_BOTTOM = 0x08;
|
||||
|
||||
/** Some common keys code. These should be aligned with values/keycodes.xml */
|
||||
public static final int CODE_ENTER = '\n';
|
||||
public static final int CODE_TAB = '\t';
|
||||
public static final int CODE_SPACE = ' ';
|
||||
public static final int CODE_PERIOD = '.';
|
||||
|
||||
/** Special keys code. These should be aligned with values/keycodes.xml */
|
||||
public static final int CODE_SHIFT = -1;
|
||||
public static final int CODE_MODE_CHANGE = -2;
|
||||
public static final int CODE_SWITCH_ALPHA_SYMBOL = -2;
|
||||
public static final int CODE_CANCEL = -3;
|
||||
public static final int CODE_DONE = -4;
|
||||
public static final int CODE_DELETE = -5;
|
||||
public static final int CODE_ALT = -6;
|
||||
|
||||
public static final int CODE_OPTIONS = -100;
|
||||
public static final int CODE_OPTIONS_LONGPRESS = -101;
|
||||
public static final int CODE_SETTINGS = -100;
|
||||
public static final int CODE_SETTINGS_LONGPRESS = -101;
|
||||
// TODO: remove this once LatinIME stops referring to this.
|
||||
public static final int CODE_VOICE = -102;
|
||||
public static final int CODE_CAPSLOCK = -103;
|
||||
public static final int CODE_NEXT_LANGUAGE = -104;
|
||||
public static final int CODE_PREV_LANGUAGE = -105;
|
||||
// TODO: remove this once LatinIME stops referring to this.
|
||||
public static final int CODE_VOICE = -109;
|
||||
|
||||
/** Horizontal gap default for all rows */
|
||||
private int mDefaultHorizontalGap;
|
||||
|
|
|
@ -88,8 +88,8 @@ public class LatinKeyboardView extends KeyboardView {
|
|||
@Override
|
||||
protected boolean onLongPress(Key key) {
|
||||
int primaryCode = key.mCodes[0];
|
||||
if (primaryCode == Keyboard.CODE_OPTIONS) {
|
||||
return invokeOnKey(Keyboard.CODE_OPTIONS_LONGPRESS);
|
||||
if (primaryCode == Keyboard.CODE_SETTINGS) {
|
||||
return invokeOnKey(Keyboard.CODE_SETTINGS_LONGPRESS);
|
||||
} else if (primaryCode == '0' && getLatinKeyboard().isPhoneKeyboard()) {
|
||||
// Long pressing on 0 in phone number keypad gives you a '+'.
|
||||
return invokeOnKey('+');
|
||||
|
|
|
@ -208,7 +208,7 @@ public class PointerTracker {
|
|||
return false;
|
||||
int primaryCode = key.mCodes[0];
|
||||
return primaryCode == Keyboard.CODE_SHIFT
|
||||
|| primaryCode == Keyboard.CODE_MODE_CHANGE;
|
||||
|| primaryCode == Keyboard.CODE_SWITCH_ALPHA_SYMBOL;
|
||||
}
|
||||
|
||||
public boolean isModifier() {
|
||||
|
|
|
@ -1050,7 +1050,7 @@ public class LatinIME extends InputMethodService
|
|||
}
|
||||
}
|
||||
|
||||
private void onOptionKeyPressed() {
|
||||
private void onSettingsKeyPressed() {
|
||||
if (!isShowingOptionDialog()) {
|
||||
if (LatinIMEUtil.hasMultipleEnabledIMEsOrSubtypes(mImm)) {
|
||||
showOptionsMenu();
|
||||
|
@ -1060,7 +1060,7 @@ public class LatinIME extends InputMethodService
|
|||
}
|
||||
}
|
||||
|
||||
private void onOptionKeyLongPressed() {
|
||||
private void onSettingsKeyLongPressed() {
|
||||
if (!isShowingOptionDialog()) {
|
||||
if (LatinIMEUtil.hasMultipleEnabledIMEsOrSubtypes(mImm)) {
|
||||
mImm.showInputMethodPicker();
|
||||
|
@ -1096,7 +1096,7 @@ public class LatinIME extends InputMethodService
|
|||
if (!distinctMultiTouch)
|
||||
switcher.toggleShift();
|
||||
break;
|
||||
case Keyboard.CODE_MODE_CHANGE:
|
||||
case Keyboard.CODE_SWITCH_ALPHA_SYMBOL:
|
||||
// Symbol key is handled in onPress() when device has distinct multi-touch panel.
|
||||
if (!distinctMultiTouch)
|
||||
switcher.changeKeyboardMode();
|
||||
|
@ -1106,11 +1106,11 @@ public class LatinIME extends InputMethodService
|
|||
handleClose();
|
||||
}
|
||||
break;
|
||||
case Keyboard.CODE_OPTIONS:
|
||||
onOptionKeyPressed();
|
||||
case Keyboard.CODE_SETTINGS:
|
||||
onSettingsKeyPressed();
|
||||
break;
|
||||
case Keyboard.CODE_OPTIONS_LONGPRESS:
|
||||
onOptionKeyLongPressed();
|
||||
case Keyboard.CODE_SETTINGS_LONGPRESS:
|
||||
onSettingsKeyLongPressed();
|
||||
break;
|
||||
case Keyboard.CODE_NEXT_LANGUAGE:
|
||||
toggleLanguage(false, true);
|
||||
|
@ -1929,7 +1929,7 @@ public class LatinIME extends InputMethodService
|
|||
final boolean distinctMultiTouch = switcher.hasDistinctMultitouch();
|
||||
if (distinctMultiTouch && primaryCode == Keyboard.CODE_SHIFT) {
|
||||
switcher.onPressShift();
|
||||
} else if (distinctMultiTouch && primaryCode == Keyboard.CODE_MODE_CHANGE) {
|
||||
} else if (distinctMultiTouch && primaryCode == Keyboard.CODE_SWITCH_ALPHA_SYMBOL) {
|
||||
switcher.onPressSymbol();
|
||||
} else {
|
||||
switcher.onOtherKeyPressed();
|
||||
|
@ -1944,7 +1944,7 @@ public class LatinIME extends InputMethodService
|
|||
final boolean distinctMultiTouch = switcher.hasDistinctMultitouch();
|
||||
if (distinctMultiTouch && primaryCode == Keyboard.CODE_SHIFT) {
|
||||
switcher.onReleaseShift();
|
||||
} else if (distinctMultiTouch && primaryCode == Keyboard.CODE_MODE_CHANGE) {
|
||||
} else if (distinctMultiTouch && primaryCode == Keyboard.CODE_SWITCH_ALPHA_SYMBOL) {
|
||||
switcher.onReleaseSymbol();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue