aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinIME.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2012-06-08 21:26:25 +0900
committerJean Chalard <jchalard@google.com>2012-06-08 21:26:25 +0900
commitd2736972598eda61a8e40a3d5b26156136e78d66 (patch)
tree2829efa2a49fb679e188372daf3590ee4f08f8e9 /java/src/com/android/inputmethod/latin/LatinIME.java
parent01e3b014bb97e649ff4cf5a58ce8285f7d800cc8 (diff)
downloadlatinime-d2736972598eda61a8e40a3d5b26156136e78d66.tar.gz
latinime-d2736972598eda61a8e40a3d5b26156136e78d66.tar.xz
latinime-d2736972598eda61a8e40a3d5b26156136e78d66.zip
Move suggestion strip visibility to SettingsValues
Change-Id: If34112c69acd5122d87554043d87d8f4dbdf5d15
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinIME.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java30
1 files changed, 1 insertions, 29 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 5b7d6584e..22445a4c6 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -102,21 +102,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
*/
private static final String SCHEME_PACKAGE = "package";
- // TODO: migrate this to SettingsValues
- private int mSuggestionVisibility;
- private static final int SUGGESTION_VISIBILITY_SHOW_VALUE
- = R.string.prefs_suggestion_visibility_show_value;
- private static final int SUGGESTION_VISIBILITY_SHOW_ONLY_PORTRAIT_VALUE
- = R.string.prefs_suggestion_visibility_show_only_portrait_value;
- private static final int SUGGESTION_VISIBILITY_HIDE_VALUE
- = R.string.prefs_suggestion_visibility_hide_value;
-
- private static final int[] SUGGESTION_VISIBILITY_VALUE_ARRAY = new int[] {
- SUGGESTION_VISIBILITY_SHOW_VALUE,
- SUGGESTION_VISIBILITY_SHOW_ONLY_PORTRAIT_VALUE,
- SUGGESTION_VISIBILITY_HIDE_VALUE
- };
-
private static final int SPACE_STATE_NONE = 0;
// Double space: the state where the user pressed space twice quickly, which LatinIME
// resolved as period-space. Undoing this converts the period to a space.
@@ -694,7 +679,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
mSpaceState = SPACE_STATE_NONE;
loadSettings();
- updateSuggestionVisibility(mResources);
if (mSuggest != null && mSettingsValues.mAutoCorrectEnabled) {
mSuggest.setAutoCorrectionThreshold(mSettingsValues.mAutoCorrectionThreshold);
@@ -1650,9 +1634,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
public boolean isShowingSuggestionsStrip() {
- return (mSuggestionVisibility == SUGGESTION_VISIBILITY_SHOW_VALUE)
- || (mSuggestionVisibility == SUGGESTION_VISIBILITY_SHOW_ONLY_PORTRAIT_VALUE
- && mDisplayOrientation == Configuration.ORIENTATION_PORTRAIT);
+ return mSettingsValues.isSuggestionStripVisibleInOrientation(mDisplayOrientation);
}
public boolean isSuggestionsStripVisible() {
@@ -2257,16 +2239,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
};
- private void updateSuggestionVisibility(final Resources res) {
- final String suggestionVisiblityStr = mSettingsValues.mShowSuggestionsSetting;
- for (int visibility : SUGGESTION_VISIBILITY_VALUE_ARRAY) {
- if (suggestionVisiblityStr.equals(res.getString(visibility))) {
- mSuggestionVisibility = visibility;
- break;
- }
- }
- }
-
private void launchSettings() {
launchSettingsClass(SettingsActivity.class);
}