am 722f5c79: Remove voice key from keyboard layout

* commit '722f5c79668369a69d1b519b8fe8dbd17d7ca6a6':
  Remove voice key from keyboard layout
main
Tadashi G. Takaoka 2014-05-12 08:44:50 +00:00 committed by Android Git Automerger
commit 931a392aa8
18 changed files with 46 additions and 64 deletions

View File

@ -2,7 +2,7 @@
<!-- <!--
/* /*
** **
** Copyright 2012, The Android Open Source Project ** Copyright 2014, The Android Open Source Project
** **
** Licensed under the Apache License, Version 2.0 (the "License"); ** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License. ** you may not use this file except in compliance with the License.
@ -23,29 +23,12 @@
> >
<switch> <switch>
<case <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" latin:clobberSettingsKey="false"
> >
<Key <Key
latin:keyStyle="settingsKeyStyle" /> latin:keyStyle="settingsKeyStyle" />
</case> </case>
<!-- supportsSwitchingToShortcutIme="false" clobberSettingsKey="true" --> <!-- clobberSettingsKey="true" -->
<default> <default>
<Spacer /> <Spacer />
</default> </default>

View File

@ -29,7 +29,7 @@
latin:keyStyle="toSymbolKeyStyle" latin:keyStyle="toSymbolKeyStyle"
latin:keyWidth="10.0%p" /> latin:keyWidth="10.0%p" />
<include <include
latin:keyboardLayout="@xml/key_shortcut" /> latin:keyboardLayout="@xml/key_settings" />
<include <include
latin:keyboardLayout="@xml/key_f1" /> latin:keyboardLayout="@xml/key_f1" />
<include <include

View File

@ -26,7 +26,7 @@
> >
<include <include
latin:keyWidth="9.0%p" latin:keyWidth="9.0%p"
latin:keyboardLayout="@xml/key_shortcut" /> latin:keyboardLayout="@xml/key_settings" />
<switch> <switch>
<case <case
latin:languageSwitchKeyEnabled="true" latin:languageSwitchKeyEnabled="true"

View File

@ -29,7 +29,7 @@
latin:keyStyle="toSymbolKeyStyle" latin:keyStyle="toSymbolKeyStyle"
latin:keyWidth="10.0%p" /> latin:keyWidth="10.0%p" />
<include <include
latin:keyboardLayout="@xml/key_shortcut" /> latin:keyboardLayout="@xml/key_settings" />
<include <include
latin:keyboardLayout="@xml/key_f1" /> latin:keyboardLayout="@xml/key_f1" />
<include <include

View File

@ -36,27 +36,10 @@
latin:keySpec="\@" latin:keySpec="\@"
latin:keyStyle="f1MoreKeysStyle" /> latin:keyStyle="f1MoreKeysStyle" />
</case> </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> <default>
<Key <Key
latin:keySpec="!text/keyspec_comma" latin:keySpec="!text/keyspec_comma"
latin:keyLabelFlags="hasPopupHint" latin:keyLabelFlags="hasPopupHint"
latin:additionalMoreKeys="!text/keyspec_shortcut"
latin:keyStyle="f1MoreKeysStyle" /> latin:keyStyle="f1MoreKeysStyle" />
</default> </default>
</switch> </switch>

View File

@ -30,7 +30,6 @@
<Key <Key
latin:keySpec="q" latin:keySpec="q"
latin:backgroundType="normal" latin:backgroundType="normal"
latin:additionalMoreKeys="!text/keyspec_shortcut"
latin:keyStyle="f1MoreKeysStyle" /> latin:keyStyle="f1MoreKeysStyle" />
<include <include
latin:keyXPos="25%p" latin:keyXPos="25%p"

View File

@ -25,13 +25,6 @@
latin:keyWidth="7.692%p" latin:keyWidth="7.692%p"
> >
<switch> <switch>
<case
latin:hasShortcutKey="true"
>
<Key
latin:keyStyle="shortcutKeyStyle"
latin:keyWidth="11.538%p" />
</case>
<case <case
latin:clobberSettingsKey="false" latin:clobberSettingsKey="false"
> >

View File

@ -68,6 +68,15 @@ public final class Arabic extends LayoutBase {
return EMPTY_KEYS; return EMPTY_KEYS;
} }
@Override
public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) {
if (isPhone) {
// U+060C: "،" ARABIC COMMA
return joinKeys(key("\u060C", SETTINGS_KEY));
}
return super.getKeysLeftToSpacebar(isPhone);
}
@Override @Override
public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) { public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
if (isPhone) { if (isPhone) {

View File

@ -121,8 +121,7 @@ public final class ArmenianPhonetic extends LayoutBase {
} else { } else {
builder.addKeysOnTheRightOfRow(1, DELETE_KEY) builder.addKeysOnTheRightOfRow(1, DELETE_KEY)
.addKeysOnTheRightOfRow(3, ENTER_KEY) .addKeysOnTheRightOfRow(3, ENTER_KEY)
.addKeysOnTheLeftOfRow(5, .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey(), SETTINGS_KEY)
customizer.getSymbolsKey(), key(SHORTCUT_KEY, SETTINGS_KEY))
.addKeysOnTheRightOfRow(5, EMOJI_KEY); .addKeysOnTheRightOfRow(5, EMOJI_KEY);
} }
builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone)) builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone))

View File

@ -51,7 +51,7 @@ public final class Dvorak extends LayoutBase {
@Override @Override
public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) { 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 @Override

View File

@ -66,6 +66,15 @@ public final class Farsi extends LayoutBase {
return EMPTY_KEYS; return EMPTY_KEYS;
} }
@Override
public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) {
if (isPhone) {
// U+060C: "،" ARABIC COMMA
return joinKeys(key("\u060C", SETTINGS_KEY));
}
return super.getKeysLeftToSpacebar(isPhone);
}
@Override @Override
public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) { public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
if (isPhone) { if (isPhone) {

View File

@ -94,8 +94,7 @@ public final class Khmer extends LayoutBase {
} else { } else {
builder.addKeysOnTheRightOfRow(1, DELETE_KEY) builder.addKeysOnTheRightOfRow(1, DELETE_KEY)
.addKeysOnTheRightOfRow(3, ENTER_KEY) .addKeysOnTheRightOfRow(3, ENTER_KEY)
.addKeysOnTheLeftOfRow(5, .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey(), SETTINGS_KEY)
customizer.getSymbolsKey(), key(SHORTCUT_KEY, SETTINGS_KEY))
.addKeysOnTheRightOfRow(5, EMOJI_KEY); .addKeysOnTheRightOfRow(5, EMOJI_KEY);
} }
builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone)) builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone))

View File

@ -98,8 +98,7 @@ public final class Lao extends LayoutBase {
} else { } else {
builder.addKeysOnTheRightOfRow(1, DELETE_KEY) builder.addKeysOnTheRightOfRow(1, DELETE_KEY)
.addKeysOnTheRightOfRow(3, ENTER_KEY) .addKeysOnTheRightOfRow(3, ENTER_KEY)
.addKeysOnTheLeftOfRow(5, .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey(), SETTINGS_KEY)
customizer.getSymbolsKey(), key(SHORTCUT_KEY, SETTINGS_KEY))
.addKeysOnTheRightOfRow(5, EMOJI_KEY); .addKeysOnTheRightOfRow(5, EMOJI_KEY);
} }
builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone)) builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone))

View File

@ -29,7 +29,6 @@ import java.util.Locale;
* The base class of keyboard layout. * The base class of keyboard layout.
*/ */
public abstract class LayoutBase extends AbstractLayoutBase { public abstract class LayoutBase extends AbstractLayoutBase {
/** /**
* This class is used to customize common keyboard layout to language specific layout. * This class is used to customize common keyboard layout to language specific layout.
*/ */
@ -161,7 +160,8 @@ public abstract class LayoutBase extends AbstractLayoutBase {
* @return the array of {@link ExpectedKey} that should be placed at left of the spacebar. * @return the array of {@link ExpectedKey} that should be placed at left of the spacebar.
*/ */
public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) { 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 @@ public abstract class LayoutBase extends AbstractLayoutBase {
} else { } else {
builder.addKeysOnTheRightOfRow(1, DELETE_KEY) builder.addKeysOnTheRightOfRow(1, DELETE_KEY)
.addKeysOnTheRightOfRow(2, ENTER_KEY) .addKeysOnTheRightOfRow(2, ENTER_KEY)
.addKeysOnTheLeftOfRow(4, .addKeysOnTheLeftOfRow(4, customizer.getSymbolsKey(), SETTINGS_KEY)
customizer.getSymbolsKey(), key(SHORTCUT_KEY, SETTINGS_KEY))
.addKeysOnTheRightOfRow(4, EMOJI_KEY); .addKeysOnTheRightOfRow(4, EMOJI_KEY);
} }
builder.addKeysOnTheLeftOfRow(3, (Object[])customizer.getLeftShiftKeys(isPhone)) builder.addKeysOnTheLeftOfRow(3, (Object[])customizer.getLeftShiftKeys(isPhone))
@ -307,6 +306,10 @@ public abstract class LayoutBase extends AbstractLayoutBase {
/** /**
* Get common alphabet layout. This layout doesn't contain any special keys. * 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. * @param isPhone true if requesting phone's layout.
* @return the common alphabet keyboard layout. * @return the common alphabet keyboard layout.
*/ */
@ -314,6 +317,10 @@ public abstract class LayoutBase extends AbstractLayoutBase {
/** /**
* Get common alphabet shifted layout. This layout doesn't contain any special keys. * 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 isPhone true if requesting phone's layout.
* @param elementId the element id of the requesting shifted mode. * @param elementId the element id of the requesting shifted mode.
* @return the common alphabet shifted keyboard layout. * @return the common alphabet shifted keyboard layout.
@ -328,6 +335,10 @@ public abstract class LayoutBase extends AbstractLayoutBase {
/** /**
* Get the complete expected keyboard layout. * 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 isPhone true if requesting phone's layout.
* @param elementId the element id of the requesting keyboard mode. * @param elementId the element id of the requesting keyboard mode.
* @return the keyboard layout of the <code>elementId</code>. * @return the keyboard layout of the <code>elementId</code>.

View File

@ -106,8 +106,7 @@ public final class Myanmar extends LayoutBase {
} else { } else {
builder.addKeysOnTheRightOfRow(1, DELETE_KEY) builder.addKeysOnTheRightOfRow(1, DELETE_KEY)
.addKeysOnTheRightOfRow(3, ENTER_KEY) .addKeysOnTheRightOfRow(3, ENTER_KEY)
.addKeysOnTheLeftOfRow(5, .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey(), SETTINGS_KEY)
customizer.getSymbolsKey(), key(SHORTCUT_KEY, SETTINGS_KEY))
.addKeysOnTheRightOfRow(5, EMOJI_KEY); .addKeysOnTheRightOfRow(5, EMOJI_KEY);
} }
builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone)) builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone))

View File

@ -50,7 +50,7 @@ public final class PcQwerty extends LayoutBase {
@Override @Override
public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) { public ExpectedKey[] getKeysLeftToSpacebar(final boolean isPhone) {
return joinKeys(key(SHORTCUT_KEY, SETTINGS_KEY)); return joinKeys(SETTINGS_KEY);
} }
@Override @Override

View File

@ -111,8 +111,7 @@ public final class Thai extends LayoutBase {
} else { } else {
builder.addKeysOnTheRightOfRow(1, DELETE_KEY) builder.addKeysOnTheRightOfRow(1, DELETE_KEY)
.addKeysOnTheRightOfRow(3, ENTER_KEY) .addKeysOnTheRightOfRow(3, ENTER_KEY)
.addKeysOnTheLeftOfRow(5, .addKeysOnTheLeftOfRow(5, customizer.getSymbolsKey(), SETTINGS_KEY)
customizer.getSymbolsKey(), key(SHORTCUT_KEY, SETTINGS_KEY))
.addKeysOnTheRightOfRow(5, EMOJI_KEY); .addKeysOnTheRightOfRow(5, EMOJI_KEY);
} }
builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone)) builder.addKeysOnTheLeftOfRow(4, (Object[])customizer.getLeftShiftKeys(isPhone))

View File

@ -51,7 +51,7 @@ abstract class LayoutTestsBase extends KeyboardLayoutSetTestsBase {
mSubtype = getSubtype(mLayout.getLocale(), mLayout.getName()); mSubtype = getSubtype(mLayout.getLocale(), mLayout.getName());
mLogTag = SubtypeLocaleUtils.getSubtypeNameForLogging(mSubtype) + "/" mLogTag = SubtypeLocaleUtils.getSubtypeNameForLogging(mSubtype) + "/"
+ (isPhone() ? "phone" : "tablet"); + (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 */, mKeyboardLayoutSet = createKeyboardLayoutSet(mSubtype, null /* editorInfo */,
true /* isShortcutImeEnabled */, true /* showsVoiceInputKey */, true /* isShortcutImeEnabled */, true /* showsVoiceInputKey */,
true /* isLanguageSwitchKeyEnabled */); true /* isLanguageSwitchKeyEnabled */);