summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2014-09-06 13:38:52 +0800
committerLinux Build Service Account <lnxbuild@localhost>2014-11-04 08:50:48 -0700
commit803ea5e37b9710d18a2534ea3ebde5554215de3a (patch)
tree5ddb42ccb75c735478e0f3363da7ff03acb8db14
parentddc1ce174c934da578446a120df613f7a0f7f2d8 (diff)
downloadandroid_packages_inputmethods_LatinIME-803ea5e37b9710d18a2534ea3ebde5554215de3a.tar.gz
android_packages_inputmethods_LatinIME-803ea5e37b9710d18a2534ea3ebde5554215de3a.tar.bz2
android_packages_inputmethods_LatinIME-803ea5e37b9710d18a2534ea3ebde5554215de3a.zip
LatinIME: Customize features for regional package.
- Customize auto correction type of input method LatinIME. - Make the button in the lower right corner of the keyboard to be Enter button in MMS. Change-Id: I6eccf7b78258765b52ffa28c9e43fa771e6e0799
-rw-r--r--java/res/values/bools.xml1
-rw-r--r--java/res/values/customize.xml38
-rw-r--r--java/res/xml/key_styles_enter.xml9
-rw-r--r--java/res/xml/prefs_screen_correction.xml2
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardId.java2
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java6
-rw-r--r--java/src/com/android/inputmethod/latin/settings/SettingsValues.java2
7 files changed, 57 insertions, 3 deletions
diff --git a/java/res/values/bools.xml b/java/res/values/bools.xml
index 10d217985..01dd0470e 100644
--- a/java/res/values/bools.xml
+++ b/java/res/values/bools.xml
@@ -21,4 +21,5 @@
<!-- Whether this input method should be used as the default for a locale. Override it
for supported languages. -->
<bool name="im_is_default">false</bool>
+ <bool name="lower_right_corner_is_enter">false</bool>
</resources>
diff --git a/java/res/values/customize.xml b/java/res/values/customize.xml
new file mode 100644
index 000000000..165e2fce2
--- /dev/null
+++ b/java/res/values/customize.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (c) 2014, The Linux Foundation. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+ * Neither the name of The Linux Foundation nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
+BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+-->
+<resources>
+
+ <!--
+ default auto correction mode, 0-off, 1-modest, 2-aggeressive, 3-very aggeressive,
+ default value is 1.
+ -->
+ <string name="auto_correction_threshold_mode_default_index">1</string>
+
+</resources>
diff --git a/java/res/xml/key_styles_enter.xml b/java/res/xml/key_styles_enter.xml
index 564f465e9..f295c4d7b 100644
--- a/java/res/xml/key_styles_enter.xml
+++ b/java/res/xml/key_styles_enter.xml
@@ -254,6 +254,15 @@
latin:styleName="enterKeyStyle"
latin:parentStyle="emojiKeyStyle" />
</case>
+ <!-- Make the button in the lower right corner of the keyboard to be Enter
+ button. -->
+ <case
+ latin:mode="lowerRightCornerIsEnterKey"
+ >
+ <key-style
+ latin:styleName="enterKeyStyle"
+ latin:parentStyle="defaultEnterKeyStyle" />
+ </case>
<case
latin:imeAction="actionGo"
>
diff --git a/java/res/xml/prefs_screen_correction.xml b/java/res/xml/prefs_screen_correction.xml
index dd5ba540c..43f3fb931 100644
--- a/java/res/xml/prefs_screen_correction.xml
+++ b/java/res/xml/prefs_screen_correction.xml
@@ -47,7 +47,7 @@
android:summary="@string/auto_correction_summary"
android:entryValues="@array/auto_correction_threshold_mode_indexes"
android:entries="@array/auto_correction_threshold_modes"
- android:defaultValue="@string/auto_correction_threshold_mode_index_modest"
+ android:defaultValue="@string/auto_correction_threshold_mode_default_index"
android:persistent="true" />
<CheckBoxPreference
android:key="show_suggestions"
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardId.java b/java/src/com/android/inputmethod/keyboard/KeyboardId.java
index 3c1167538..efe292e7b 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardId.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardId.java
@@ -43,6 +43,7 @@ public final class KeyboardId {
public static final int MODE_DATE = 6;
public static final int MODE_TIME = 7;
public static final int MODE_DATETIME = 8;
+ public static final int MODE_LOWER_RIGHT_CORNER_ENTER = 9;
public static final int ELEMENT_ALPHABET = 0;
public static final int ELEMENT_ALPHABET_MANUAL_SHIFTED = 1;
@@ -233,6 +234,7 @@ public final class KeyboardId {
case MODE_DATE: return "date";
case MODE_TIME: return "time";
case MODE_DATETIME: return "datetime";
+ case MODE_LOWER_RIGHT_CORNER_ENTER: return "lowerRightCornerIsEnterKey";
default: return null;
}
}
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java b/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java
index feb79efe9..bd1b49a1a 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardLayoutSet.java
@@ -70,6 +70,7 @@ public final class KeyboardLayoutSet {
private final Context mContext;
private final Params mParams;
+ private static boolean mLowerRightCornerIsEnterKey = false;
// How many layouts we forcibly keep in cache. This only includes ALPHABET (default) and
// ALPHABET_AUTOMATIC_SHIFTED layouts - other layouts may stay in memory in the map of
@@ -238,6 +239,8 @@ public final class KeyboardLayoutSet {
mResources = context.getResources();
final Params params = mParams;
+ mLowerRightCornerIsEnterKey = mResources.getBoolean(
+ R.bool.lower_right_corner_is_enter);
final EditorInfo editorInfo = (ei != null) ? ei : EMPTY_EDITOR_INFO;
params.mMode = getKeyboardMode(editorInfo);
// TODO: Consolidate those with {@link InputAttributes}.
@@ -421,7 +424,8 @@ public final class KeyboardLayoutSet {
} else if (variation == InputType.TYPE_TEXT_VARIATION_URI) {
return KeyboardId.MODE_URL;
} else if (variation == InputType.TYPE_TEXT_VARIATION_SHORT_MESSAGE) {
- return KeyboardId.MODE_IM;
+ return (mLowerRightCornerIsEnterKey ?
+ KeyboardId.MODE_LOWER_RIGHT_CORNER_ENTER : KeyboardId.MODE_IM);
} else if (variation == InputType.TYPE_TEXT_VARIATION_FILTER) {
return KeyboardId.MODE_TEXT;
} else {
diff --git a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
index d8c548d8b..eef8d532d 100644
--- a/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
+++ b/java/src/com/android/inputmethod/latin/settings/SettingsValues.java
@@ -137,7 +137,7 @@ public final class SettingsValues {
&& SubtypeSwitcher.getInstance().isShortcutImeEnabled();
final String autoCorrectionThresholdRawValue = prefs.getString(
Settings.PREF_AUTO_CORRECTION_THRESHOLD,
- res.getString(R.string.auto_correction_threshold_mode_index_modest));
+ res.getString(R.string.auto_correction_threshold_mode_default_index));
mIncludesOtherImesInLanguageSwitchList = Settings.ENABLE_SHOW_LANGUAGE_SWITCH_KEY_SETTINGS
? prefs.getBoolean(Settings.PREF_INCLUDE_OTHER_IMES_IN_LANGUAGE_SWITCH_LIST, false)
: true /* forcibly */;