am 2600c092: Merge "Cleanup private method names"

* commit '2600c092b0323ac607df23561f5931412ed7c0f6':
  Cleanup private method names
main
Tadashi G. Takaoka 2014-03-11 03:22:52 -07:00 committed by Android Git Automerger
commit 6829daf2af
1 changed files with 12 additions and 15 deletions

View File

@ -123,8 +123,9 @@ public class LayoutBase {
// Helper method to create alphabet layout for phone by adding special function keys except // Helper method to create alphabet layout for phone by adding special function keys except
// shift key. // shift key.
private static ExpectedKeyboardBuilder toPhoneAlphabet(final ExpectedKeyboardBuilder builder) { private static ExpectedKeyboardBuilder convertToPhoneAlphabetKeyboardBuilder(
return builder final ExpectedKey[][] commonLayout) {
return new ExpectedKeyboardBuilder(commonLayout)
.addKeysOnTheRightOfRow(3, DELETE_KEY) .addKeysOnTheRightOfRow(3, DELETE_KEY)
.setLabelsOfRow(4, ",", " ", ".") .setLabelsOfRow(4, ",", " ", ".")
.setMoreKeysOf(",", SETTINGS_KEY) .setMoreKeysOf(",", SETTINGS_KEY)
@ -135,8 +136,9 @@ public class LayoutBase {
// Helper method to create alphabet layout for tablet by adding special function keys except // Helper method to create alphabet layout for tablet by adding special function keys except
// shift key. // shift key.
private static ExpectedKeyboardBuilder toTabletAlphabet(final ExpectedKeyboardBuilder builder) { private static ExpectedKeyboardBuilder convertToTabletAlphabetKeyboardBuilder(
return builder final ExpectedKey[][] commonLayout) {
return new ExpectedKeyboardBuilder(commonLayout)
// U+00BF: "¿" INVERTED QUESTION MARK // U+00BF: "¿" INVERTED QUESTION MARK
// U+00A1: "¡" INVERTED EXCLAMATION MARK // U+00A1: "¡" INVERTED EXCLAMATION MARK
.addKeysOnTheRightOfRow(3, .addKeysOnTheRightOfRow(3,
@ -150,22 +152,17 @@ public class LayoutBase {
} }
// Helper method to create alphabet layout by adding special function keys. // Helper method to create alphabet layout by adding special function keys.
public static ExpectedKey[][] getAlphabetLayoutWithoutShiftKeys(final ExpectedKey[][] common, public static ExpectedKey[][] getAlphabetLayoutWithoutShiftKeys(
final boolean isPhone) { final ExpectedKey[][] commonLayout, final boolean isPhone) {
final ExpectedKeyboardBuilder builder = new ExpectedKeyboardBuilder(common); return isPhone ? convertToPhoneAlphabetKeyboardBuilder(commonLayout).build()
if (isPhone) { : convertToTabletAlphabetKeyboardBuilder(commonLayout).build();
toPhoneAlphabet(builder);
} else {
toTabletAlphabet(builder).build();
}
return builder.build();
} }
// Helper method to create alphabet layout by adding special function keys. // Helper method to create alphabet layout by adding special function keys.
public static ExpectedKey[][] getDefaultAlphabetLayout(final ExpectedKey[][] common, public static ExpectedKey[][] getDefaultAlphabetLayout(final ExpectedKey[][] commonLayout,
final boolean isPhone) { final boolean isPhone) {
final ExpectedKeyboardBuilder builder = new ExpectedKeyboardBuilder( final ExpectedKeyboardBuilder builder = new ExpectedKeyboardBuilder(
getAlphabetLayoutWithoutShiftKeys(common, isPhone)); getAlphabetLayoutWithoutShiftKeys(commonLayout, isPhone));
if (isPhone) { if (isPhone) {
builder.addKeysOnTheLeftOfRow(3, key(SHIFT_KEY, CAPSLOCK_MORE_KEY)); builder.addKeysOnTheLeftOfRow(3, key(SHIFT_KEY, CAPSLOCK_MORE_KEY));
} else { } else {