aboutsummaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-07-31 18:34:54 -0700
committerTadashi G. Takaoka <takaoka@google.com>2011-07-31 18:46:44 -0700
commitc3afe2c244c14ed0f8a355fe608b3402e3656330 (patch)
treec63b2a76417c1ad137604913d6fee2c663feda5d /java
parent6a07d7ddd974ef6c780fbc5835913c0afadb6aae (diff)
downloadlatinime-c3afe2c244c14ed0f8a355fe608b3402e3656330.tar.gz
latinime-c3afe2c244c14ed0f8a355fe608b3402e3656330.tar.xz
latinime-c3afe2c244c14ed0f8a355fe608b3402e3656330.zip
Replace the notion of "voice" with "shortcut" as many as possible
Bug: 4340933 Change-Id: I98b4eca5167cc3767a0868fae8f6436164adbe4d
Diffstat (limited to 'java')
-rw-r--r--java/res/values/attrs.xml4
-rw-r--r--java/res/xml-sw600dp/kbd_qwerty_f2.xml8
-rw-r--r--java/res/xml-sw768dp/kbd_number.xml2
-rw-r--r--java/res/xml-sw768dp/kbd_phone.xml2
-rw-r--r--java/res/xml-sw768dp/kbd_phone_shift.xml2
-rw-r--r--java/res/xml-sw768dp/kbd_qwerty_row4.xml2
-rw-r--r--java/res/xml-sw768dp/kbd_rows_symbols.xml2
-rw-r--r--java/res/xml-sw768dp/kbd_rows_symbols_shift.xml2
-rw-r--r--java/res/xml/kbd_key_styles.xml9
-rw-r--r--java/res/xml/kbd_qwerty_f1.xml8
-rw-r--r--java/res/xml/kbd_symbols_f1.xml8
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardId.java25
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java4
-rw-r--r--java/src/com/android/inputmethod/keyboard/internal/KeyboardParser.java15
14 files changed, 48 insertions, 45 deletions
diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml
index e503d98a4..af7484fa8 100644
--- a/java/res/values/attrs.xml
+++ b/java/res/values/attrs.xml
@@ -266,8 +266,8 @@
<enum name="shortcutImeOrSettings" value="3" />
</attr>
<attr name="clobberSettingsKey" format="boolean" />
- <attr name="voiceKeyEnabled" format="boolean" />
- <attr name="hasVoiceKey" format="boolean" />
+ <attr name="shortcutKeyEnabled" format="boolean" />
+ <attr name="hasShortcutKey" format="boolean" />
<attr name="imeAction" format="enum">
<!-- This should be aligned with EditorInfo.IME_ACTION_* -->
<enum name="actionUnspecified" value="0" />
diff --git a/java/res/xml-sw600dp/kbd_qwerty_f2.xml b/java/res/xml-sw600dp/kbd_qwerty_f2.xml
index 3ea11805f..b25afc12f 100644
--- a/java/res/xml-sw600dp/kbd_qwerty_f2.xml
+++ b/java/res/xml-sw600dp/kbd_qwerty_f2.xml
@@ -34,13 +34,13 @@
>
<switch>
<case
- latin:voiceKeyEnabled="true"
+ latin:shortcutKeyEnabled="true"
>
<Key
latin:keyStyle="shortcutKeyStyle"
latin:keyWidth="fillBoth" />
</case>
- <!-- voiceKeyEnabled="false" -->
+ <!-- shortcutKeyEnabled="false" -->
<default>
<Spacer />
</default>
@@ -51,13 +51,13 @@
>
<switch>
<case
- latin:voiceKeyEnabled="true"
+ latin:shortcutKeyEnabled="true"
>
<Key
latin:keyStyle="shortcutKeyStyle"
latin:keyWidth="fillBoth" />
</case>
- <!-- voiceKeyEnabled="false" -->
+ <!-- shortcutKeyEnabled="false" -->
<default>
<Key
latin:keyStyle="settingsKeyStyle"
diff --git a/java/res/xml-sw768dp/kbd_number.xml b/java/res/xml-sw768dp/kbd_number.xml
index 1706eaac2..369e91a77 100644
--- a/java/res/xml-sw768dp/kbd_number.xml
+++ b/java/res/xml-sw768dp/kbd_number.xml
@@ -209,7 +209,7 @@
latin:keyStyle="numKeyStyle" />
<switch>
<case
- latin:voiceKeyEnabled="true"
+ latin:shortcutKeyEnabled="true"
>
<Key
latin:keyStyle="shortcutKeyStyle"
diff --git a/java/res/xml-sw768dp/kbd_phone.xml b/java/res/xml-sw768dp/kbd_phone.xml
index 945b641ea..cf6790f79 100644
--- a/java/res/xml-sw768dp/kbd_phone.xml
+++ b/java/res/xml-sw768dp/kbd_phone.xml
@@ -127,7 +127,7 @@
latin:keyStyle="numKeyStyle" />
<switch>
<case
- latin:voiceKeyEnabled="true"
+ latin:shortcutKeyEnabled="true"
>
<Key
latin:keyStyle="shortcutKeyStyle"
diff --git a/java/res/xml-sw768dp/kbd_phone_shift.xml b/java/res/xml-sw768dp/kbd_phone_shift.xml
index 693400e67..7f6271628 100644
--- a/java/res/xml-sw768dp/kbd_phone_shift.xml
+++ b/java/res/xml-sw768dp/kbd_phone_shift.xml
@@ -139,7 +139,7 @@
latin:keyStyle="numKeyStyle" />
<switch>
<case
- latin:voiceKeyEnabled="true"
+ latin:shortcutKeyEnabled="true"
>
<Key
latin:keyStyle="shortcutKeyStyle"
diff --git a/java/res/xml-sw768dp/kbd_qwerty_row4.xml b/java/res/xml-sw768dp/kbd_qwerty_row4.xml
index d463de9a6..1ff9d81f1 100644
--- a/java/res/xml-sw768dp/kbd_qwerty_row4.xml
+++ b/java/res/xml-sw768dp/kbd_qwerty_row4.xml
@@ -101,7 +101,7 @@
</switch>
<switch>
<case
- latin:voiceKeyEnabled="true"
+ latin:shortcutKeyEnabled="true"
>
<Key
latin:keyStyle="shortcutKeyStyle"
diff --git a/java/res/xml-sw768dp/kbd_rows_symbols.xml b/java/res/xml-sw768dp/kbd_rows_symbols.xml
index 1d5bd9d15..96caf1988 100644
--- a/java/res/xml-sw768dp/kbd_rows_symbols.xml
+++ b/java/res/xml-sw768dp/kbd_rows_symbols.xml
@@ -180,7 +180,7 @@
latin:keyLabel="_" />
<switch>
<case
- latin:voiceKeyEnabled="true"
+ latin:shortcutKeyEnabled="true"
>
<Key
latin:keyStyle="shortcutKeyStyle"
diff --git a/java/res/xml-sw768dp/kbd_rows_symbols_shift.xml b/java/res/xml-sw768dp/kbd_rows_symbols_shift.xml
index 2219bdc92..5c120827f 100644
--- a/java/res/xml-sw768dp/kbd_rows_symbols_shift.xml
+++ b/java/res/xml-sw768dp/kbd_rows_symbols_shift.xml
@@ -155,7 +155,7 @@
latin:keyWidth="37.500%p" />
<switch>
<case
- latin:voiceKeyEnabled="true"
+ latin:shortcutKeyEnabled="true"
>
<Key
latin:keyStyle="shortcutKeyStyle"
diff --git a/java/res/xml/kbd_key_styles.xml b/java/res/xml/kbd_key_styles.xml
index 6436b27f0..f02efcd27 100644
--- a/java/res/xml/kbd_key_styles.xml
+++ b/java/res/xml/kbd_key_styles.xml
@@ -169,11 +169,12 @@
latin:keyIcon="iconTabKey"
latin:keyIconPreview="iconPreviewTabKey" />
<switch>
- <!-- When this qwerty keyboard has no voice key but voice key is enabled, then symbol
- keyboard will have mic key. That means we should use "?123mic" key here. -->
+ <!-- When this qwerty keyboard has no shortcut keys but shortcut key is enabled, then symbol
+ keyboard will have a shortcut key. That means we should use
+ iconToSymbolKeyWithShortcutKey here. -->
<case
- latin:voiceKeyEnabled="true"
- latin:hasVoiceKey="false"
+ latin:shortcutKeyEnabled="true"
+ latin:hasShortcutKey="false"
>
<key-style
latin:styleName="toSymbolKeyStyle"
diff --git a/java/res/xml/kbd_qwerty_f1.xml b/java/res/xml/kbd_qwerty_f1.xml
index 1546f49c9..5463804bf 100644
--- a/java/res/xml/kbd_qwerty_f1.xml
+++ b/java/res/xml/kbd_qwerty_f1.xml
@@ -45,13 +45,13 @@
<default>
<switch>
<case
- latin:hasVoiceKey="true"
+ latin:hasShortcutKey="true"
>
<Key
latin:keyStyle="shortcutKeyStyle"
latin:keyWidth="9.2%p" />
</case>
- <!-- latin:hasVoiceKey="false" -->
+ <!-- latin:hasShortcutKey="false" -->
<case
latin:navigateAction="true"
>
@@ -90,12 +90,12 @@
<default>
<switch>
<case
- latin:hasVoiceKey="true"
+ latin:hasShortcutKey="true"
>
<Key
latin:keyStyle="shortcutKeyStyle" />
</case>
- <!-- latin:hasVoiceKey="false" -->
+ <!-- latin:hasShortcutKey="false" -->
<case
latin:navigateAction="true"
>
diff --git a/java/res/xml/kbd_symbols_f1.xml b/java/res/xml/kbd_symbols_f1.xml
index cebb4f0b2..8c9bea5e2 100644
--- a/java/res/xml/kbd_symbols_f1.xml
+++ b/java/res/xml/kbd_symbols_f1.xml
@@ -27,13 +27,13 @@
>
<switch>
<case
- latin:hasVoiceKey="true"
+ latin:hasShortcutKey="true"
>
<Key
latin:keyStyle="shortcutKeyStyle"
latin:keyWidth="9.2%p" />
</case>
- <!-- latin:hasVoiceKey="false" -->
+ <!-- latin:hasShortcutKey="false" -->
<default>
<Key
latin:keyLabel="@string/keylabel_for_symbols_f1"
@@ -46,12 +46,12 @@
<default>
<switch>
<case
- latin:hasVoiceKey="true"
+ latin:hasShortcutKey="true"
>
<Key
latin:keyStyle="shortcutKeyStyle" />
</case>
- <!-- latin:hasVoiceKey="false" -->
+ <!-- latin:hasShortcutKey="false" -->
<default>
<Key
latin:keyLabel="@string/keylabel_for_symbols_f1"
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardId.java b/java/src/com/android/inputmethod/keyboard/KeyboardId.java
index c3f4d0aa2..9299c6c58 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardId.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardId.java
@@ -55,8 +55,8 @@ public class KeyboardId {
public final boolean mHasSettingsKey;
public final int mF2KeyMode;
public final boolean mClobberSettingsKey;
- public final boolean mVoiceKeyEnabled;
- public final boolean mHasVoiceKey;
+ public final boolean mShortcutKeyEnabled;
+ public final boolean mHasShortcutKey;
public final int mImeAction;
public final String mXmlName;
@@ -66,7 +66,7 @@ public class KeyboardId {
public KeyboardId(String xmlName, int xmlId, Locale locale, int orientation, int width,
int mode, EditorInfo attribute, boolean hasSettingsKey, int f2KeyMode,
- boolean clobberSettingsKey, boolean voiceKeyEnabled, boolean hasVoiceKey) {
+ boolean clobberSettingsKey, boolean shortcutKeyEnabled, boolean hasShortcutKey) {
final int inputType = (attribute != null) ? attribute.inputType : 0;
final int imeOptions = (attribute != null) ? attribute.imeOptions : 0;
this.mLocale = locale;
@@ -83,8 +83,8 @@ public class KeyboardId {
this.mHasSettingsKey = hasSettingsKey;
this.mF2KeyMode = f2KeyMode;
this.mClobberSettingsKey = clobberSettingsKey;
- this.mVoiceKeyEnabled = voiceKeyEnabled;
- this.mHasVoiceKey = hasVoiceKey;
+ this.mShortcutKeyEnabled = shortcutKeyEnabled;
+ this.mHasShortcutKey = hasShortcutKey;
// We are interested only in {@link EditorInfo#IME_MASK_ACTION} enum value and
// {@link EditorInfo#IME_FLAG_NO_ENTER_ACTION}.
this.mImeAction = imeOptions & (
@@ -104,8 +104,8 @@ public class KeyboardId {
hasSettingsKey,
f2KeyMode,
clobberSettingsKey,
- voiceKeyEnabled,
- hasVoiceKey,
+ shortcutKeyEnabled,
+ hasShortcutKey,
mImeAction,
});
}
@@ -119,7 +119,8 @@ public class KeyboardId {
if (mWidth == width)
return this;
return new KeyboardId(mXmlName, mXmlId, mLocale, orientation, width, mMode, mAttribute,
- mHasSettingsKey, mF2KeyMode, mClobberSettingsKey, mVoiceKeyEnabled, mHasVoiceKey);
+ mHasSettingsKey, mF2KeyMode, mClobberSettingsKey, mShortcutKeyEnabled,
+ mHasShortcutKey);
}
public int getXmlId() {
@@ -166,8 +167,8 @@ public class KeyboardId {
&& other.mHasSettingsKey == this.mHasSettingsKey
&& other.mF2KeyMode == this.mF2KeyMode
&& other.mClobberSettingsKey == this.mClobberSettingsKey
- && other.mVoiceKeyEnabled == this.mVoiceKeyEnabled
- && other.mHasVoiceKey == this.mHasVoiceKey
+ && other.mShortcutKeyEnabled == this.mShortcutKeyEnabled
+ && other.mHasShortcutKey == this.mHasShortcutKey
&& other.mImeAction == this.mImeAction;
}
@@ -189,8 +190,8 @@ public class KeyboardId {
(mNavigateAction ? " navigateAction" : ""),
(mPasswordInput ? " passwordInput" : ""),
(mHasSettingsKey ? " hasSettingsKey" : ""),
- (mVoiceKeyEnabled ? " voiceKeyEnabled" : ""),
- (mHasVoiceKey ? " hasVoiceKey" : "")
+ (mShortcutKeyEnabled ? " shortcutKeyEnabled" : ""),
+ (mHasShortcutKey ? " hasShortcutKey" : "")
);
}
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index 28c91b848..17fdd0cc4 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -324,13 +324,13 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
mPackageName, LatinIME.IME_OPTION_NO_SETTINGS_KEY, editorInfo);
final boolean hasSettingsKey = settingsKeyEnabled && !noSettingsKey;
final int f2KeyMode = getF2KeyMode(settingsKeyEnabled, noSettingsKey);
- final boolean hasVoiceKey = voiceKeyEnabled && (isSymbols != voiceKeyOnMain);
+ final boolean hasShortcutKey = voiceKeyEnabled && (isSymbols != voiceKeyOnMain);
final Configuration conf = mResources.getConfiguration();
return new KeyboardId(
mResources.getResourceEntryName(xmlId), xmlId, mSubtypeSwitcher.getInputLocale(),
conf.orientation, mWindowWidthCache.getWidth(conf), mode, editorInfo,
- hasSettingsKey, f2KeyMode, noSettingsKey, voiceKeyEnabled, hasVoiceKey);
+ hasSettingsKey, f2KeyMode, noSettingsKey, voiceKeyEnabled, hasShortcutKey);
}
public int getKeyboardMode() {
diff --git a/java/src/com/android/inputmethod/keyboard/internal/KeyboardParser.java b/java/src/com/android/inputmethod/keyboard/internal/KeyboardParser.java
index 6a83b3d99..f6f46750c 100644
--- a/java/src/com/android/inputmethod/keyboard/internal/KeyboardParser.java
+++ b/java/src/com/android/inputmethod/keyboard/internal/KeyboardParser.java
@@ -494,10 +494,10 @@ public class KeyboardParser {
R.styleable.Keyboard_Case_f2KeyMode, id.mF2KeyMode);
final boolean clobberSettingsKeyMatched = matchBoolean(a,
R.styleable.Keyboard_Case_clobberSettingsKey, id.mClobberSettingsKey);
- final boolean voiceEnabledMatched = matchBoolean(a,
- R.styleable.Keyboard_Case_voiceKeyEnabled, id.mVoiceKeyEnabled);
- final boolean voiceKeyMatched = matchBoolean(a,
- R.styleable.Keyboard_Case_hasVoiceKey, id.mHasVoiceKey);
+ final boolean shortcutKeyEnabledMatched = matchBoolean(a,
+ R.styleable.Keyboard_Case_shortcutKeyEnabled, id.mShortcutKeyEnabled);
+ final boolean hasShortcutKeyMatched = matchBoolean(a,
+ R.styleable.Keyboard_Case_hasShortcutKey, id.mHasShortcutKey);
// As noted at {@link KeyboardId} class, we are interested only in enum value masked by
// {@link android.view.inputmethod.EditorInfo#IME_MASK_ACTION} and
// {@link android.view.inputmethod.EditorInfo#IME_FLAG_NO_ENTER_ACTION}. So matching
@@ -512,7 +512,7 @@ public class KeyboardParser {
R.styleable.Keyboard_Case_countryCode, id.mLocale.getCountry());
final boolean selected = modeMatched && navigateActionMatched && passwordInputMatched
&& hasSettingsKeyMatched && f2KeyModeMatched && clobberSettingsKeyMatched
- && voiceEnabledMatched && voiceKeyMatched && imeActionMatched &&
+ && shortcutKeyEnabledMatched && hasShortcutKeyMatched && imeActionMatched &&
localeCodeMatched && languageCodeMatched && countryCodeMatched;
if (DEBUG) Log.d(TAG, String.format("<%s%s%s%s%s%s%s%s%s%s%s%s%s> %s", TAG_CASE,
@@ -524,8 +524,9 @@ public class KeyboardParser {
a.getInt(R.styleable.Keyboard_Case_f2KeyMode, -1)), "f2KeyMode"),
booleanAttr(a, R.styleable.Keyboard_Case_clobberSettingsKey,
"clobberSettingsKey"),
- booleanAttr(a, R.styleable.Keyboard_Case_voiceKeyEnabled, "voiceKeyEnabled"),
- booleanAttr(a, R.styleable.Keyboard_Case_hasVoiceKey, "hasVoiceKey"),
+ booleanAttr(
+ a, R.styleable.Keyboard_Case_shortcutKeyEnabled, "shortcutKeyEnabled"),
+ booleanAttr(a, R.styleable.Keyboard_Case_hasShortcutKey, "hasShortcutKey"),
textAttr(EditorInfoCompatUtils.imeOptionsName(
a.getInt(R.styleable.Keyboard_Case_imeAction, -1)), "imeAction"),
textAttr(a.getString(R.styleable.Keyboard_Case_localeCode), "localeCode"),