Fix issue with dismiss scrim not spanning full screen

am: ef16fa9842

Change-Id: I3514eb5bf1a7fe42f55dce5bc84b35d433272096
This commit is contained in:
Winson Chung
2017-04-27 00:48:42 +00:00
committed by android-build-merger

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