aboutsummaryrefslogtreecommitdiffstats
path: root/java/src
diff options
context:
space:
mode:
authorsatok <satok@google.com>2012-05-02 17:25:23 +0900
committersatok <satok@google.com>2012-05-02 17:40:10 +0900
commitf4cf5b9952ae331806bf656a6f977a5ece47fe80 (patch)
tree91d24b1916b9a0f95ce745c1253ee4aec2f90a65 /java/src
parentec062159707a5bf3d4145e49f0f3279cbcd727ab (diff)
downloadlatinime-f4cf5b9952ae331806bf656a6f977a5ece47fe80.tar.gz
latinime-f4cf5b9952ae331806bf656a6f977a5ece47fe80.tar.xz
latinime-f4cf5b9952ae331806bf656a6f977a5ece47fe80.zip
Workaround return preserved backing view height when the backing view is not ready
Change-Id: If4f24500ead516c46e6a93a95291e0897548c2f0
Diffstat (limited to 'java/src')
-rw-r--r--java/src/com/android/inputmethod/latin/LatinIME.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index c6381180c..ddb478e12 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -93,6 +93,9 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private static final int QUICK_PRESS = 200;
private static final int PENDING_IMS_CALLBACK_DURATION = 800;
+ // TODO: remove this
+ private static final boolean WORKAROUND_USE_LAST_BACKING_HEIGHT_WHEN_NOT_READY = true;
+ private static int sLastBackingHeight = 0;
/**
* The name of the scheme used by the Package Manager to warn of a new package installation,
@@ -933,8 +936,15 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
// be considered.
// See {@link android.inputmethodservice.InputMethodService#onComputeInsets}.
final int extractHeight = isFullscreenMode() ? mExtractArea.getHeight() : 0;
- final int backingHeight = (mKeyPreviewBackingView.getVisibility() == View.GONE) ? 0
- : mKeyPreviewBackingView.getHeight();
+ final boolean backingGone = mKeyPreviewBackingView.getVisibility() == View.GONE;
+ int backingHeight = backingGone ? 0 : mKeyPreviewBackingView.getHeight();
+ if (WORKAROUND_USE_LAST_BACKING_HEIGHT_WHEN_NOT_READY && !backingGone) {
+ if (backingHeight <= 0) {
+ backingHeight = sLastBackingHeight;
+ } else {
+ sLastBackingHeight = backingHeight;
+ }
+ }
final int suggestionsHeight = (mSuggestionsContainer.getVisibility() == View.GONE) ? 0
: mSuggestionsContainer.getHeight();
final int extraHeight = extractHeight + backingHeight + suggestionsHeight;
@@ -954,6 +964,11 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
}
outInsets.contentTopInsets = touchY;
outInsets.visibleTopInsets = touchY;
+ if (WORKAROUND_USE_LAST_BACKING_HEIGHT_WHEN_NOT_REQADY) {
+ if (LatinImeLogger.sDBG) {
+ Log.i(TAG, "--- insets: " + touchY + "," + backingHeight + "," + suggestionsHeight);
+ }
+ }
}
@Override