Skip to content

Commit 1e29e49

Browse files
satok16Android (Google) Code Review
authored andcommitted
Merge "Reduce jankiness of the transition between a text field with FLAG_NO_FULLSCREEN and a text field with FLAG_NO_EXTRACT_UI" into jb-mr1.1-dev
2 parents 14c8933 + 8b117c8 commit 1e29e49

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

core/java/android/inputmethodservice/InputMethodService.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -930,11 +930,13 @@ public void updateFullscreenMode() {
930930
*/
931931
public void onConfigureWindow(Window win, boolean isFullscreen,
932932
boolean isCandidatesOnly) {
933-
if (isFullscreen) {
934-
mWindow.getWindow().setLayout(MATCH_PARENT, MATCH_PARENT);
935-
} else {
936-
mWindow.getWindow().setLayout(MATCH_PARENT, WRAP_CONTENT);
933+
final int currentHeight = mWindow.getWindow().getAttributes().height;
934+
final int newHeight = isFullscreen ? MATCH_PARENT : WRAP_CONTENT;
935+
if (mIsInputViewShown && currentHeight != newHeight) {
936+
Log.w(TAG, "Window size has been changed. This may cause jankiness of resizing window: "
937+
+ currentHeight + " -> " + newHeight);
937938
}
939+
mWindow.getWindow().setLayout(MATCH_PARENT, newHeight);
938940
}
939941

940942
/**
@@ -997,10 +999,11 @@ public boolean isExtractViewShown() {
997999
}
9981000

9991001
void updateExtractFrameVisibility() {
1000-
int vis;
1002+
final int vis;
10011003
if (isFullscreenMode()) {
10021004
vis = mExtractViewHidden ? View.INVISIBLE : View.VISIBLE;
1003-
mExtractFrame.setVisibility(View.VISIBLE);
1005+
// "vis" should be applied for the extract frame as well in the fullscreen mode.
1006+
mExtractFrame.setVisibility(vis);
10041007
} else {
10051008
vis = View.VISIBLE;
10061009
mExtractFrame.setVisibility(View.GONE);

0 commit comments

Comments
 (0)