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

Commit ef16fa98 authored by Winson Chung's avatar Winson Chung
Browse files

Fix issue with dismiss scrim not spanning full screen

Bug: 37309741
Test: Launch PIP activity, go to landscape, drag and ensure dismiss
      overlay spans fullscreen

Change-Id: I449c9f2bdaf01357ebdb652665e884c1ada5ea46
parent fef058d7
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -69,6 +69,8 @@ public class PipDismissViewController {
            // Create a new view for the dismiss target
            LayoutInflater inflater = LayoutInflater.from(mContext);
            mDismissView = inflater.inflate(R.layout.pip_dismiss_view, null);
            mDismissView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
            mDismissView.forceHasOverlappingRendering(false);

            // Adjust bottom margins of the text
            View text = mDismissView.findViewById(R.id.pip_dismiss_text);
@@ -77,14 +79,16 @@ public class PipDismissViewController {

            // Add the target to the window
            LayoutParams lp =  new LayoutParams(
                    ViewGroup.LayoutParams.MATCH_PARENT, gradientHeight,
                    LayoutParams.MATCH_PARENT, gradientHeight,
                    0, windowSize.y - gradientHeight,
                    LayoutParams.TYPE_SYSTEM_DIALOG,
                    LayoutParams.TYPE_NAVIGATION_BAR_PANEL,
                    LayoutParams.FLAG_LAYOUT_IN_SCREEN
                            | LayoutParams.FLAG_LAYOUT_NO_LIMITS
                            | LayoutParams.FLAG_NOT_TOUCHABLE
                            | LayoutParams.FLAG_NOT_FOCUSABLE,
                            | LayoutParams.FLAG_NOT_FOCUSABLE
                            | LayoutParams.FLAG_HARDWARE_ACCELERATED,
                    PixelFormat.TRANSLUCENT);
            lp.setTitle("pip-dismiss-overlay");
            lp.privateFlags |= WindowManager.LayoutParams.PRIVATE_FLAG_SHOW_FOR_ALL_USERS;
            lp.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL;
            mWindowManager.addView(mDismissView, lp);
        }