aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2014-05-08 12:04:36 +0900
committerTadashi G. Takaoka <takaoka@google.com>2014-05-12 10:59:10 +0900
commit59c3ef1ff8df23e3c3e3f549c0289c479553c666 (patch)
treef5c1750af142867cc46b78874e713a0e4c39e130 /tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java
parent6b74f516dcfb7b6c8008054490db117341e5332b (diff)
downloadlatinime-59c3ef1ff8df23e3c3e3f549c0289c479553c666.tar.gz
latinime-59c3ef1ff8df23e3c3e3f549c0289c479553c666.tar.xz
latinime-59c3ef1ff8df23e3c3e3f549c0289c479553c666.zip
Refactor KeyboardTheme
This CL introduces two preference keys in addition to the existing one. - pref_keyboard_theme: The new preference key that is used only in the preference settings. - pref_keyboard_layout_20110916: The previous preference key that holds keyboard color scheme settings. This is superseded by the next key. - pref_keyboard_theme_20140509: The new preference key that holds keyboard theme settings. This value is forcibly reset to LMP theme on a LMP device. On a KitKat and previous device, the settings of the pref_keyboard_layout_20110916 is carried on into this preference. This CL must be checked in together with Id7b3ddd8aa. Change-Id: I2d55602d026e30b38d8f822d2124f5c5e4a9a812
Diffstat (limited to 'tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java')
-rw-r--r--tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java
index 0fb6ff2b4..75bd60999 100644
--- a/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java
+++ b/tests/src/com/android/inputmethod/keyboard/KeyboardLayoutSetTestsBase.java
@@ -18,6 +18,7 @@ package com.android.inputmethod.keyboard;
import android.content.Context;
import android.content.res.Resources;
+import android.preference.PreferenceManager;
import android.test.AndroidTestCase;
import android.test.suitebuilder.annotation.SmallTest;
import android.view.ContextThemeWrapper;
@@ -40,9 +41,6 @@ import java.util.Locale;
@SmallTest
public class KeyboardLayoutSetTestsBase extends AndroidTestCase {
- private static final KeyboardTheme DEFAULT_KEYBOARD_THEME =
- KeyboardTheme.getDefaultKeyboardTheme();
-
// All input method subtypes of LatinIME.
private final ArrayList<InputMethodSubtype> mAllSubtypesList = CollectionUtils.newArrayList();
private final ArrayList<InputMethodSubtype> mAsciiCapableSubtypesList =
@@ -58,7 +56,9 @@ public class KeyboardLayoutSetTestsBase extends AndroidTestCase {
super.setUp();
mScreenMetrics = mContext.getResources().getInteger(R.integer.config_screen_metrics);
- mThemeContext = new ContextThemeWrapper(mContext, DEFAULT_KEYBOARD_THEME.mStyleId);
+ final KeyboardTheme keyboardTheme = KeyboardTheme.getKeyboardTheme(
+ PreferenceManager.getDefaultSharedPreferences(mContext));
+ mThemeContext = new ContextThemeWrapper(mContext, keyboardTheme.mStyleId);
RichInputMethodManager.init(mThemeContext);
final RichInputMethodManager richImm = RichInputMethodManager.getInstance();