Update the theme pref key.

Follow up to Ia139813b

Change-Id: Ic4c2ea63041af02119dc404e704a04608d041163
This commit is contained in:
Ken Wakasa 2011-09-16 20:18:46 +09:00
parent 60e4997eab
commit 2d9722e46c
2 changed files with 3 additions and 4 deletions

View file

@ -27,7 +27,7 @@
/> />
<ListPreference <ListPreference
android:key="pref_keyboard_layout_20100902" android:key="pref_keyboard_layout_20110916"
android:title="@string/keyboard_layout" android:title="@string/keyboard_layout"
android:persistent="true" android:persistent="true"
android:entryValues="@array/keyboard_layout_modes_values" android:entryValues="@array/keyboard_layout_modes_values"

View file

@ -49,7 +49,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
private static final boolean DEBUG_CACHE = LatinImeLogger.sDBG; private static final boolean DEBUG_CACHE = LatinImeLogger.sDBG;
public static final boolean DEBUG_STATE = false; public static final boolean DEBUG_STATE = false;
public static final String PREF_KEYBOARD_LAYOUT = "pref_keyboard_layout_20100902"; public static final String PREF_KEYBOARD_LAYOUT = "pref_keyboard_layout_20110916";
private static final int[] KEYBOARD_THEMES = { private static final int[] KEYBOARD_THEMES = {
R.style.KeyboardTheme, R.style.KeyboardTheme,
R.style.KeyboardTheme_HighContrast, R.style.KeyboardTheme_HighContrast,
@ -182,8 +182,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha
private static int getKeyboardThemeIndex(Context context, SharedPreferences prefs) { private static int getKeyboardThemeIndex(Context context, SharedPreferences prefs) {
final String defaultThemeId = context.getString(R.string.config_default_keyboard_theme_id); final String defaultThemeId = context.getString(R.string.config_default_keyboard_theme_id);
final String themeId = Settings.ENABLE_EXPERIMENTAL_SETTINGS final String themeId = prefs.getString(PREF_KEYBOARD_LAYOUT, defaultThemeId);
? prefs.getString(PREF_KEYBOARD_LAYOUT, defaultThemeId) : defaultThemeId;
try { try {
final int themeIndex = Integer.valueOf(themeId); final int themeIndex = Integer.valueOf(themeId);
if (themeIndex >= 0 && themeIndex < KEYBOARD_THEMES.length) if (themeIndex >= 0 && themeIndex < KEYBOARD_THEMES.length)