Remove voice key from keyboard layout
Bug: 14419121
Change-Id: I71031f1ed9735a5a05dc584299b56512fb0b6866
diff --git a/java/res/xml-sw600dp/key_settings.xml b/java/res/xml-sw600dp/key_settings.xml
new file mode 100644
index 0000000..45915e9
--- /dev/null
+++ b/java/res/xml-sw600dp/key_settings.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+**
+** Copyright 2014, The Android Open Source Project
+**
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
+**
+** http://www.apache.org/licenses/LICENSE-2.0
+**
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
+** limitations under the License.
+*/
+-->
+
+<merge
+ xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
+>
+ <switch>
+ <case
+ latin:clobberSettingsKey="false"
+ >
+ <Key
+ latin:keyStyle="settingsKeyStyle" />
+ </case>
+ <!-- clobberSettingsKey="true" -->
+ <default>
+ <Spacer />
+ </default>
+ </switch>
+</merge>
diff --git a/java/res/xml-sw600dp/key_shortcut.xml b/java/res/xml-sw600dp/key_shortcut.xml
deleted file mode 100644
index d24e81f..0000000
--- a/java/res/xml-sw600dp/key_shortcut.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-/*
-**
-** Copyright 2012, The Android Open Source Project
-**
-** Licensed under the Apache License, Version 2.0 (the "License");
-** you may not use this file except in compliance with the License.
-** You may obtain a copy of the License at
-**
-** http://www.apache.org/licenses/LICENSE-2.0
-**
-** Unless required by applicable law or agreed to in writing, software
-** distributed under the License is distributed on an "AS IS" BASIS,
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-** See the License for the specific language governing permissions and
-** limitations under the License.
-*/
--->
-
-<merge
- xmlns:latin="http://schemas.android.com/apk/res/com.android.inputmethod.latin"
->
- <switch>
- <case
- latin:supportsSwitchingToShortcutIme="true"
- latin:clobberSettingsKey="false"
- >
- <Key
- latin:keyStyle="shortcutKeyStyle"
- latin:keyLabelFlags="hasPopupHint|preserveCase"
- latin:moreKeys="!text/keyspec_settings" />
- </case>
- <case
- latin:supportsSwitchingToShortcutIme="true"
- latin:clobberSettingsKey="true"
- >
- <Key
- latin:keyStyle="shortcutKeyStyle" />
- </case>
- <case
- latin:supportsSwitchingToShortcutIme="false"
- latin:clobberSettingsKey="false"
- >
- <Key
- latin:keyStyle="settingsKeyStyle" />
- </case>
- <!-- supportsSwitchingToShortcutIme="false" clobberSettingsKey="true" -->
- <default>
- <Spacer />
- </default>
- </switch>
-</merge>
diff --git a/java/res/xml-sw600dp/row_dvorak4.xml b/java/res/xml-sw600dp/row_dvorak4.xml
index 2ba6a49..d3709ef 100644
--- a/java/res/xml-sw600dp/row_dvorak4.xml
+++ b/java/res/xml-sw600dp/row_dvorak4.xml
@@ -29,7 +29,7 @@
latin:keyStyle="toSymbolKeyStyle"
latin:keyWidth="10.0%p" />
<include
- latin:keyboardLayout="@xml/key_shortcut" />
+ latin:keyboardLayout="@xml/key_settings" />
<include
latin:keyboardLayout="@xml/key_f1" />
<include
diff --git a/java/res/xml-sw600dp/row_pcqwerty5.xml b/java/res/xml-sw600dp/row_pcqwerty5.xml
index 52b581a..ac07f11 100644
--- a/java/res/xml-sw600dp/row_pcqwerty5.xml
+++ b/java/res/xml-sw600dp/row_pcqwerty5.xml
@@ -26,7 +26,7 @@
>
<include
latin:keyWidth="9.0%p"
- latin:keyboardLayout="@xml/key_shortcut" />
+ latin:keyboardLayout="@xml/key_settings" />
<switch>
<case
latin:languageSwitchKeyEnabled="true"
diff --git a/java/res/xml-sw600dp/row_qwerty4.xml b/java/res/xml-sw600dp/row_qwerty4.xml
index 7969dd8..d931437 100644
--- a/java/res/xml-sw600dp/row_qwerty4.xml
+++ b/java/res/xml-sw600dp/row_qwerty4.xml
@@ -29,7 +29,7 @@
latin:keyStyle="toSymbolKeyStyle"
latin:keyWidth="10.0%p" />
<include
- latin:keyboardLayout="@xml/key_shortcut" />
+ latin:keyboardLayout="@xml/key_settings" />
<include
latin:keyboardLayout="@xml/key_f1" />
<include
diff --git a/java/res/xml/key_f1.xml b/java/res/xml/key_f1.xml
index c96ddca..3471c85 100644
--- a/java/res/xml/key_f1.xml
+++ b/java/res/xml/key_f1.xml
@@ -36,27 +36,10 @@
latin:keySpec="\@"
latin:keyStyle="f1MoreKeysStyle" />
</case>
- <case
- latin:supportsSwitchingToShortcutIme="false"
- >
- <Key
- latin:keySpec="!text/keyspec_comma"
- latin:keyLabelFlags="hasPopupHint"
- latin:keyStyle="f1MoreKeysStyle" />
- </case>
- <!-- latin:supportsSwitchingToShortcutIme="true" -->
- <case
- latin:hasShortcutKey="true"
- >
- <Key
- latin:keyStyle="shortcutKeyStyle" />
- </case>
- <!-- latin:hasShortcutKey="false" -->
<default>
<Key
latin:keySpec="!text/keyspec_comma"
latin:keyLabelFlags="hasPopupHint"
- latin:additionalMoreKeys="!text/keyspec_shortcut"
latin:keyStyle="f1MoreKeysStyle" />
</default>
</switch>
diff --git a/java/res/xml/row_dvorak4.xml b/java/res/xml/row_dvorak4.xml
index 91462cb..279f646 100644
--- a/java/res/xml/row_dvorak4.xml
+++ b/java/res/xml/row_dvorak4.xml
@@ -30,7 +30,6 @@
<Key
latin:keySpec="q"
latin:backgroundType="normal"
- latin:additionalMoreKeys="!text/keyspec_shortcut"
latin:keyStyle="f1MoreKeysStyle" />
<include
latin:keyXPos="25%p"
diff --git a/java/res/xml/row_pcqwerty5.xml b/java/res/xml/row_pcqwerty5.xml
index 3782763..32c5389 100644
--- a/java/res/xml/row_pcqwerty5.xml
+++ b/java/res/xml/row_pcqwerty5.xml
@@ -26,13 +26,6 @@
>
<switch>
<case
- latin:hasShortcutKey="true"
- >
- <Key
- latin:keyStyle="shortcutKeyStyle"
- latin:keyWidth="11.538%p" />
- </case>
- <case
latin:clobberSettingsKey="false"
>
<Key
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Arabic.java b/tests/src/com/android/inputmethod/keyboard/layout/Arabic.java
index 59b3bc5..b0493d3 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/Arabic.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/Arabic.java
@@ -69,6 +69,15 @@
}
@Override
+ public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) {
+ if (isPhone) {
+ // U+060C: "،" ARABIC COMMA
+ return joinKeys(key("\u060C", SETTINGS_KEY));
+ }
+ return super.getKeysLeftToSpacebar(isPhone);
+ }
+
+ @Override
public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
if (isPhone) {
return super.getKeysRightToSpacebar(isPhone);
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/ArmenianPhonetic.java b/tests/src/com/android/inputmethod/keyboard/layout/ArmenianPhonetic.java
index 8273c06..204bb01 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/ArmenianPhonetic.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/ArmenianPhonetic.java
@@ -121,8 +121,7 @@
} else {
builder.addKeysOnTheRightOfRow(1, DELETE_KEY)
.addKeysOnTheRightOfRow(3, ENTER_KEY)
- .addKeysOnTheLeftOfRow(5,
- customizer.getSymbolsKey(), key(SHORTCUT_KEY, SETTINGS_KEY))
+ .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey(), SETTINGS_KEY)
.addKeysOnTheRightOfRow(5, EMOJI_KEY);
}
builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone))
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Dvorak.java b/tests/src/com/android/inputmethod/keyboard/layout/Dvorak.java
index 99cf6e5..7ba1d78 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/Dvorak.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/Dvorak.java
@@ -51,7 +51,7 @@
@Override
public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) {
- return isPhone ? joinKeys(key("q", SHORTCUT_KEY, SETTINGS_KEY)) : joinKeys(key("/"));
+ return isPhone ? joinKeys(key("q", SETTINGS_KEY)) : joinKeys(key("/"));
}
@Override
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Farsi.java b/tests/src/com/android/inputmethod/keyboard/layout/Farsi.java
index 238383b..16d2f86 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/Farsi.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/Farsi.java
@@ -67,6 +67,15 @@
}
@Override
+ public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) {
+ if (isPhone) {
+ // U+060C: "،" ARABIC COMMA
+ return joinKeys(key("\u060C", SETTINGS_KEY));
+ }
+ return super.getKeysLeftToSpacebar(isPhone);
+ }
+
+ @Override
public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
if (isPhone) {
return super.getKeysRightToSpacebar(isPhone);
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Khmer.java b/tests/src/com/android/inputmethod/keyboard/layout/Khmer.java
index b841c3e..e7f6a65 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/Khmer.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/Khmer.java
@@ -94,8 +94,7 @@
} else {
builder.addKeysOnTheRightOfRow(1, DELETE_KEY)
.addKeysOnTheRightOfRow(3, ENTER_KEY)
- .addKeysOnTheLeftOfRow(5,
- customizer.getSymbolsKey(), key(SHORTCUT_KEY, SETTINGS_KEY))
+ .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey(), SETTINGS_KEY)
.addKeysOnTheRightOfRow(5, EMOJI_KEY);
}
builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone))
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Lao.java b/tests/src/com/android/inputmethod/keyboard/layout/Lao.java
index 56958a9..6f2ef21 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/Lao.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/Lao.java
@@ -98,8 +98,7 @@
} else {
builder.addKeysOnTheRightOfRow(1, DELETE_KEY)
.addKeysOnTheRightOfRow(3, ENTER_KEY)
- .addKeysOnTheLeftOfRow(5,
- customizer.getSymbolsKey(), key(SHORTCUT_KEY, SETTINGS_KEY))
+ .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey(), SETTINGS_KEY)
.addKeysOnTheRightOfRow(5, EMOJI_KEY);
}
builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone))
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/LayoutBase.java b/tests/src/com/android/inputmethod/keyboard/layout/LayoutBase.java
index e49afbf..e4e9554 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/LayoutBase.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/LayoutBase.java
@@ -29,7 +29,6 @@
* The base class of keyboard layout.
*/
public abstract class LayoutBase extends AbstractLayoutBase {
-
/**
* This class is used to customize common keyboard layout to language specific layout.
*/
@@ -161,7 +160,8 @@
* @return the array of {@link ExpectedKey} that should be placed at left of the spacebar.
*/
public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) {
- return isPhone ? joinKeys(key(SHORTCUT_KEY, SETTINGS_KEY)) : joinKeys("/");
+ // U+002C: "," COMMA
+ return isPhone ? joinKeys(key("\u002C", SETTINGS_KEY)) : joinKeys("/");
}
/**
@@ -296,8 +296,7 @@
} else {
builder.addKeysOnTheRightOfRow(1, DELETE_KEY)
.addKeysOnTheRightOfRow(2, ENTER_KEY)
- .addKeysOnTheLeftOfRow(4,
- customizer.getSymbolsKey(), key(SHORTCUT_KEY, SETTINGS_KEY))
+ .addKeysOnTheLeftOfRow(4, customizer.getSymbolsKey(), SETTINGS_KEY)
.addKeysOnTheRightOfRow(4, EMOJI_KEY);
}
builder.addKeysOnTheLeftOfRow(3, (Object[])customizer.getLeftShiftKeys(isPhone))
@@ -307,6 +306,10 @@
/**
* Get common alphabet layout. This layout doesn't contain any special keys.
+ *
+ * A keyboard layout is an array of rows, and a row consists of an array of
+ * {@link ExpectedKey}s. Each row may have different number of {@link ExpectedKey}s.
+ *
* @param isPhone true if requesting phone's layout.
* @return the common alphabet keyboard layout.
*/
@@ -314,6 +317,10 @@
/**
* Get common alphabet shifted layout. This layout doesn't contain any special keys.
+ *
+ * A keyboard layout is an array of rows, and a row consists of an array of
+ * {@link ExpectedKey}s. Each row may have different number of {@link ExpectedKey}s.
+ *
* @param isPhone true if requesting phone's layout.
* @param elementId the element id of the requesting shifted mode.
* @return the common alphabet shifted keyboard layout.
@@ -328,6 +335,10 @@
/**
* Get the complete expected keyboard layout.
+ *
+ * A keyboard layout is an array of rows, and a row consists of an array of
+ * {@link ExpectedKey}s. Each row may have different number of {@link ExpectedKey}s.
+ *
* @param isPhone true if requesting phone's layout.
* @param elementId the element id of the requesting keyboard mode.
* @return the keyboard layout of the <code>elementId</code>.
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Myanmar.java b/tests/src/com/android/inputmethod/keyboard/layout/Myanmar.java
index 683217c..2d1c901 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/Myanmar.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/Myanmar.java
@@ -106,8 +106,7 @@
} else {
builder.addKeysOnTheRightOfRow(1, DELETE_KEY)
.addKeysOnTheRightOfRow(3, ENTER_KEY)
- .addKeysOnTheLeftOfRow(5,
- customizer.getSymbolsKey(), key(SHORTCUT_KEY, SETTINGS_KEY))
+ .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey(), SETTINGS_KEY)
.addKeysOnTheRightOfRow(5, EMOJI_KEY);
}
builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone))
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/PcQwerty.java b/tests/src/com/android/inputmethod/keyboard/layout/PcQwerty.java
index dd3fbc3..9da6dcc 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/PcQwerty.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/PcQwerty.java
@@ -50,7 +50,7 @@
@Override
public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) {
- return joinKeys(key(SHORTCUT_KEY, SETTINGS_KEY));
+ return joinKeys(SETTINGS_KEY);
}
@Override
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/Thai.java b/tests/src/com/android/inputmethod/keyboard/layout/Thai.java
index 3efe039..253c93b 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/Thai.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/Thai.java
@@ -111,8 +111,7 @@
} else {
builder.addKeysOnTheRightOfRow(1, DELETE_KEY)
.addKeysOnTheRightOfRow(3, ENTER_KEY)
- .addKeysOnTheLeftOfRow(5,
- customizer.getSymbolsKey(), key(SHORTCUT_KEY, SETTINGS_KEY))
+ .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey(), SETTINGS_KEY)
.addKeysOnTheRightOfRow(5, EMOJI_KEY);
}
builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone))
diff --git a/tests/src/com/android/inputmethod/keyboard/layout/tests/LayoutTestsBase.java b/tests/src/com/android/inputmethod/keyboard/layout/tests/LayoutTestsBase.java
index 2733997..d4e8fb6 100644
--- a/tests/src/com/android/inputmethod/keyboard/layout/tests/LayoutTestsBase.java
+++ b/tests/src/com/android/inputmethod/keyboard/layout/tests/LayoutTestsBase.java
@@ -51,7 +51,7 @@
mSubtype = getSubtype(mLayout.getLocale(), mLayout.getName());
mLogTag = SubtypeLocaleUtils.getSubtypeNameForLogging(mSubtype) + "/"
+ (isPhone() ? "phone" : "tablet");
- // TODO: Test with voice and language switch keys enabled and disabled.
+ // TODO: Test with language switch key enabled and disabled.
mKeyboardLayoutSet = createKeyboardLayoutSet(mSubtype, null /* editorInfo */,
true /* isShortcutImeEnabled */, true /* showsVoiceInputKey */,
true /* isLanguageSwitchKeyEnabled */);