diff --git a/res/values-cs/bools.xml b/res/values-cs/bools.xml new file mode 100644 index 0000000000000000000000000000000000000000..897f4b3db08e185560911cae40ee9ca2ff9b3f4b --- /dev/null +++ b/res/values-cs/bools.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2008, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<resources> + <bool name="im_is_default">true</bool> +</resources> diff --git a/res/values-de/bools.xml b/res/values-de/bools.xml new file mode 100644 index 0000000000000000000000000000000000000000..897f4b3db08e185560911cae40ee9ca2ff9b3f4b --- /dev/null +++ b/res/values-de/bools.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2008, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<resources> + <bool name="im_is_default">true</bool> +</resources> diff --git a/res/values-es/bools.xml b/res/values-es/bools.xml new file mode 100644 index 0000000000000000000000000000000000000000..897f4b3db08e185560911cae40ee9ca2ff9b3f4b --- /dev/null +++ b/res/values-es/bools.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2008, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<resources> + <bool name="im_is_default">true</bool> +</resources> diff --git a/res/values-fr/bools.xml b/res/values-fr/bools.xml new file mode 100644 index 0000000000000000000000000000000000000000..897f4b3db08e185560911cae40ee9ca2ff9b3f4b --- /dev/null +++ b/res/values-fr/bools.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2008, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<resources> + <bool name="im_is_default">true</bool> +</resources> diff --git a/res/values-it/bools.xml b/res/values-it/bools.xml new file mode 100644 index 0000000000000000000000000000000000000000..897f4b3db08e185560911cae40ee9ca2ff9b3f4b --- /dev/null +++ b/res/values-it/bools.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2008, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<resources> + <bool name="im_is_default">true</bool> +</resources> diff --git a/res/values-nl/bools.xml b/res/values-nl/bools.xml new file mode 100644 index 0000000000000000000000000000000000000000..897f4b3db08e185560911cae40ee9ca2ff9b3f4b --- /dev/null +++ b/res/values-nl/bools.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2008, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<resources> + <bool name="im_is_default">true</bool> +</resources> diff --git a/res/values-pl/bools.xml b/res/values-pl/bools.xml new file mode 100644 index 0000000000000000000000000000000000000000..897f4b3db08e185560911cae40ee9ca2ff9b3f4b --- /dev/null +++ b/res/values-pl/bools.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2008, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<resources> + <bool name="im_is_default">true</bool> +</resources> diff --git a/res/values/bools.xml b/res/values/bools.xml new file mode 100644 index 0000000000000000000000000000000000000000..06aa8f308c604d48f1e7dbd20fbfebb7124b1717 --- /dev/null +++ b/res/values/bools.xml @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- +/* +** +** Copyright 2008, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ +--> +<resources> + <!-- Whether or not auto-correction should be enabled by default --> + <bool name="enable_autocorrect">false</bool> + <!-- Whether this input method should be used as the default for a locale. Override it + for latin languages. --> + <bool name="im_is_default">false</bool> +</resources> diff --git a/res/xml/prefs.xml b/res/xml/prefs.xml index 865269907721fe4a6104107538314365244ac316..2fc82aadbe3b74e5f98ac5dc8c2f7e47ed08a66e 100644 --- a/res/xml/prefs.xml +++ b/res/xml/prefs.xml @@ -62,7 +62,7 @@ android:title="@string/auto_complete" android:summary="@string/auto_complete_summary" android:persistent="true" - android:defaultValue="true" + android:defaultValue="@bool/enable_autocorrect" android:dependency="show_suggestions" /> diff --git a/src/com/android/inputmethod/latin/LatinIME.java b/src/com/android/inputmethod/latin/LatinIME.java index a36ff57472f1f94cdb9247243bf397e70ce1d4c3..f8163758096f361f616503cdcbe088e87818b05a 100644 --- a/src/com/android/inputmethod/latin/LatinIME.java +++ b/src/com/android/inputmethod/latin/LatinIME.java @@ -1005,7 +1005,8 @@ public class LatinIME extends InputMethodService // will continue to work if (AutoText.getSize(mInputView) < 1) mQuickFixes = true; mShowSuggestions = sp.getBoolean(PREF_SHOW_SUGGESTIONS, true) & mQuickFixes; - mAutoComplete = sp.getBoolean(PREF_AUTO_COMPLETE, true) & mShowSuggestions; + mAutoComplete = sp.getBoolean(PREF_AUTO_COMPLETE, + getResources().getBoolean(R.bool.enable_autocorrect)) & mShowSuggestions; mAutoCorrectOn = mSuggest != null && (mAutoComplete || mQuickFixes); mCorrectionMode = mAutoComplete ? 2 : (mQuickFixes ? 1 : 0); }