aboutsummaryrefslogtreecommitdiffstats
path: root/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
diff options
context:
space:
mode:
authorsatok <satok@google.com>2010-09-22 23:10:47 +0900
committerJean-Baptiste Queru <jbq@google.com>2010-12-03 13:08:21 -0800
commitb80f171623a11bceb99b563594162d0034b9bde8 (patch)
tree9d6996fe249113dbf24d96f5c6981fe0deeb8918 /java/src/com/android/inputmethod/latin/LatinKeyboardView.java
parent3dbc3a0afacda6a95803e7f15aac5a960f289add (diff)
parent36f64d2bba87ce098513c07814c86b40e5a978bd (diff)
downloadlatinime-b80f171623a11bceb99b563594162d0034b9bde8.tar.gz
latinime-b80f171623a11bceb99b563594162d0034b9bde8.tar.xz
latinime-b80f171623a11bceb99b563594162d0034b9bde8.zip
Merge remote branch 'goog/master' into merge6
Change-Id: If021cd2074cd4c4f6755a7ceaec0e90ea122956c
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinKeyboardView.java')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinKeyboardView.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
index 8f20a22d0..2872f6b46 100644
--- a/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
+++ b/java/src/com/android/inputmethod/latin/LatinKeyboardView.java
@@ -24,6 +24,7 @@ import android.inputmethodservice.Keyboard.Key;
import android.os.Handler;
import android.os.Message;
import android.os.SystemClock;
+import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.MotionEvent;
@@ -52,9 +53,6 @@ public class LatinKeyboardView extends LatinKeyboardBaseView {
/** The y coordinate of the last row */
private int mLastRowY;
- // This is local working variable for onLongPress().
- private int[] mKeyCodes = new int[1];
-
public LatinKeyboardView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@@ -68,6 +66,16 @@ public class LatinKeyboardView extends LatinKeyboardBaseView {
}
@Override
+ public void setPreviewEnabled(boolean previewEnabled) {
+ if (getKeyboard() == mPhoneKeyboard) {
+ // Phone keyboard never shows popup preview (except language switch).
+ super.setPreviewEnabled(false);
+ } else {
+ super.setPreviewEnabled(previewEnabled);
+ }
+ }
+
+ @Override
public void setKeyboard(Keyboard k) {
super.setKeyboard(k);
// One-seventh of the keyboard width seems like a reasonable threshold
@@ -104,7 +112,7 @@ public class LatinKeyboardView extends LatinKeyboardBaseView {
if (keyboard.isShifted()
&& keyboard instanceof LatinKeyboard
&& ((LatinKeyboard) keyboard).isAlphaKeyboard()
- && label != null && label.length() < 3
+ && !TextUtils.isEmpty(label) && label.length() < 3
&& Character.isLowerCase(label.charAt(0))) {
label = label.toString().toUpperCase();
}