aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorKen Wakasa <kwakasa@google.com>2010-06-30 12:38:41 +0900
committerKen Wakasa <kwakasa@google.com>2010-06-30 13:42:36 +0900
commit40c86618c1dab44ccb4fe1ae3e7eee88f4cfb998 (patch)
tree7addf8425b6f4829190a43985cea680a9758c1c2 /java/src
parentf5d9b3d4e4abb0fbe997a0e24f42ff5f273a3a95 (diff)
downloadlatinime-40c86618c1dab44ccb4fe1ae3e7eee88f4cfb998.tar.gz
latinime-40c86618c1dab44ccb4fe1ae3e7eee88f4cfb998.tar.xz
latinime-40c86618c1dab44ccb4fe1ae3e7eee88f4cfb998.zip
No capitalization for inputs from the symbols keyboard. bug: 2220892
Change-Id: I832e855e8882c0ccbc48505acce5b605761cd93a
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java5
-rw-r--r--java/src/com/android/inputmethod/latin/LatinKeyboard.java4
-rw-r--r--java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java2
-rw-r--r--java/src/com/android/inputmethod/latin/LatinKeyboardView.java13
4 files changed, 22 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 5b10e2ce7..b863a708c 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1138,7 +1138,10 @@ public class LatinIME extends InputMethodService
|| keyCodes[0] > Character.MAX_CODE_POINT) {
return;
}
- primaryCode = new String(keyCodes, 0, 1).toUpperCase().charAt(0);
+ primaryCode = keyCodes[0];
+ if (mKeyboardSwitcher.isAlphabetMode()) {
+ primaryCode = Character.toUpperCase(primaryCode);
+ }
}
if (mPredicting) {
if (mKeyboardSwitcher.getInputView().isShifted() && mComposing.length() == 0) {
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboard.java b/java/src/com/android/inputmethod/latin/LatinKeyboard.java
index 3d1e1d3cf..11dd8b7a0 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboard.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboard.java
@@ -274,6 +274,10 @@ public class LatinKeyboard extends Keyboard {
}
}
+ /* package */ boolean isAlphaKeyboard() {
+ return mIsAlphaKeyboard;
+ }
+
public void setExtension(int resId) {
mExtensionResId = resId;
}
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
index 6b8d4f890..7f35ea98e 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboardBaseView.java
@@ -590,7 +590,7 @@ public class LatinKeyboardBaseView extends View implements View.OnClickListener
dismissPopupKeyboard();
}
- private CharSequence adjustCase(CharSequence label) {
+ protected CharSequence adjustCase(CharSequence label) {
if (mKeyboard.isShifted() && label != null && label.length() < 3
&& Character.isLowerCase(label.charAt(0))) {
label = label.toString().toUpperCase();
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
index bfa26f668..bce2cde25 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
@@ -111,6 +111,19 @@ public class LatinKeyboardView extends LatinKeyboardBaseView {
}
}
+ @Override
+ protected CharSequence adjustCase(CharSequence label) {
+ Keyboard keyboard = getKeyboard();
+ if (keyboard.isShifted()
+ && keyboard instanceof LatinKeyboard
+ && ((LatinKeyboard) keyboard).isAlphaKeyboard()
+ && label != null && label.length() < 3
+ && Character.isLowerCase(label.charAt(0))) {
+ label = label.toString().toUpperCase();
+ }
+ return label;
+ }
+
/**
* This function checks to see if we need to handle any sudden jumps in the pointer location
* that could be due to a multi-touch being treated as a move by the firmware or hardware.