Merge "Re-format StatusBarContentInsetsProvider/Test with ktfmt" into main
diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProviderTest.kt b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProviderTest.kt
index 8b6880c..aa6b4ac 100644
--- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProviderTest.kt
+++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProviderTest.kt
@@ -86,7 +86,8 @@
var isRtl = false
var targetRotation = ROTATION_NONE
- var bounds = calculateInsetsForRotationWithRotatedResources(
+ var bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
null,
@@ -97,29 +98,33 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
var chipBounds = getPrivacyChipBoundingRectForInsets(bounds, dotWidth, chipWidth, isRtl)
- /* 1080 - 20 (rounded corner) - 30 (chip),
- * 0 (sb top)
- * 1080 - 20 (rounded corner) + 10 ( dot),
- * 100 (sb height portrait)
- */
+ /*
+ * 1080 - 20 (rounded corner) - 30 (chip),
+ * 0 (sb top)
+ * 1080 - 20 (rounded corner) + 10 ( dot),
+ * 100 (sb height portrait)
+ */
var expected = Rect(1030, 0, 1070, 100)
assertRects(expected, chipBounds, currentRotation, targetRotation)
isRtl = true
chipBounds = getPrivacyChipBoundingRectForInsets(bounds, dotWidth, chipWidth, isRtl)
- /* 0 + 20 (rounded corner) - 10 (dot),
- * 0 (sb top)
- * 0 + 20 (rounded corner) + 30 (chip),
- * 100 (sb height portrait)
- */
+ /*
+ * 0 + 20 (rounded corner) - 10 (dot),
+ * 0 (sb top)
+ * 0 + 20 (rounded corner) + 30 (chip),
+ * 100 (sb height portrait)
+ */
expected = Rect(10, 0, 50, 100)
assertRects(expected, chipBounds, currentRotation, targetRotation)
isRtl = false
targetRotation = ROTATION_LANDSCAPE
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -130,23 +135,26 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
chipBounds = getPrivacyChipBoundingRectForInsets(bounds, dotWidth, chipWidth, isRtl)
- /* 2160 - 20 (rounded corner) - 30 (chip),
- * 0 (sb top)
- * 2160 - 20 (rounded corner) + 10 ( dot),
- * 60 (sb height landscape)
- */
+ /*
+ * 2160 - 20 (rounded corner) - 30 (chip),
+ * 0 (sb top)
+ * 2160 - 20 (rounded corner) + 10 ( dot),
+ * 60 (sb height landscape)
+ */
expected = Rect(2110, 0, 2150, 60)
assertRects(expected, chipBounds, currentRotation, targetRotation)
isRtl = true
chipBounds = getPrivacyChipBoundingRectForInsets(bounds, dotWidth, chipWidth, isRtl)
- /* 0 + 20 (rounded corner) - 10 (dot),
- * 0 (sb top)
- * 0 + 20 (rounded corner) + 30 (chip),
- * 60 (sb height landscape)
- */
+ /*
+ * 0 + 20 (rounded corner) - 10 (dot),
+ * 0 (sb top)
+ * 0 + 20 (rounded corner) + 30 (chip),
+ * 60 (sb height landscape)
+ */
expected = Rect(10, 0, 50, 60)
assertRects(expected, chipBounds, currentRotation, targetRotation)
}
@@ -157,10 +165,10 @@
val dotWidth = 10
val isRtl = false
val contentRect =
- Rect(/* left = */ 0, /* top = */ 10, /* right = */ 1000, /* bottom = */ 100)
+ Rect(/* left = */ 0, /* top = */ 10, /* right = */ 1000, /* bottom = */ 100)
val chipBounds =
- getPrivacyChipBoundingRectForInsets(contentRect, dotWidth, chipWidth, isRtl)
+ getPrivacyChipBoundingRectForInsets(contentRect, dotWidth, chipWidth, isRtl)
assertThat(chipBounds.top).isEqualTo(contentRect.top)
}
@@ -184,12 +192,11 @@
// THEN rotations which share a short side should use the greater value between rounded
// corner padding and the display cutout's size
var targetRotation = ROTATION_NONE
- var expectedBounds = Rect(dcBounds.right,
- 0,
- screenBounds.right - minRightPadding,
- sbHeightPortrait)
+ var expectedBounds =
+ Rect(dcBounds.right, 0, screenBounds.right - minRightPadding, sbHeightPortrait)
- var bounds = calculateInsetsForRotationWithRotatedResources(
+ var bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -200,17 +207,17 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
targetRotation = ROTATION_LANDSCAPE
- expectedBounds = Rect(dcBounds.height(),
- 0,
- screenBounds.height() - minRightPadding,
- sbHeightLandscape)
+ expectedBounds =
+ Rect(dcBounds.height(), 0, screenBounds.height() - minRightPadding, sbHeightLandscape)
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -221,19 +228,19 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
// THEN the side that does NOT share a short side with the display cutout ignores the
// display cutout bounds
targetRotation = ROTATION_UPSIDE_DOWN
- expectedBounds = Rect(minLeftPadding,
- 0,
- screenBounds.width() - minRightPadding,
- sbHeightPortrait)
+ expectedBounds =
+ Rect(minLeftPadding, 0, screenBounds.width() - minRightPadding, sbHeightPortrait)
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -244,18 +251,23 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
// Phone in portrait, seascape (rot_270) bounds
targetRotation = ROTATION_SEASCAPE
- expectedBounds = Rect(minLeftPadding,
+ expectedBounds =
+ Rect(
+ minLeftPadding,
0,
screenBounds.height() - dcBounds.height() - dotWidth,
- sbHeightLandscape)
+ sbHeightLandscape
+ )
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -266,7 +278,8 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
}
@@ -292,12 +305,11 @@
// THEN rotations which share a short side should use the greater value between rounded
// corner padding, the display cutout's size, and the camera protections' size.
var targetRotation = ROTATION_NONE
- var expectedBounds = Rect(protectionBounds.right,
- 0,
- screenBounds.right - minRightPadding,
- sbHeightPortrait)
+ var expectedBounds =
+ Rect(protectionBounds.right, 0, screenBounds.right - minRightPadding, sbHeightPortrait)
- var bounds = calculateInsetsForRotationWithRotatedResources(
+ var bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -308,17 +320,22 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
targetRotation = ROTATION_LANDSCAPE
- expectedBounds = Rect(protectionBounds.bottom,
+ expectedBounds =
+ Rect(
+ protectionBounds.bottom,
0,
screenBounds.height() - minRightPadding,
- sbHeightLandscape)
+ sbHeightLandscape
+ )
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -329,19 +346,19 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
// THEN the side that does NOT share a short side with the display cutout ignores the
// display cutout bounds
targetRotation = ROTATION_UPSIDE_DOWN
- expectedBounds = Rect(minLeftPadding,
- 0,
- screenBounds.width() - minRightPadding,
- sbHeightPortrait)
+ expectedBounds =
+ Rect(minLeftPadding, 0, screenBounds.width() - minRightPadding, sbHeightPortrait)
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -352,18 +369,23 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
// Phone in portrait, seascape (rot_270) bounds
targetRotation = ROTATION_SEASCAPE
- expectedBounds = Rect(minLeftPadding,
+ expectedBounds =
+ Rect(
+ minLeftPadding,
0,
screenBounds.height() - protectionBounds.bottom - dotWidth,
- sbHeightLandscape)
+ sbHeightLandscape
+ )
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -374,7 +396,8 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
}
@@ -428,7 +451,8 @@
bottom = sbHeightPortrait
)
- var bounds = calculateInsetsForRotationWithRotatedResources(
+ var bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -439,7 +463,8 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -453,7 +478,8 @@
bottom = sbHeightLandscape
)
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -464,7 +490,8 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -478,7 +505,8 @@
bottom = sbHeightPortrait
)
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -489,7 +517,8 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
@@ -503,7 +532,8 @@
bottom = sbHeightLandscape
)
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -514,7 +544,8 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
}
@@ -541,7 +572,8 @@
var expectedBounds =
Rect(minLeftPadding, 0, protectionBounds.left - dotWidth, sbHeightPortrait)
- var bounds = calculateInsetsForRotationWithRotatedResources(
+ var bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -552,17 +584,22 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
targetRotation = ROTATION_LANDSCAPE
- expectedBounds = Rect(protectionBounds.bottom,
+ expectedBounds =
+ Rect(
+ protectionBounds.bottom,
0,
screenBounds.height() - minRightPadding,
- sbHeightLandscape)
+ sbHeightLandscape
+ )
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -573,19 +610,19 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
// THEN the side that does NOT share a short side with the display cutout ignores the
// display cutout bounds
targetRotation = ROTATION_UPSIDE_DOWN
- expectedBounds = Rect(minLeftPadding,
- 0,
- screenBounds.width() - minRightPadding,
- sbHeightPortrait)
+ expectedBounds =
+ Rect(minLeftPadding, 0, screenBounds.width() - minRightPadding, sbHeightPortrait)
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -596,18 +633,23 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
// Phone in portrait, seascape (rot_270) bounds
targetRotation = ROTATION_SEASCAPE
- expectedBounds = Rect(minLeftPadding,
+ expectedBounds =
+ Rect(
+ minLeftPadding,
0,
screenBounds.height() - protectionBounds.bottom - dotWidth,
- sbHeightLandscape)
+ sbHeightLandscape
+ )
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -618,7 +660,8 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
}
@@ -627,7 +670,8 @@
fun calculateInsetsForRotationWithRotatedResources_bottomAlignedMarginDisabled_noTopInset() {
setNoCutout()
- val bounds = calculateInsetsForRotationWithRotatedResources(
+ val bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation = ROTATION_NONE,
targetRotation = ROTATION_NONE,
sysUICutout = sysUICutout,
@@ -638,7 +682,8 @@
isRtl = false,
dotWidth = 10,
bottomAlignedMargin = BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight = 15)
+ statusBarContentHeight = 15
+ )
assertThat(bounds.top).isEqualTo(0)
}
@@ -647,7 +692,8 @@
fun calculateInsetsForRotationWithRotatedResources_bottomAlignedMargin_topBasedOnMargin() {
whenever(dc.boundingRects).thenReturn(emptyList())
- val bounds = calculateInsetsForRotationWithRotatedResources(
+ val bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation = ROTATION_NONE,
targetRotation = ROTATION_NONE,
sysUICutout = sysUICutout,
@@ -658,7 +704,8 @@
isRtl = false,
dotWidth = 10,
bottomAlignedMargin = 5,
- statusBarContentHeight = 15)
+ statusBarContentHeight = 15
+ )
// Content in the status bar is centered vertically. To achieve the bottom margin we want,
// we need to "shrink" the height of the status bar until the centered content has the
@@ -694,12 +741,11 @@
// THEN only the landscape/seascape rotations should avoid the cutout area because of the
// potential letterboxing
var targetRotation = ROTATION_NONE
- var expectedBounds = Rect(minLeftPadding,
- 0,
- screenBounds.right - minRightPadding,
- sbHeightPortrait)
+ var expectedBounds =
+ Rect(minLeftPadding, 0, screenBounds.right - minRightPadding, sbHeightPortrait)
- var bounds = calculateInsetsForRotationWithRotatedResources(
+ var bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout = sysUICutout,
@@ -710,17 +756,17 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
targetRotation = ROTATION_LANDSCAPE
- expectedBounds = Rect(dcBounds.height(),
- 0,
- screenBounds.height() - minRightPadding,
- sbHeightLandscape)
+ expectedBounds =
+ Rect(dcBounds.height(), 0, screenBounds.height() - minRightPadding, sbHeightLandscape)
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout = sysUICutout,
@@ -731,17 +777,17 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
targetRotation = ROTATION_UPSIDE_DOWN
- expectedBounds = Rect(minLeftPadding,
- 0,
- screenBounds.right - minRightPadding,
- sbHeightPortrait)
+ expectedBounds =
+ Rect(minLeftPadding, 0, screenBounds.right - minRightPadding, sbHeightPortrait)
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout = sysUICutout,
@@ -752,17 +798,22 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
targetRotation = ROTATION_SEASCAPE
- expectedBounds = Rect(minLeftPadding,
+ expectedBounds =
+ Rect(
+ minLeftPadding,
0,
screenBounds.height() - dcBounds.height() - dotWidth,
- sbHeightLandscape)
+ sbHeightLandscape
+ )
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout = sysUICutout,
@@ -773,7 +824,8 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
}
@@ -793,12 +845,11 @@
// THEN content insets should only use rounded corner padding
var targetRotation = ROTATION_NONE
- var expectedBounds = Rect(minLeftPadding,
- 0,
- screenBounds.right - minRightPadding,
- sbHeightPortrait)
+ var expectedBounds =
+ Rect(minLeftPadding, 0, screenBounds.right - minRightPadding, sbHeightPortrait)
- var bounds = calculateInsetsForRotationWithRotatedResources(
+ var bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
null, /* no cutout */
@@ -809,16 +860,16 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
targetRotation = ROTATION_LANDSCAPE
- expectedBounds = Rect(minLeftPadding,
- 0,
- screenBounds.height() - minRightPadding,
- sbHeightLandscape)
+ expectedBounds =
+ Rect(minLeftPadding, 0, screenBounds.height() - minRightPadding, sbHeightLandscape)
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
null, /* no cutout */
@@ -829,16 +880,16 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
targetRotation = ROTATION_UPSIDE_DOWN
- expectedBounds = Rect(minLeftPadding,
- 0,
- screenBounds.width() - minRightPadding,
- sbHeightPortrait)
+ expectedBounds =
+ Rect(minLeftPadding, 0, screenBounds.width() - minRightPadding, sbHeightPortrait)
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
null, /* no cutout */
@@ -849,16 +900,16 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
targetRotation = ROTATION_LANDSCAPE
- expectedBounds = Rect(minLeftPadding,
- 0,
- screenBounds.height() - minRightPadding,
- sbHeightLandscape)
+ expectedBounds =
+ Rect(minLeftPadding, 0, screenBounds.height() - minRightPadding, sbHeightLandscape)
- bounds = calculateInsetsForRotationWithRotatedResources(
+ bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
null, /* no cutout */
@@ -869,7 +920,8 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
}
@@ -891,12 +943,11 @@
// THEN left should be set to the display cutout width, and right should use the minRight
val targetRotation = ROTATION_NONE
- val expectedBounds = Rect(dcBounds.right,
- 0,
- screenBounds.right - minRightPadding,
- sbHeightPortrait)
+ val expectedBounds =
+ Rect(dcBounds.right, 0, screenBounds.right - minRightPadding, sbHeightPortrait)
- val bounds = calculateInsetsForRotationWithRotatedResources(
+ val bounds =
+ calculateInsetsForRotationWithRotatedResources(
currentRotation,
targetRotation,
sysUICutout,
@@ -907,7 +958,8 @@
isRtl,
dotWidth,
BOTTOM_ALIGNED_MARGIN_NONE,
- statusBarContentHeight)
+ statusBarContentHeight
+ )
assertRects(expectedBounds, bounds, currentRotation, targetRotation)
}
@@ -915,8 +967,14 @@
@Test
fun testDisplayChanged_returnsUpdatedInsets() {
// GIVEN: get insets on the first display and switch to the second display
- val provider = StatusBarContentInsetsProvider(contextMock, configurationController,
- mock<DumpManager>(), mock<CommandRegistry>(), mock<SysUICutoutProvider>())
+ val provider =
+ StatusBarContentInsetsProvider(
+ contextMock,
+ configurationController,
+ mock<DumpManager>(),
+ mock<CommandRegistry>(),
+ mock<SysUICutoutProvider>()
+ )
configuration.windowConfiguration.setMaxBounds(Rect(0, 0, 1080, 2160))
val firstDisplayInsets = provider.getStatusBarContentAreaForRotation(ROTATION_NONE)
@@ -934,12 +992,17 @@
fun testDisplayChangedAndReturnedBack_returnsTheSameInsets() {
// GIVEN: get insets on the first display, switch to the second display,
// get insets and switch back
- val provider = StatusBarContentInsetsProvider(contextMock, configurationController,
- mock<DumpManager>(), mock<CommandRegistry>(), mock<SysUICutoutProvider>())
+ val provider =
+ StatusBarContentInsetsProvider(
+ contextMock,
+ configurationController,
+ mock<DumpManager>(),
+ mock<CommandRegistry>(),
+ mock<SysUICutoutProvider>()
+ )
configuration.windowConfiguration.setMaxBounds(Rect(0, 0, 1080, 2160))
- val firstDisplayInsetsFirstCall = provider
- .getStatusBarContentAreaForRotation(ROTATION_NONE)
+ val firstDisplayInsetsFirstCall = provider.getStatusBarContentAreaForRotation(ROTATION_NONE)
configuration.windowConfiguration.setMaxBounds(Rect(0, 0, 800, 600))
provider.getStatusBarContentAreaForRotation(ROTATION_NONE)
@@ -947,8 +1010,8 @@
configuration.windowConfiguration.setMaxBounds(Rect(0, 0, 1080, 2160))
// WHEN: get insets on the first display again
- val firstDisplayInsetsSecondCall = provider
- .getStatusBarContentAreaForRotation(ROTATION_NONE)
+ val firstDisplayInsetsSecondCall =
+ provider.getStatusBarContentAreaForRotation(ROTATION_NONE)
// THEN: insets for the first and second calls for the first display are the same
assertThat(firstDisplayInsetsFirstCall).isEqualTo(firstDisplayInsetsSecondCall)
@@ -960,15 +1023,22 @@
// Start out with an existing configuration with bounds
configuration.windowConfiguration.setMaxBounds(0, 0, 100, 100)
configurationController.onConfigurationChanged(configuration)
- val provider = StatusBarContentInsetsProvider(contextMock, configurationController,
- mock<DumpManager>(), mock<CommandRegistry>(), mock<SysUICutoutProvider>())
- val listener = object : StatusBarContentInsetsChangedListener {
- var triggered = false
+ val provider =
+ StatusBarContentInsetsProvider(
+ contextMock,
+ configurationController,
+ mock<DumpManager>(),
+ mock<CommandRegistry>(),
+ mock<SysUICutoutProvider>()
+ )
+ val listener =
+ object : StatusBarContentInsetsChangedListener {
+ var triggered = false
- override fun onStatusBarContentInsetsChanged() {
- triggered = true
+ override fun onStatusBarContentInsetsChanged() {
+ triggered = true
+ }
}
- }
provider.addCallback(listener)
// WHEN the config is updated with new bounds
@@ -982,15 +1052,22 @@
@Test
fun onDensityOrFontScaleChanged_listenerNotified() {
configuration.densityDpi = 12
- val provider = StatusBarContentInsetsProvider(contextMock, configurationController,
- mock<DumpManager>(), mock<CommandRegistry>(), mock<SysUICutoutProvider>())
- val listener = object : StatusBarContentInsetsChangedListener {
- var triggered = false
+ val provider =
+ StatusBarContentInsetsProvider(
+ contextMock,
+ configurationController,
+ mock<DumpManager>(),
+ mock<CommandRegistry>(),
+ mock<SysUICutoutProvider>()
+ )
+ val listener =
+ object : StatusBarContentInsetsChangedListener {
+ var triggered = false
- override fun onStatusBarContentInsetsChanged() {
- triggered = true
+ override fun onStatusBarContentInsetsChanged() {
+ triggered = true
+ }
}
- }
provider.addCallback(listener)
// WHEN the config is updated
@@ -1003,15 +1080,22 @@
@Test
fun onThemeChanged_listenerNotified() {
- val provider = StatusBarContentInsetsProvider(contextMock, configurationController,
- mock<DumpManager>(), mock<CommandRegistry>(), mock<SysUICutoutProvider>())
- val listener = object : StatusBarContentInsetsChangedListener {
- var triggered = false
+ val provider =
+ StatusBarContentInsetsProvider(
+ contextMock,
+ configurationController,
+ mock<DumpManager>(),
+ mock<CommandRegistry>(),
+ mock<SysUICutoutProvider>()
+ )
+ val listener =
+ object : StatusBarContentInsetsChangedListener {
+ var triggered = false
- override fun onStatusBarContentInsetsChanged() {
- triggered = true
+ override fun onStatusBarContentInsetsChanged() {
+ triggered = true
+ }
}
- }
provider.addCallback(listener)
configurationController.notifyThemeChanged()
@@ -1027,7 +1111,7 @@
@Rotation targetRotation: Int
) {
assertTrue(
- "Rects must match. currentRotation=${RotationUtils.toString(currentRotation)}" +
+ "Rects must match. currentRotation=${RotationUtils.toString(currentRotation)}" +
" targetRotation=${RotationUtils.toString(targetRotation)}" +
" expected=$expected actual=$actual",
expected.equals(actual)
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt
index ac203db..323ab80 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBarContentInsetsProvider.kt
@@ -27,11 +27,17 @@
import android.view.DisplayCutout
import android.view.Surface
import androidx.annotation.VisibleForTesting
+import com.android.app.tracing.traceSection
import com.android.internal.policy.SystemBarUtils
+import com.android.systemui.BottomMarginCommand
import com.android.systemui.Dumpable
+import com.android.systemui.StatusBarInsetsCommand
+import com.android.systemui.SysUICutoutInformation
+import com.android.systemui.SysUICutoutProvider
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.dump.DumpManager
import com.android.systemui.res.R
+import com.android.systemui.statusbar.commandline.CommandRegistry
import com.android.systemui.statusbar.policy.CallbackController
import com.android.systemui.statusbar.policy.ConfigurationController
import com.android.systemui.util.leak.RotationUtils.ROTATION_LANDSCAPE
@@ -41,12 +47,6 @@
import com.android.systemui.util.leak.RotationUtils.Rotation
import com.android.systemui.util.leak.RotationUtils.getExactRotation
import com.android.systemui.util.leak.RotationUtils.getResourcesForRotation
-import com.android.app.tracing.traceSection
-import com.android.systemui.BottomMarginCommand
-import com.android.systemui.StatusBarInsetsCommand
-import com.android.systemui.SysUICutoutInformation
-import com.android.systemui.SysUICutoutProvider
-import com.android.systemui.statusbar.commandline.CommandRegistry
import java.io.PrintWriter
import java.lang.Math.max
import javax.inject.Inject
@@ -54,45 +54,53 @@
/**
* Encapsulates logic that can solve for the left/right insets required for the status bar contents.
* Takes into account:
- * 1. rounded_corner_content_padding
- * 2. status_bar_padding_start, status_bar_padding_end
- * 2. display cutout insets from left or right
- * 3. waterfall insets
+ * 1. rounded_corner_content_padding
+ * 2. status_bar_padding_start, status_bar_padding_end
+ * 2. display cutout insets from left or right
+ * 3. waterfall insets
*
+ * Importantly, these functions can determine status bar content left/right insets for any rotation
+ * before having done a layout pass in that rotation.
*
- * Importantly, these functions can determine status bar content left/right insets for any rotation
- * before having done a layout pass in that rotation.
- *
- * NOTE: This class is not threadsafe
+ * NOTE: This class is not threadsafe
*/
@SysUISingleton
-class StatusBarContentInsetsProvider @Inject constructor(
+class StatusBarContentInsetsProvider
+@Inject
+constructor(
val context: Context,
val configurationController: ConfigurationController,
val dumpManager: DumpManager,
val commandRegistry: CommandRegistry,
val sysUICutoutProvider: SysUICutoutProvider,
-) : CallbackController<StatusBarContentInsetsChangedListener>,
- ConfigurationController.ConfigurationListener,
- Dumpable {
+) :
+ CallbackController<StatusBarContentInsetsChangedListener>,
+ ConfigurationController.ConfigurationListener,
+ Dumpable {
// Limit cache size as potentially we may connect large number of displays
// (e.g. network displays)
private val insetsCache = LruCache<CacheKey, Rect>(MAX_CACHE_SIZE)
private val listeners = mutableSetOf<StatusBarContentInsetsChangedListener>()
- private val isPrivacyDotEnabled: Boolean by lazy(LazyThreadSafetyMode.PUBLICATION) {
- context.resources.getBoolean(R.bool.config_enablePrivacyDot)
- }
+ private val isPrivacyDotEnabled: Boolean by
+ lazy(LazyThreadSafetyMode.PUBLICATION) {
+ context.resources.getBoolean(R.bool.config_enablePrivacyDot)
+ }
init {
configurationController.addCallback(this)
dumpManager.registerDumpable(TAG, this)
commandRegistry.registerCommand(StatusBarInsetsCommand.NAME) {
- StatusBarInsetsCommand(object : StatusBarInsetsCommand.Callback {
- override fun onExecute(command: StatusBarInsetsCommand, printWriter: PrintWriter) {
- executeCommand(command, printWriter)
+ StatusBarInsetsCommand(
+ object : StatusBarInsetsCommand.Callback {
+ override fun onExecute(
+ command: StatusBarInsetsCommand,
+ printWriter: PrintWriter
+ ) {
+ executeCommand(command, printWriter)
+ }
}
- })
+ )
}
}
@@ -122,15 +130,13 @@
}
private fun notifyInsetsChanged() {
- listeners.forEach {
- it.onStatusBarContentInsetsChanged()
- }
+ listeners.forEach { it.onStatusBarContentInsetsChanged() }
}
/**
- * Some views may need to care about whether or not the current top display cutout is located
- * in the corner rather than somewhere in the center. In the case of a corner cutout, the
- * status bar area is contiguous.
+ * Some views may need to care about whether or not the current top display cutout is located in
+ * the corner rather than somewhere in the center. In the case of a corner cutout, the status
+ * bar area is contiguous.
*/
fun currentRotationHasCornerCutout(): Boolean {
val cutout = checkNotNull(context.display).cutout ?: return false
@@ -147,8 +153,8 @@
* dot in the coordinates relative to the given rotation.
*
* @param rotation the rotation for which the bounds are required. This is an absolute value
- * (i.e., ROTATION_NONE will always return the same bounds regardless of the context
- * from which this method is called)
+ * (i.e., ROTATION_NONE will always return the same bounds regardless of the context from
+ * which this method is called)
*/
fun getBoundingRectForPrivacyChipForRotation(
@Rotation rotation: Int,
@@ -163,8 +169,8 @@
val rotatedResources = getResourcesForRotation(rotation, context)
val dotWidth = rotatedResources.getDimensionPixelSize(R.dimen.ongoing_appops_dot_diameter)
- val chipWidth = rotatedResources.getDimensionPixelSize(
- R.dimen.ongoing_appops_chip_max_width)
+ val chipWidth =
+ rotatedResources.getDimensionPixelSize(R.dimen.ongoing_appops_chip_max_width)
val isRtl = configurationController.isLayoutRtl
return getPrivacyChipBoundingRectForInsets(insets, dotWidth, chipWidth, isRtl)
@@ -190,14 +196,21 @@
point.orientToRotZero(getExactRotation(context))
val width = point.logicalWidth(rotation)
- val area = insetsCache[key] ?: getAndSetCalculatedAreaForRotation(
- rotation, sysUICutout, getResourcesForRotation(rotation, context), key)
+ val area =
+ insetsCache[key]
+ ?: getAndSetCalculatedAreaForRotation(
+ rotation,
+ sysUICutout,
+ getResourcesForRotation(rotation, context),
+ key
+ )
Insets.of(area.left, area.top, /* right= */ width - area.right, /* bottom= */ 0)
}
/**
* Calculate the insets for the status bar content in the device's current rotation
+ *
* @see getStatusBarContentAreaForRotation
*/
fun getStatusBarContentInsetsForCurrentRotation(): Insets {
@@ -205,27 +218,28 @@
}
/**
- * Calculates the area of the status bar contents invariant of the current device rotation,
- * in the target rotation's coordinates
+ * Calculates the area of the status bar contents invariant of the current device rotation, in
+ * the target rotation's coordinates
*
* @param rotation the rotation for which the bounds are required. This is an absolute value
- * (i.e., ROTATION_NONE will always return the same bounds regardless of the context
- * from which this method is called)
+ * (i.e., ROTATION_NONE will always return the same bounds regardless of the context from
+ * which this method is called)
*/
@JvmOverloads
- fun getStatusBarContentAreaForRotation(
- @Rotation rotation: Int
- ): Rect {
+ fun getStatusBarContentAreaForRotation(@Rotation rotation: Int): Rect {
val sysUICutout = sysUICutoutProvider.cutoutInfoForCurrentDisplay()
val displayCutout = sysUICutout?.cutout
val key = getCacheKey(rotation, displayCutout)
- return insetsCache[key] ?: getAndSetCalculatedAreaForRotation(
- rotation, sysUICutout, getResourcesForRotation(rotation, context), key)
+ return insetsCache[key]
+ ?: getAndSetCalculatedAreaForRotation(
+ rotation,
+ sysUICutout,
+ getResourcesForRotation(rotation, context),
+ key
+ )
}
- /**
- * Get the status bar content area for the given rotation, in absolute bounds
- */
+ /** Get the status bar content area for the given rotation, in absolute bounds */
fun getStatusBarContentAreaForCurrentRotation(): Rect {
val rotation = getExactRotation(context)
return getStatusBarContentAreaForRotation(rotation)
@@ -237,10 +251,9 @@
rotatedResources: Resources,
key: CacheKey
): Rect {
- return getCalculatedAreaForRotation(sysUICutout, targetRotation, rotatedResources)
- .also {
- insetsCache.put(key, it)
- }
+ return getCalculatedAreaForRotation(sysUICutout, targetRotation, rotatedResources).also {
+ insetsCache.put(key, it)
+ }
}
private fun getCalculatedAreaForRotation(
@@ -250,12 +263,14 @@
): Rect {
val currentRotation = getExactRotation(context)
- val roundedCornerPadding = rotatedResources
- .getDimensionPixelSize(R.dimen.rounded_corner_content_padding)
- val minDotPadding = if (isPrivacyDotEnabled)
+ val roundedCornerPadding =
+ rotatedResources.getDimensionPixelSize(R.dimen.rounded_corner_content_padding)
+ val minDotPadding =
+ if (isPrivacyDotEnabled)
rotatedResources.getDimensionPixelSize(R.dimen.ongoing_appops_dot_min_padding)
else 0
- val dotWidth = if (isPrivacyDotEnabled)
+ val dotWidth =
+ if (isPrivacyDotEnabled)
rotatedResources.getDimensionPixelSize(R.dimen.ongoing_appops_dot_diameter)
else 0
@@ -271,20 +286,21 @@
val bottomAlignedMargin = getBottomAlignedMargin(targetRotation, rotatedResources)
val statusBarContentHeight =
- rotatedResources.getDimensionPixelSize(R.dimen.status_bar_icon_size_sp)
+ rotatedResources.getDimensionPixelSize(R.dimen.status_bar_icon_size_sp)
return calculateInsetsForRotationWithRotatedResources(
- currentRotation,
- targetRotation,
- sysUICutout,
- context.resources.configuration.windowConfiguration.maxBounds,
- SystemBarUtils.getStatusBarHeightForRotation(context, targetRotation),
- minLeft,
- minRight,
- configurationController.isLayoutRtl,
- dotWidth,
- bottomAlignedMargin,
- statusBarContentHeight)
+ currentRotation,
+ targetRotation,
+ sysUICutout,
+ context.resources.configuration.windowConfiguration.maxBounds,
+ SystemBarUtils.getStatusBarHeightForRotation(context, targetRotation),
+ minLeft,
+ minRight,
+ configurationController.isLayoutRtl,
+ dotWidth,
+ bottomAlignedMargin,
+ statusBarContentHeight
+ )
}
private fun executeCommand(command: StatusBarInsetsCommand, printWriter: PrintWriter) {
@@ -295,7 +311,7 @@
val rotation = command.rotationValue
if (rotation == null) {
printWriter.println(
- "Rotation should be one of ${BottomMarginCommand.ROTATION_DEGREES_OPTIONS}"
+ "Rotation should be one of ${BottomMarginCommand.ROTATION_DEGREES_OPTIONS}"
)
return
}
@@ -323,13 +339,13 @@
return override
}
val dimenRes =
- when (targetRotation) {
- Surface.ROTATION_0 -> R.dimen.status_bar_bottom_aligned_margin_rotation_0
- Surface.ROTATION_90 -> R.dimen.status_bar_bottom_aligned_margin_rotation_90
- Surface.ROTATION_180 -> R.dimen.status_bar_bottom_aligned_margin_rotation_180
- Surface.ROTATION_270 -> R.dimen.status_bar_bottom_aligned_margin_rotation_270
- else -> throw IllegalStateException("Unknown rotation: $targetRotation")
- }
+ when (targetRotation) {
+ Surface.ROTATION_0 -> R.dimen.status_bar_bottom_aligned_margin_rotation_0
+ Surface.ROTATION_90 -> R.dimen.status_bar_bottom_aligned_margin_rotation_90
+ Surface.ROTATION_180 -> R.dimen.status_bar_bottom_aligned_margin_rotation_180
+ Surface.ROTATION_270 -> R.dimen.status_bar_bottom_aligned_margin_rotation_270
+ else -> throw IllegalStateException("Unknown rotation: $targetRotation")
+ }
return resources.getDimensionPixelSize(dimenRes)
}
@@ -339,17 +355,12 @@
}
override fun dump(pw: PrintWriter, args: Array<out String>) {
- insetsCache.snapshot().forEach { (key, rect) ->
- pw.println("$key -> $rect")
- }
+ insetsCache.snapshot().forEach { (key, rect) -> pw.println("$key -> $rect") }
pw.println(insetsCache)
pw.println("Bottom margin overrides: $marginBottomOverrides")
}
- private fun getCacheKey(
- @Rotation rotation: Int,
- displayCutout: DisplayCutout?
- ): CacheKey =
+ private fun getCacheKey(@Rotation rotation: Int, displayCutout: DisplayCutout?): CacheKey =
CacheKey(
rotation = rotation,
displaySize = Rect(context.resources.configuration.windowConfiguration.maxBounds),
@@ -387,15 +398,19 @@
isRtl: Boolean
): Rect {
return if (isRtl) {
- Rect(contentRect.left - dotWidth,
- contentRect.top,
- contentRect.left + chipWidth,
- contentRect.bottom)
+ Rect(
+ contentRect.left - dotWidth,
+ contentRect.top,
+ contentRect.left + chipWidth,
+ contentRect.bottom
+ )
} else {
- Rect(contentRect.right - chipWidth,
- contentRect.top,
- contentRect.right + dotWidth,
- contentRect.bottom)
+ Rect(
+ contentRect.right - chipWidth,
+ contentRect.top,
+ contentRect.right + dotWidth,
+ contentRect.bottom
+ )
}
}
@@ -439,20 +454,21 @@
val rotZeroBounds = getRotationZeroDisplayBounds(maxBounds, currentRotation)
return getStatusBarContentBounds(
- sysUICutout,
- statusBarHeight,
- rotZeroBounds.right,
- rotZeroBounds.bottom,
- maxBounds.width(),
- maxBounds.height(),
- minLeft,
- minRight,
- isRtl,
- dotWidth,
- targetRotation,
- currentRotation,
- bottomAlignedMargin,
- statusBarContentHeight)
+ sysUICutout,
+ statusBarHeight,
+ rotZeroBounds.right,
+ rotZeroBounds.bottom,
+ maxBounds.width(),
+ maxBounds.height(),
+ minLeft,
+ minRight,
+ isRtl,
+ dotWidth,
+ targetRotation,
+ currentRotation,
+ bottomAlignedMargin,
+ statusBarContentHeight
+ )
}
/**
@@ -470,31 +486,30 @@
* @param dotWidth privacy dot image width (0 if privacy dot is disabled)
* @param targetRotation the rotation for which to calculate margins
* @param currentRotation the rotation from which the display cutout was generated
- *
* @return a Rect which exactly calculates the Status Bar's content rect relative to the target
- * rotation
+ * rotation
*/
private fun getStatusBarContentBounds(
- sysUICutout: SysUICutoutInformation?,
- sbHeight: Int,
- width: Int,
- height: Int,
- cWidth: Int,
- cHeight: Int,
- minLeft: Int,
- minRight: Int,
- isRtl: Boolean,
- dotWidth: Int,
- @Rotation targetRotation: Int,
- @Rotation currentRotation: Int,
- bottomAlignedMargin: Int,
- statusBarContentHeight: Int
+ sysUICutout: SysUICutoutInformation?,
+ sbHeight: Int,
+ width: Int,
+ height: Int,
+ cWidth: Int,
+ cHeight: Int,
+ minLeft: Int,
+ minRight: Int,
+ isRtl: Boolean,
+ dotWidth: Int,
+ @Rotation targetRotation: Int,
+ @Rotation currentRotation: Int,
+ bottomAlignedMargin: Int,
+ statusBarContentHeight: Int
): Rect {
val insetTop = getInsetTop(bottomAlignedMargin, statusBarContentHeight, sbHeight)
val logicalDisplayWidth = if (targetRotation.isHorizontal()) height else width
- // Exclude the bottom rect, as it doesn't intersect with the status bar.
+ // Exclude the bottom rect, as it doesn't intersect with the status bar.
val cutoutRects = sysUICutout?.cutout?.boundingRectsLeftRightTop
if (cutoutRects.isNullOrEmpty()) {
return Rect(minLeft, insetTop, logicalDisplayWidth - minRight, sbHeight)
@@ -580,9 +595,9 @@
*/
@Px
private fun getInsetTop(
- bottomAlignedMargin: Int,
- statusBarContentHeight: Int,
- statusBarHeight: Int
+ bottomAlignedMargin: Int,
+ statusBarContentHeight: Int,
+ statusBarHeight: Int
): Int {
val bottomAlignmentEnabled = bottomAlignedMargin >= 0
if (!bottomAlignmentEnabled) {
@@ -672,7 +687,8 @@
private fun Rect.logicalWidth(@Rotation rot: Int): Int {
return when (rot) {
- ROTATION_NONE, ROTATION_UPSIDE_DOWN -> width()
+ ROTATION_NONE,
+ ROTATION_UPSIDE_DOWN -> width()
else /* LANDSCAPE, SEASCAPE */ -> height()
}
}
@@ -683,7 +699,8 @@
private fun Point.orientToRotZero(@Rotation rot: Int) {
when (rot) {
- ROTATION_NONE, ROTATION_UPSIDE_DOWN -> return
+ ROTATION_NONE,
+ ROTATION_UPSIDE_DOWN -> return
else -> {
// swap width and height to zero-orient bounds
val yTmp = y
@@ -695,7 +712,8 @@
private fun Point.logicalWidth(@Rotation rot: Int): Int {
return when (rot) {
- ROTATION_NONE, ROTATION_UPSIDE_DOWN -> x
+ ROTATION_NONE,
+ ROTATION_UPSIDE_DOWN -> x
else -> y
}
}