summaryrefslogtreecommitdiff
path: root/java/src/com/android/inputmethod/keyboard/KeyboardView.java
diff options
context:
space:
mode:
authorTadashi G. Takaoka <takaoka@google.com>2011-04-15 07:24:19 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-04-15 07:24:19 -0700
commit8cd0acba6d3fbde8034b3ef5d26344003a40fa11 (patch)
tree5484d7837fe4dc5cdd9270f2f6f58bd9abf596da /java/src/com/android/inputmethod/keyboard/KeyboardView.java
parent4f6e646352e69e04a8a0a80b1470c917ef1a0221 (diff)
parent6fb97bf71cee2a0775410a05478ed6a667aa847f (diff)
Merge "Don't show spacebar preview if key preview is disabled"
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/KeyboardView.java')
-rw-r--r--java/src/com/android/inputmethod/keyboard/KeyboardView.java13
1 files changed, 2 insertions, 11 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
index a140a974d..3550dcbb0 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java
@@ -18,7 +18,6 @@ package com.android.inputmethod.keyboard;
import com.android.inputmethod.latin.LatinImeLogger;
import com.android.inputmethod.latin.R;
-import com.android.inputmethod.latin.SubtypeSwitcher;
import android.content.Context;
import android.content.pm.PackageManager;
@@ -224,7 +223,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
public void popupPreview(long delay, int keyIndex, PointerTracker tracker) {
removeMessages(MSG_POPUP_PREVIEW);
- if (mPreviewText.getVisibility() == VISIBLE) {
+ if (mPreviewText.getVisibility() == VISIBLE || delay == 0) {
// Show right away, if it's already visible and finger is moving around
showKey(keyIndex, tracker);
} else {
@@ -889,15 +888,7 @@ public class KeyboardView extends View implements PointerTracker.UIProxy {
public void showPreview(int keyIndex, PointerTracker tracker) {
int oldKeyIndex = mOldPreviewKeyIndex;
mOldPreviewKeyIndex = keyIndex;
- // We should re-draw popup preview when 1) we need to hide the preview, 2) we will show
- // the space key preview and 3) pointer moves off the space key to other letter key, we
- // should hide the preview of the previous key.
- final boolean hidePreviewOrShowSpaceKeyPreview = (tracker == null)
- || (SubtypeSwitcher.getInstance().useSpacebarLanguageSwitcher()
- && SubtypeSwitcher.getInstance().needsToDisplayLanguage()
- && (tracker.isSpaceKey(keyIndex) || tracker.isSpaceKey(oldKeyIndex)));
- // If key changed and preview is on or the key is space (language switch is enabled)
- if (oldKeyIndex != keyIndex && (mShowPreview || (hidePreviewOrShowSpaceKeyPreview))) {
+ if ((mShowPreview && oldKeyIndex != keyIndex) || mKeyboard.needSpacebarPreview(keyIndex)) {
if (keyIndex == KeyDetector.NOT_A_KEY) {
mHandler.cancelPopupPreview();
mHandler.dismissPreview(mDelayAfterPreview);