Merge "Fine-tune the insets type of the menu view layer."
This commit is contained in:
committed by
Android (Google) Code Review
commit
2158b4f92d
@@ -136,11 +136,7 @@ class MenuViewAppearance {
|
||||
final Rect draggableBounds = getWindowAvailableBounds();
|
||||
|
||||
// Initializes start position for mapping the translation of the menu view.
|
||||
final WindowMetrics windowMetrics = mWindowManager.getCurrentWindowMetrics();
|
||||
final WindowInsets windowInsets = windowMetrics.getWindowInsets();
|
||||
final Insets displayCutoutInsets = windowInsets.getInsetsIgnoringVisibility(
|
||||
WindowInsets.Type.displayCutout());
|
||||
draggableBounds.offset(-displayCutoutInsets.left, -displayCutoutInsets.top);
|
||||
draggableBounds.offsetTo(/* newLeft= */ 0, /* newTop= */ 0);
|
||||
|
||||
draggableBounds.top += margin;
|
||||
draggableBounds.right -= getMenuWidth();
|
||||
|
||||
@@ -74,7 +74,8 @@ class MenuViewLayerController implements IAccessibilityFloatingMenu {
|
||||
params.receiveInsetsIgnoringZOrder = true;
|
||||
params.privateFlags |= PRIVATE_FLAG_EXCLUDE_FROM_SCREEN_MAGNIFICATION;
|
||||
params.windowAnimations = android.R.style.Animation_Translucent;
|
||||
params.setFitInsetsTypes(WindowInsets.Type.navigationBars());
|
||||
params.setFitInsetsTypes(
|
||||
WindowInsets.Type.systemBars() | WindowInsets.Type.displayCutout());
|
||||
return params;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user