Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,26 @@ public void onGlobalLayout() {

FrameLayout.LayoutParams params = (FrameLayout.LayoutParams) getLayoutParams();

boolean isInMultiWindowMode = android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N &&
mActivity.isInMultiWindowMode();

// The keyboard overlap workaround below relies on adjusting the activity root view's bottom
// margin after comparing the bottom spacer against the visible window frame. In Samsung
// floating window mode those measurements can oscillate by a row causing a rapid layout loop.
// Multi-window/floating containers already resize the app bounds themselves, so skip the
// workaround there.
if (isInMultiWindowMode) {
if (params.bottomMargin != 0) {
if (root_view_logging_enabled)
Logger.logVerbose(LOG_TAG, "Resetting bottom margin in multi-window mode");
params.setMargins(0, 0, 0, 0);
setLayoutParams(params);
}
marginBottom = null;
lastMarginBottom = null;
return;
}

// Get the position Rects of the bottom space view and the main window holding it
Rect[] windowAndViewRects = ViewUtils.getWindowAndViewRects(bottomSpaceView, mStatusBarHeight);
if (windowAndViewRects == null)
Expand Down