Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67c0b1b5 authored by Ian Lake's avatar Ian Lake
Browse files

Relayout when base inner insets change

When using SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN and
fitsSystemWindows="true", there are cases when the
inner insets will change but the content insets will
remain the same.

One case where this happens is when using
windowSoftInputMode="adjustResize|stateHidden",
bringing the keyboard up, hitting the Recents button,
then going back into the app.

By issuing a requestLayout when the base inner insets
change, we ensure that the inner layout is properly
updated, avoiding an empty space where they keyboard
used to be.

Test: Run app from b/37743589#comment6

BUG: 37743589
Change-Id: I7615c51b8f4eee3971b9b95e638011c1d885b3a6
parent 367b880c
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -76,6 +76,7 @@ public class ActionBarOverlayLayout extends ViewGroup implements DecorContentPar
    private final Rect mLastBaseContentInsets = new Rect();
    private final Rect mContentInsets = new Rect();
    private final Rect mBaseInnerInsets = new Rect();
    private final Rect mLastBaseInnerInsets = new Rect();
    private final Rect mInnerInsets = new Rect();
    private final Rect mLastInnerInsets = new Rect();

@@ -323,6 +324,10 @@ public class ActionBarOverlayLayout extends ViewGroup implements DecorContentPar

        mBaseInnerInsets.set(systemInsets);
        computeFitSystemWindows(mBaseInnerInsets, mBaseContentInsets);
        if (!mLastBaseInnerInsets.equals(mBaseInnerInsets)) {
            changed = true;
            mLastBaseContentInsets.set(mBaseContentInsets);
        }
        if (!mLastBaseContentInsets.equals(mBaseContentInsets)) {
            changed = true;
            mLastBaseContentInsets.set(mBaseContentInsets);