diff options
Diffstat (limited to 'java/src/com/android/inputmethod/latin/LatinKeyboardView.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/LatinKeyboardView.java | 16 |
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(); } |