diff options
| author | Satoshi Kataoka <satok@google.com> | 2012-11-06 18:59:23 +0900 |
|---|---|---|
| committer | satok <satok@google.com> | 2012-11-07 22:03:55 +0900 |
| commit | 8b117c85781be106f16a1fecc73d6928e54a985b (patch) | |
| tree | 8dc6ea78bef5965d850a5e1e8805521e32ca6d6b /core/java/android/inputmethodservice/InputMethodService.java | |
| parent | 7ccb280611f885850f1ff8168fc7a4505b92789d (diff) | |
Reduce jankiness of the transition between a text field with FLAG_NO_FULLSCREEN and a text field with FLAG_NO_EXTRACT_UI
Bug: 7393485
Currently, the extract text view blinks at the transition of InputMethodService.
This change reduces this blinking by making the extract text view invisible when the extract text view is hidden.
Change-Id: I9af96058283a9a5b60707d025ad1abbbbc23c16f
Diffstat (limited to 'core/java/android/inputmethodservice/InputMethodService.java')
| -rw-r--r-- | core/java/android/inputmethodservice/InputMethodService.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index f07002e88bbe..6f1cc942c965 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -930,11 +930,13 @@ public class InputMethodService extends AbstractInputMethodService { */ public void onConfigureWindow(Window win, boolean isFullscreen, boolean isCandidatesOnly) { - if (isFullscreen) { - mWindow.getWindow().setLayout(MATCH_PARENT, MATCH_PARENT); - } else { - mWindow.getWindow().setLayout(MATCH_PARENT, WRAP_CONTENT); + final int currentHeight = mWindow.getWindow().getAttributes().height; + final int newHeight = isFullscreen ? MATCH_PARENT : WRAP_CONTENT; + if (mIsInputViewShown && currentHeight != newHeight) { + Log.w(TAG, "Window size has been changed. This may cause jankiness of resizing window: " + + currentHeight + " -> " + newHeight); } + mWindow.getWindow().setLayout(MATCH_PARENT, newHeight); } /** @@ -997,10 +999,11 @@ public class InputMethodService extends AbstractInputMethodService { } void updateExtractFrameVisibility() { - int vis; + final int vis; if (isFullscreenMode()) { vis = mExtractViewHidden ? View.INVISIBLE : View.VISIBLE; - mExtractFrame.setVisibility(View.VISIBLE); + // "vis" should be applied for the extract frame as well in the fullscreen mode. + mExtractFrame.setVisibility(vis); } else { vis = View.VISIBLE; mExtractFrame.setVisibility(View.GONE); |
