From 8542c48c3009e246ae084a25018ddffcf3c273c3 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Tue, 11 Mar 2014 18:53:30 +0900 Subject: [PATCH] Cleanup private method names This is a follow up of Ib0ded6f98a. Change-Id: I91ad3504d301113680194ad5b10913fc86006150 --- .../keyboard/layout/expected/LayoutBase.java | 27 +++++++++---------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/tests/src/com/android/inputmethod/keyboard/layout/expected/LayoutBase.java b/tests/src/com/android/inputmethod/keyboard/layout/expected/LayoutBase.java index 813a51f74..1d242d0b8 100644 --- a/tests/src/com/android/inputmethod/keyboard/layout/expected/LayoutBase.java +++ b/tests/src/com/android/inputmethod/keyboard/layout/expected/LayoutBase.java @@ -123,8 +123,9 @@ public class LayoutBase { // Helper method to create alphabet layout for phone by adding special function keys except // shift key. - private static ExpectedKeyboardBuilder toPhoneAlphabet(final ExpectedKeyboardBuilder builder) { - return builder + private static ExpectedKeyboardBuilder convertToPhoneAlphabetKeyboardBuilder( + final ExpectedKey[][] commonLayout) { + return new ExpectedKeyboardBuilder(commonLayout) .addKeysOnTheRightOfRow(3, DELETE_KEY) .setLabelsOfRow(4, ",", " ", ".") .setMoreKeysOf(",", SETTINGS_KEY) @@ -135,8 +136,9 @@ public class LayoutBase { // Helper method to create alphabet layout for tablet by adding special function keys except // shift key. - private static ExpectedKeyboardBuilder toTabletAlphabet(final ExpectedKeyboardBuilder builder) { - return builder + private static ExpectedKeyboardBuilder convertToTabletAlphabetKeyboardBuilder( + final ExpectedKey[][] commonLayout) { + return new ExpectedKeyboardBuilder(commonLayout) // U+00BF: "¿" INVERTED QUESTION MARK // U+00A1: "¡" INVERTED EXCLAMATION MARK .addKeysOnTheRightOfRow(3, @@ -150,22 +152,17 @@ public class LayoutBase { } // Helper method to create alphabet layout by adding special function keys. - public static ExpectedKey[][] getAlphabetLayoutWithoutShiftKeys(final ExpectedKey[][] common, - final boolean isPhone) { - final ExpectedKeyboardBuilder builder = new ExpectedKeyboardBuilder(common); - if (isPhone) { - toPhoneAlphabet(builder); - } else { - toTabletAlphabet(builder).build(); - } - return builder.build(); + public static ExpectedKey[][] getAlphabetLayoutWithoutShiftKeys( + final ExpectedKey[][] commonLayout, final boolean isPhone) { + return isPhone ? convertToPhoneAlphabetKeyboardBuilder(commonLayout).build() + : convertToTabletAlphabetKeyboardBuilder(commonLayout).build(); } // 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 ExpectedKeyboardBuilder builder = new ExpectedKeyboardBuilder( - getAlphabetLayoutWithoutShiftKeys(common, isPhone)); + getAlphabetLayoutWithoutShiftKeys(commonLayout, isPhone)); if (isPhone) { builder.addKeysOnTheLeftOfRow(3, key(SHIFT_KEY, CAPSLOCK_MORE_KEY)); } else {