Merge "Rounded corner not align to right on land" into tm-dev
This commit is contained in:
@@ -380,7 +380,7 @@ class ScreenDecorHwcLayer(context: Context, displayDecorationSupport: DisplayDec
|
|||||||
) {
|
) {
|
||||||
if (hasTopRoundedCorner == hasTop &&
|
if (hasTopRoundedCorner == hasTop &&
|
||||||
hasBottomRoundedCorner == hasBottom &&
|
hasBottomRoundedCorner == hasBottom &&
|
||||||
roundedCornerBottomSize == bottomSize &&
|
roundedCornerTopSize == topSize &&
|
||||||
roundedCornerBottomSize == bottomSize) {
|
roundedCornerBottomSize == bottomSize) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -348,7 +348,8 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab
|
|||||||
@Override
|
@Override
|
||||||
public void onDisplayChanged(int displayId) {
|
public void onDisplayChanged(int displayId) {
|
||||||
final int newRotation = mContext.getDisplay().getRotation();
|
final int newRotation = mContext.getDisplay().getRotation();
|
||||||
if (mOverlays != null && mRotation != newRotation) {
|
if ((mOverlays != null || mScreenDecorHwcWindow != null)
|
||||||
|
&& mRotation != newRotation) {
|
||||||
// We cannot immediately update the orientation. Otherwise
|
// We cannot immediately update the orientation. Otherwise
|
||||||
// WindowManager is still deferring layout until it has finished dispatching
|
// WindowManager is still deferring layout until it has finished dispatching
|
||||||
// the config changes, which may cause divergence between what we draw
|
// the config changes, which may cause divergence between what we draw
|
||||||
@@ -362,11 +363,13 @@ public class ScreenDecorations extends CoreStartable implements Tunable , Dumpab
|
|||||||
+ mRotation);
|
+ mRotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < BOUNDS_POSITION_LENGTH; i++) {
|
if (mOverlays != null) {
|
||||||
if (mOverlays[i] != null) {
|
for (int i = 0; i < BOUNDS_POSITION_LENGTH; i++) {
|
||||||
final ViewGroup overlayView = mOverlays[i].getRootView();
|
if (mOverlays[i] != null) {
|
||||||
overlayView.getViewTreeObserver().addOnPreDrawListener(
|
final ViewGroup overlayView = mOverlays[i].getRootView();
|
||||||
new RestartingPreDrawListener(overlayView, i, newRotation));
|
overlayView.getViewTreeObserver().addOnPreDrawListener(
|
||||||
|
new RestartingPreDrawListener(overlayView, i, newRotation));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ private fun Int.toLayoutGravity(@Surface.Rotation rotation: Int): Int = when (ro
|
|||||||
DisplayCutout.BOUNDS_POSITION_LEFT -> Gravity.BOTTOM
|
DisplayCutout.BOUNDS_POSITION_LEFT -> Gravity.BOTTOM
|
||||||
DisplayCutout.BOUNDS_POSITION_TOP -> Gravity.LEFT
|
DisplayCutout.BOUNDS_POSITION_TOP -> Gravity.LEFT
|
||||||
DisplayCutout.BOUNDS_POSITION_RIGHT -> Gravity.TOP
|
DisplayCutout.BOUNDS_POSITION_RIGHT -> Gravity.TOP
|
||||||
else /* DisplayCutout.BOUNDS_POSITION_BOTTOM */ -> Gravity.LEFT
|
else /* DisplayCutout.BOUNDS_POSITION_BOTTOM */ -> Gravity.RIGHT
|
||||||
}
|
}
|
||||||
Surface.ROTATION_270 -> when (this) {
|
Surface.ROTATION_270 -> when (this) {
|
||||||
DisplayCutout.BOUNDS_POSITION_LEFT -> Gravity.TOP
|
DisplayCutout.BOUNDS_POSITION_LEFT -> Gravity.TOP
|
||||||
|
|||||||
Reference in New Issue
Block a user