From 645128af712961456a42cbcc34c0cdf5f0b40a83 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Thu, 15 Dec 2011 14:45:14 +0900 Subject: Move KeyboardSwitcher.getKeyboard to KeyboardSet This change also gets rid of XML id from KeyboardId. Bug: 5002108 Bug: 5679585 Change-Id: I7086c7da3c01ba4ade7f77ee5cc731310da46404 --- tests/src/com/android/inputmethod/latin/SuggestHelper.java | 6 ++++-- tests/src/com/android/inputmethod/latin/SuggestTestsBase.java | 5 ++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'tests/src') diff --git a/tests/src/com/android/inputmethod/latin/SuggestHelper.java b/tests/src/com/android/inputmethod/latin/SuggestHelper.java index 06b192440..4d123e5d3 100644 --- a/tests/src/com/android/inputmethod/latin/SuggestHelper.java +++ b/tests/src/com/android/inputmethod/latin/SuggestHelper.java @@ -32,11 +32,13 @@ public class SuggestHelper { protected final LatinKeyboard mKeyboard; private final KeyDetector mKeyDetector; + public static final int ALPHABET_KEYBOARD = com.android.inputmethod.latin.R.xml.kbd_qwerty; + public SuggestHelper(Context context, int dictionaryId, KeyboardId keyboardId) { // Use null as the locale for Suggest so as to force it to use the internal dictionary // (and not try to find a dictionary provider for a specified locale) mSuggest = new Suggest(context, dictionaryId, null); - mKeyboard = new LatinKeyboard.Builder(context).load(keyboardId).build(); + mKeyboard = new LatinKeyboard.Builder(context).load(ALPHABET_KEYBOARD, keyboardId).build(); mKeyDetector = new KeyDetector(0); init(); } @@ -45,7 +47,7 @@ public class SuggestHelper { final long startOffset, final long length, final KeyboardId keyboardId, final Locale locale) { mSuggest = new Suggest(context, dictionaryPath, startOffset, length, null, locale); - mKeyboard = new LatinKeyboard.Builder(context).load(keyboardId).build(); + mKeyboard = new LatinKeyboard.Builder(context).load(ALPHABET_KEYBOARD, keyboardId).build(); mKeyDetector = new KeyDetector(0); init(); } diff --git a/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java b/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java index bfb03019b..9dd61d78c 100644 --- a/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java +++ b/tests/src/com/android/inputmethod/latin/SuggestTestsBase.java @@ -50,9 +50,8 @@ public class SuggestTestsBase extends AndroidTestCase { + "orientation=" + orientation); return null; } - return new KeyboardId(com.android.inputmethod.latin.R.xml.kbd_qwerty, - KeyboardId.ELEMENT_ALPHABET, locale, orientation, width, KeyboardId.MODE_TEXT, - InputType.TYPE_CLASS_TEXT, 0, false, false, false, false); + return new KeyboardId(KeyboardId.ELEMENT_ALPHABET, locale, orientation, width, + KeyboardId.MODE_TEXT, InputType.TYPE_CLASS_TEXT, 0, false, false, false, false); } protected InputStream openTestRawResource(int resIdInTest) { -- cgit v1.2.3-83-g751a