diff options
author | 2012-01-13 17:51:21 +0900 | |
---|---|---|
committer | 2012-01-13 19:14:42 +0900 | |
commit | 4cabb049718003341edc75be23fbd87a7eea9cc6 (patch) | |
tree | f319f0c7d7c87d7da7dd2a6c5482366ae45f30f3 /tests/src/com/android/inputmethod/latin/SuggestHelper.java | |
parent | ca132ce8e224eaae6d7d9b01fb6183708779684b (diff) | |
download | latinime-4cabb049718003341edc75be23fbd87a7eea9cc6.tar.gz latinime-4cabb049718003341edc75be23fbd87a7eea9cc6.tar.xz latinime-4cabb049718003341edc75be23fbd87a7eea9cc6.zip |
Use KeyboardSet for unit test
Change-Id: I6a08e04628bac0222140e5b1b108f6bcb39859a2
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/SuggestHelper.java')
-rw-r--r-- | tests/src/com/android/inputmethod/latin/SuggestHelper.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/tests/src/com/android/inputmethod/latin/SuggestHelper.java b/tests/src/com/android/inputmethod/latin/SuggestHelper.java index cccd1a4a9..2e362458b 100644 --- a/tests/src/com/android/inputmethod/latin/SuggestHelper.java +++ b/tests/src/com/android/inputmethod/latin/SuggestHelper.java @@ -21,7 +21,7 @@ import android.text.TextUtils; import com.android.inputmethod.keyboard.KeyDetector; import com.android.inputmethod.keyboard.Keyboard; -import com.android.inputmethod.keyboard.KeyboardId; +import com.android.inputmethod.keyboard.KeyboardSet; import java.io.File; import java.util.Locale; @@ -32,24 +32,20 @@ public class SuggestHelper { protected final Keyboard 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) { + public SuggestHelper(Context context, int dictionaryId, KeyboardSet keyboardSet) { // 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 Keyboard.Builder<Keyboard.Params>(context, new Keyboard.Params()) - .load(ALPHABET_KEYBOARD, keyboardId).build(); + mKeyboard = keyboardSet.getMainKeyboard(); mKeyDetector = new KeyDetector(0); init(); } protected SuggestHelper(final Context context, final File dictionaryPath, - final long startOffset, final long length, final KeyboardId keyboardId, + final long startOffset, final long length, final KeyboardSet keyboardSet, final Locale locale) { mSuggest = new Suggest(context, dictionaryPath, startOffset, length, null, locale); - mKeyboard = new Keyboard.Builder<Keyboard.Params>(context, new Keyboard.Params()) - .load(ALPHABET_KEYBOARD, keyboardId).build(); + mKeyboard = keyboardSet.getMainKeyboard(); mKeyDetector = new KeyDetector(0); init(); } |