resolved conflicts for merge of 36d2d0e7 to master

Change-Id: Ib4b6ef593d7f4ce5b0666f2e0987ee8398cabe12
main
satok 2010-09-07 15:37:32 +09:00
commit e1cb2e4977
4 changed files with 35 additions and 15 deletions

View File

@ -28,4 +28,5 @@
<bool name="config_swipeDisambiguation">true</bool> <bool name="config_swipeDisambiguation">true</bool>
<!-- Whether or not Popup on key press is enabled by default --> <!-- Whether or not Popup on key press is enabled by default -->
<bool name="default_popup_preview">true</bool> <bool name="default_popup_preview">true</bool>
<bool name="default_recorrection_enabled">true</bool>
</resources> </resources>

View File

@ -339,6 +339,10 @@
<string name="prefs_enable_log">Enable user feedback</string> <string name="prefs_enable_log">Enable user feedback</string>
<!-- Description for enabling to send user statistics to Google. --> <!-- Description for enabling to send user statistics to Google. -->
<string name="prefs_description_log">Help improve this input method editor by automatically sending usage statistics and crash reports to Google.</string> <string name="prefs_description_log">Help improve this input method editor by automatically sending usage statistics and crash reports to Google.</string>
<!-- Preferences item for enabling to re-correct suggestions . -->
<string name="prefs_enable_recorrection">Tap to re-correction</string>
<!-- The summary for the preferences item for enabling to re-correct suggestions . -->
<string name="prefs_enable_recorrection_summary">You can re-correct words by tapping words you have typed</string>
<!-- Description for keyboard theme switcher --> <!-- Description for keyboard theme switcher -->
<string name="keyboard_layout">Keyboard Theme</string> <string name="keyboard_layout">Keyboard Theme</string>

View File

@ -37,6 +37,13 @@
android:defaultValue="@bool/default_popup_preview" android:defaultValue="@bool/default_popup_preview"
/> />
<CheckBoxPreference
android:key="recorrection_enabled"
android:title="@string/prefs_enable_recorrection"
android:persistent="true"
android:defaultValue="@bool/default_recorrection_enabled"
/>
<CheckBoxPreference <CheckBoxPreference
android:key="auto_cap" android:key="auto_cap"
android:title="@string/auto_cap" android:title="@string/auto_cap"

View File

@ -127,6 +127,7 @@ public class LatinIME extends InputMethodService
public static final String PREF_SELECTED_LANGUAGES = "selected_languages"; public static final String PREF_SELECTED_LANGUAGES = "selected_languages";
public static final String PREF_INPUT_LANGUAGE = "input_language"; public static final String PREF_INPUT_LANGUAGE = "input_language";
private static final String PREF_RECORRECTION_ENABLED = "recorrection_enabled";
private static final int MSG_UPDATE_SUGGESTIONS = 0; private static final int MSG_UPDATE_SUGGESTIONS = 0;
private static final int MSG_START_TUTORIAL = 1; private static final int MSG_START_TUTORIAL = 1;
@ -193,6 +194,7 @@ public class LatinIME extends InputMethodService
private boolean mAutoSpace; private boolean mAutoSpace;
private boolean mJustAddedAutoSpace; private boolean mJustAddedAutoSpace;
private boolean mAutoCorrectEnabled; private boolean mAutoCorrectEnabled;
private boolean mReCorrectionEnabled;
private boolean mBigramSuggestionEnabled; private boolean mBigramSuggestionEnabled;
private boolean mAutoCorrectOn; private boolean mAutoCorrectOn;
// TODO move this state variable outside LatinIME // TODO move this state variable outside LatinIME
@ -360,6 +362,8 @@ public class LatinIME extends InputMethodService
if (inputLanguage == null) { if (inputLanguage == null) {
inputLanguage = conf.locale.toString(); inputLanguage = conf.locale.toString();
} }
mReCorrectionEnabled = prefs.getBoolean(PREF_RECORRECTION_ENABLED,
getResources().getBoolean(R.bool.default_recorrection_enabled));
LatinIMEUtil.GCUtils.getInstance().reset(); LatinIMEUtil.GCUtils.getInstance().reset();
boolean tryGC = true; boolean tryGC = true;
@ -768,7 +772,7 @@ public class LatinIME extends InputMethodService
mLastSelectionStart = newSelStart; mLastSelectionStart = newSelStart;
mLastSelectionEnd = newSelEnd; mLastSelectionEnd = newSelEnd;
if (mReCorrectionEnabled) {
// Don't look for corrections if the keyboard is not visible // Don't look for corrections if the keyboard is not visible
if (mKeyboardSwitcher != null && mKeyboardSwitcher.getInputView() != null if (mKeyboardSwitcher != null && mKeyboardSwitcher.getInputView() != null
&& mKeyboardSwitcher.getInputView().isShown()) { && mKeyboardSwitcher.getInputView().isShown()) {
@ -787,6 +791,7 @@ public class LatinIME extends InputMethodService
} }
} }
} }
}
@Override @Override
public void hideWindow() { public void hideWindow() {
@ -2180,6 +2185,9 @@ public class LatinIME extends InputMethodService
if (PREF_SELECTED_LANGUAGES.equals(key)) { if (PREF_SELECTED_LANGUAGES.equals(key)) {
mLanguageSwitcher.loadLocales(sharedPreferences); mLanguageSwitcher.loadLocales(sharedPreferences);
mRefreshKeyboardRequired = true; mRefreshKeyboardRequired = true;
} else if (PREF_RECORRECTION_ENABLED.equals(key)) {
mReCorrectionEnabled = sharedPreferences.getBoolean(PREF_RECORRECTION_ENABLED,
getResources().getBoolean(R.bool.default_recorrection_enabled));
} }
} }