From 6d9e273fb587668852cd003502dc7a6dbee94834 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Mon, 2 Dec 2013 18:21:04 +0900 Subject: [PATCH] Separate common config and dimensions resources Change-Id: Ia16880e818927bc3df7292e130b2f7b5efc9776e --- java/res/values-sw540dp/config.xml | 7 +- java/res/values-sw768dp/config.xml | 7 +- java/res/values/config-common.xml | 142 ++++++++++++++++++ java/res/values/config.xml | 104 +------------ .../inputmethod/latin/settings/Settings.java | 9 +- .../latin/settings/SettingsFragment.java | 2 +- 6 files changed, 151 insertions(+), 120 deletions(-) create mode 100644 java/res/values/config-common.xml diff --git a/java/res/values-sw540dp/config.xml b/java/res/values-sw540dp/config.xml index 8d0b7f4e1..ffba0a2ac 100644 --- a/java/res/values-sw540dp/config.xml +++ b/java/res/values-sw540dp/config.xml @@ -20,14 +20,11 @@ - false + false false true - 5 - + 40.0dp false false - false + false false true - 5 - + false diff --git a/java/res/values/config-common.xml b/java/res/values/config-common.xml new file mode 100644 index 000000000..ab16a9045 --- /dev/null +++ b/java/res/values/config-common.xml @@ -0,0 +1,142 @@ + + + + + true + + true + + + 2 + + 100 + 1100 + + 400 + 50 + + 350 + + 35 + 40 + 70 + + 1000 + + true + 100 + + 300 + 700 + 100 + 10 + 5 + 0 + 100 + + + 1200 + + + 8.0dp + + + 100 + -1 + 8.0dp + + 128 + 1dp + + 200 + 100 + 800 + 20 + + 500 + + 150% + + 450 + + 300 + 20 + + 600% + 50% + + 16.6666% + + 100 + 100 + 550% + + 32 + 16 + 12.6dp + 40 + + + 0%p + 0%p + 0.0dp + + + 2dp + + + 3 + 36% + 100 + 300 + + + 12dp + 6dp + 32.0dp + 18% + + + + 9.6dp + + 15 + + 16.0dp + + 6 + 10.0dp + 2.5dp + + + 100 + -1 + + + 3dp + + + 8dp + + 48 + diff --git a/java/res/values/config.xml b/java/res/values/config.xml index 2c56651db..698efa923 100644 --- a/java/res/values/config.xml +++ b/java/res/values/config.xml @@ -22,83 +22,16 @@ false true - true + true true - - true false - true - 100 - 100 - 300 - 100 - 128 - 0 - 100 - 32 - 16 - 1100 - - 2 - 5 - 8.0dp - 8.0dp - 40 - 12.6dp - 35 - 40 - 70 true - - 8.0dp - - - 100 - -1 - 400 - 50 - 300 - 10 - 100 - 700 - - 1200 - 350 false - true - 200 - 100 - 800 - 20 - - 500 - - 150% - - 450 - - 300 - 20 - - 600% - 50% - - 16.6666% - - 100 - 100 - 550% - - 1000 @@ -110,9 +43,6 @@ 8dp - 0%p - 0%p - 1.556%p 4.669%p 6.495%p @@ -128,7 +58,6 @@ 63.36dp -52.8dp - 0.0dp 55% 65% @@ -144,7 +73,6 @@ 4dp 1dp - 2dp 2dp @@ -157,37 +85,15 @@ -26.4dp 40dp - 12dp 40dp - 6dp - 32.0dp 6 90% - 18% 0dp 44dp 6dp 18dp 27dp - 3 - 36% - - - 9.6dp - - 15 - - 16.0dp - - 6 - 10.0dp - 2.5dp - - - 100 - -1 24dp 73dp @@ -200,12 +106,4 @@ 33%p 68%p 21 - 3dp - - - 8dp - - 48 - - 1dp diff --git a/java/src/com/android/inputmethod/latin/settings/Settings.java b/java/src/com/android/inputmethod/latin/settings/Settings.java index f5c1d102c..714c3a97a 100644 --- a/java/src/com/android/inputmethod/latin/settings/Settings.java +++ b/java/src/com/android/inputmethod/latin/settings/Settings.java @@ -27,12 +27,10 @@ import com.android.inputmethod.latin.AudioAndHapticFeedbackManager; import com.android.inputmethod.latin.InputAttributes; import com.android.inputmethod.latin.R; import com.android.inputmethod.latin.utils.AdditionalSubtypeUtils; -import com.android.inputmethod.latin.utils.LocaleUtils; import com.android.inputmethod.latin.utils.ResourceUtils; import com.android.inputmethod.latin.utils.RunInLocale; import com.android.inputmethod.latin.utils.StringUtils; -import java.util.HashMap; import java.util.Locale; import java.util.concurrent.locks.ReentrantLock; @@ -227,16 +225,15 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang res.getBoolean(R.bool.config_default_phrase_gesture_enabled)); } - public static boolean readFromBuildConfigIfToShowKeyPreviewPopupSettingsOption( - final Resources res) { - return res.getBoolean(R.bool.config_enable_show_option_of_key_preview_popup); + public static boolean readFromBuildConfigIfToShowKeyPreviewPopupOption(final Resources res) { + return res.getBoolean(R.bool.config_enable_show_key_preview_popup_option); } public static boolean readKeyPreviewPopupEnabled(final SharedPreferences prefs, final Resources res) { final boolean defaultKeyPreviewPopup = res.getBoolean( R.bool.config_default_key_preview_popup); - if (!readFromBuildConfigIfToShowKeyPreviewPopupSettingsOption(res)) { + if (!readFromBuildConfigIfToShowKeyPreviewPopupOption(res)) { return defaultKeyPreviewPopup; } return prefs.getBoolean(PREF_POPUP_ON, defaultKeyPreviewPopup); diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java b/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java index 2cee130ec..d7a3e95b3 100644 --- a/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java +++ b/java/src/com/android/inputmethod/latin/settings/SettingsFragment.java @@ -169,7 +169,7 @@ public final class SettingsFragment extends InputMethodSettingsFragment removePreference(Settings.PREF_VIBRATION_DURATION_SETTINGS, advancedSettings); } - if (!Settings.readFromBuildConfigIfToShowKeyPreviewPopupSettingsOption(res)) { + if (!Settings.readFromBuildConfigIfToShowKeyPreviewPopupOption(res)) { removePreference(Settings.PREF_POPUP_ON, generalSettings); removePreference(Settings.PREF_KEY_PREVIEW_POPUP_DISMISS_DELAY, advancedSettings); } else {