Enable voice and language switch keys for keyboard layout tests

Change-Id: I19ee05e30d09eb13753b737961882e345591c1df
main
Tadashi G. Takaoka 2014-05-12 15:57:30 +09:00
parent c41d261b7e
commit 139773d016
11 changed files with 21 additions and 30 deletions

View File

@ -68,15 +68,6 @@ public final class Arabic extends LayoutBase {
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
public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
if (isPhone) {

View File

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

View File

@ -66,15 +66,6 @@ public final class Farsi extends LayoutBase {
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
public ExpectedKey[] getKeysRightToSpacebar(final boolean isPhone) {
if (isPhone) {
@ -91,7 +82,7 @@ public final class Farsi extends LayoutBase {
@Override
public ExpectedKey[] getSpaceKeys(final boolean isPhone) {
return joinKeys(SPACE_KEY, key(ZWNJ_KEY, ZWJ_KEY));
return joinKeys(LANGUAGE_SWITCH_KEY, SPACE_KEY, key(ZWNJ_KEY, ZWJ_KEY));
}
@Override

View File

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

View File

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

View File

@ -152,7 +152,7 @@ public abstract class LayoutBase extends AbstractLayoutBase {
* keyboard.
*/
public ExpectedKey[] getSpaceKeys(final boolean isPhone) {
return joinKeys(SPACE_KEY);
return joinKeys(LANGUAGE_SWITCH_KEY, SPACE_KEY);
}
/**
@ -161,7 +161,7 @@ public abstract class LayoutBase extends AbstractLayoutBase {
* @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(",", SETTINGS_KEY)) : joinKeys("/");
return isPhone ? joinKeys(key(SHORTCUT_KEY, SETTINGS_KEY)) : joinKeys("/");
}
/**
@ -296,7 +296,8 @@ public abstract class LayoutBase extends AbstractLayoutBase {
} else {
builder.addKeysOnTheRightOfRow(1, DELETE_KEY)
.addKeysOnTheRightOfRow(2, ENTER_KEY)
.addKeysOnTheLeftOfRow(4, customizer.getSymbolsKey(), SETTINGS_KEY)
.addKeysOnTheLeftOfRow(4,
customizer.getSymbolsKey(), key(SHORTCUT_KEY, SETTINGS_KEY))
.addKeysOnTheRightOfRow(4, EMOJI_KEY);
}
builder.addKeysOnTheLeftOfRow(3, (Object[])customizer.getLeftShiftKeys(isPhone))

View File

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

View File

@ -47,7 +47,7 @@ public final class NepaliRomanized extends LayoutBase {
@Override
public ExpectedKey[] getSpaceKeys(final boolean isPhone) {
return joinKeys(SPACE_KEY, key(ZWNJ_KEY, ZWJ_KEY));
return joinKeys(LANGUAGE_SWITCH_KEY, SPACE_KEY, key(ZWNJ_KEY, ZWJ_KEY));
}
// U+0930/U+0941/U+002E "रु." NEPALESE RUPEE SIGN

View File

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

View File

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

View File

@ -51,7 +51,10 @@ abstract class LayoutTestsBase extends KeyboardLayoutSetTestsBase {
mSubtype = getSubtype(mLayout.getLocale(), mLayout.getName());
mLogTag = SubtypeLocaleUtils.getSubtypeNameForLogging(mSubtype) + "/"
+ (isPhone() ? "phone" : "tablet");
mKeyboardLayoutSet = createKeyboardLayoutSet(mSubtype, null /* editorInfo */);
// TODO: Test with voice and language switch keys enabled and disabled.
mKeyboardLayoutSet = createKeyboardLayoutSet(mSubtype, null /* editorInfo */,
true /* isShortcutImeEnabled */, true /* showsVoiceInputKey */,
true /* isLanguageSwitchKeyEnabled */);
}
// Those helper methods have a lower case name to be readable when defining expected keyboard