diff options
| author | Menny Even Danan <menny@evendanan.net> | 2014-01-18 17:21:23 +0000 |
|---|---|---|
| committer | Menny Even Danan <menny@evendanan.net> | 2014-01-18 17:21:23 +0000 |
| commit | dedbc22354de2d762d6b1954e5b73b2125718fc1 (patch) | |
| tree | 56d8307089f4ecf1efefcb9b2e3aeab0c08ad253 /src | |
| parent | e84dfe56e021a4053bd3e16a14a57714c4b53fa9 (diff) | |
| download | AnySoftKeyboard-dedbc22354de2d762d6b1954e5b73b2125718fc1.tar.gz AnySoftKeyboard-dedbc22354de2d762d6b1954e5b73b2125718fc1.tar.bz2 | |
fix for issue #299. For API level 11 or higher, the default settings will be NOT to restart suggetions. Note, this settings is per OS version, so no cloud-backup for this one
Diffstat (limited to 'src')
4 files changed, 19 insertions, 13 deletions
diff --git a/src/main/java/com/anysoftkeyboard/AnySoftKeyboard.java b/src/main/java/com/anysoftkeyboard/AnySoftKeyboard.java index ecc7bcc55..9379b26f1 100644 --- a/src/main/java/com/anysoftkeyboard/AnySoftKeyboard.java +++ b/src/main/java/com/anysoftkeyboard/AnySoftKeyboard.java @@ -819,14 +819,8 @@ public class AnySoftKeyboard extends InputMethodService implements // mCurrentlyAllowSuggestionRestart - workaround for // onInputStart(restarting == true) // mInputView == null - obvious, no? - Log.d(TAG, - "performRestartWordSuggestion: no need to restart - " - + " mPredicting=" + mPredicting - + ", isPredictionOn=" + isPredictionOn() - + ", mAllowSuggestionsRestart=" - + mAllowSuggestionsRestart - + ", mCurrentlyAllowSuggestionRestart=" - + mCurrentlyAllowSuggestionRestart); + Log.d(TAG, "performRestartWordSuggestion: no need to restart: mPredicting=%s, isPredictionOn=%s, mAllowSuggestionsRestart=%s, mCurrentlyAllowSuggestionRestart=%s" + , mPredicting, isPredictionOn(), mAllowSuggestionsRestart, mCurrentlyAllowSuggestionRestart); return false; } else if (!isCursorTouchingWord()) { Log.d(TAG, "User moved cursor to no-man land. Bye bye."); @@ -1019,10 +1013,6 @@ public class AnySoftKeyboard extends InputMethodService implements } private void clearSuggestions() { - /* - * if (mRestartSuggestionsView != null) - * mRestartSuggestionsView.setVisibility(View.GONE); - */ setSuggestions(null, false, false, false); } diff --git a/src/main/java/com/anysoftkeyboard/ConfigurationImpl.java b/src/main/java/com/anysoftkeyboard/ConfigurationImpl.java index 033670afa..8238b3b8f 100644 --- a/src/main/java/com/anysoftkeyboard/ConfigurationImpl.java +++ b/src/main/java/com/anysoftkeyboard/ConfigurationImpl.java @@ -245,7 +245,7 @@ public class ConfigurationImpl implements Configuration, OnSharedPreferenceChang //please note: the default value should be the last version. //upgrading should only be done when actually need to be done. - int configurationVersion = sp.getInt(CONFIGURATION_VERSION, 5); + int configurationVersion = sp.getInt(CONFIGURATION_VERSION, 6); if (configurationVersion < 1) { boolean oldLandscapeFullScreenValue = sp.getBoolean("fullscreen_input_connection_supported", mContext.getResources().getBoolean(R.bool.settings_default_landscape_fullscreen)); @@ -311,6 +311,16 @@ public class ConfigurationImpl implements Configuration, OnSharedPreferenceChang e.putInt(CONFIGURATION_VERSION, 5); e.commit(); } + + if (configurationVersion < 6) { + Editor e = sp.edit(); + Log.i(TAG, "Resetting settings_default_allow_suggestions_restart..."); + //read issue https://github.com/AnySoftKeyboard/AnySoftKeyboard/issues/299 + e.remove(mContext.getString(R.string.settings_key_allow_suggestions_restart)); + //saving config level + e.putInt(CONFIGURATION_VERSION, 6); + e.commit(); + } } public void addChangedListener(OnSharedPreferenceChangeListener listener) { diff --git a/src/main/java/com/anysoftkeyboard/backup/AnyBackupAgent.java b/src/main/java/com/anysoftkeyboard/backup/AnyBackupAgent.java index 6658bd355..f3cf10a92 100644 --- a/src/main/java/com/anysoftkeyboard/backup/AnyBackupAgent.java +++ b/src/main/java/com/anysoftkeyboard/backup/AnyBackupAgent.java @@ -51,6 +51,9 @@ public class AnyBackupAgent extends BackupAgentHelper { //RTL is device specific if (key.equalsIgnoreCase(getApplicationContext().getString(R.string.settings_key_workaround_disable_rtl_fix))) return; + //restart is OS version specific + if (key.equalsIgnoreCase(getApplicationContext().getString(R.string.settings_key_allow_suggestions_restart))) + return; } super.restoreEntity(data); } diff --git a/src/main/res/values-v11/settings_defaults_dont_translate.xml b/src/main/res/values-v11/settings_defaults_dont_translate.xml index f79cf886c..5eeaa1050 100644 --- a/src/main/res/values-v11/settings_defaults_dont_translate.xml +++ b/src/main/res/values-v11/settings_defaults_dont_translate.xml @@ -3,4 +3,7 @@ <!-- DO NOT TRANSLATE --> <!-- Android has working, native RTL support starting with Honeycomb --> <bool name="settings_default_workaround_disable_rtl_fix">true</bool> + <!-- not restarting by default on Honeycomb and later, this is because the OS has a build-in dictionary --> + <bool name="settings_default_allow_suggestions_restart">false</bool> + </resources> |
