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

Commit 41607d5a authored by Adam Powell's avatar Adam Powell
Browse files

Request application of WindowInsets when setting a content view

For both PhoneWindow and VoiceInteractionSession, call
requestApplyInsets when the content view(s) change. This is generally
what the developer expects if the new view tree responds to insets in
any way.

Bug 21620924

Change-Id: I60a88af55bf85217c3587aa37f03fdc3fdce686d
parent 0e5dc780
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1143,7 +1143,7 @@ public class VoiceInteractionSession implements KeyEvent.Callback, ComponentCall
        mContentFrame.addView(view, new FrameLayout.LayoutParams(
                ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT));

        mContentFrame.requestApplyInsets();
    }

    /** @hide */
+3 −0
Original line number Diff line number Diff line
@@ -390,6 +390,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
        } else {
            mLayoutInflater.inflate(layoutResID, mContentParent);
        }
        mContentParent.requestApplyInsets();
        final Callback cb = getCallback();
        if (cb != null && !isDestroyed()) {
            cb.onContentChanged();
@@ -419,6 +420,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
        } else {
            mContentParent.addView(view, params);
        }
        mContentParent.requestApplyInsets();
        final Callback cb = getCallback();
        if (cb != null && !isDestroyed()) {
            cb.onContentChanged();
@@ -435,6 +437,7 @@ public class PhoneWindow extends Window implements MenuBuilder.Callback {
            Log.v(TAG, "addContentView does not support content transitions");
        }
        mContentParent.addView(view, params);
        mContentParent.requestApplyInsets();
        final Callback cb = getCallback();
        if (cb != null && !isDestroyed()) {
            cb.onContentChanged();