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
This commit is contained in:
Winson Chung
2017-04-26 08:46:24 -07:00
parent fef058d7d0
commit ef16fa9842

View File

@@ -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);
}