Fix app chip split icon position in RTL
Fix: 403284758 Flag: com.android.launcher3.enable_overview_icon_menu Test: Manual, please check b/326377497#comment7. Test: OverviewImageTest Test: OverviewSplitTaskImageTest Change-Id: I217e491355f1221ac1840b2c7c47b1000e1ffe71
This commit is contained in:
@@ -661,7 +661,7 @@ open class LandscapePagedViewHandler : RecentsPagedOrientationHandler {
|
||||
): SplitIconPositions {
|
||||
return if (Flags.enableOverviewIconMenu()) {
|
||||
if (isRtl) {
|
||||
SplitIconPositions(0, -(totalThumbnailHeight - primarySnapshotHeight))
|
||||
SplitIconPositions(-(totalThumbnailHeight - primarySnapshotHeight), 0)
|
||||
} else {
|
||||
SplitIconPositions(0, primarySnapshotHeight + dividerSize)
|
||||
}
|
||||
|
||||
+4
-10
@@ -43,12 +43,12 @@ class LandscapePagedViewHandlerTest {
|
||||
if (isEnabled) {
|
||||
setFlagsRule.enableFlags(
|
||||
Flags.FLAG_ENABLE_GRID_ONLY_OVERVIEW,
|
||||
Flags.FLAG_ENABLE_OVERVIEW_ICON_MENU
|
||||
Flags.FLAG_ENABLE_OVERVIEW_ICON_MENU,
|
||||
)
|
||||
} else {
|
||||
setFlagsRule.disableFlags(
|
||||
Flags.FLAG_ENABLE_GRID_ONLY_OVERVIEW,
|
||||
Flags.FLAG_ENABLE_OVERVIEW_ICON_MENU
|
||||
Flags.FLAG_ENABLE_OVERVIEW_ICON_MENU,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -108,14 +108,8 @@ class LandscapePagedViewHandlerTest {
|
||||
|
||||
val (topLeftY, bottomRightY) = getSplitIconsPosition(isRTL = true)
|
||||
|
||||
// TODO(b/326377497): When started in fake seascape and rotated to landscape,
|
||||
// the icon chips are in RTL and wrongly positioned at the right side of the snapshot.
|
||||
// Top-Left app chip should be placed at the top left of the first snapshot, but because
|
||||
// this issue, it's displayed at the top-right of the second snapshot.
|
||||
// The Bottom-Right app chip is displayed at the top-right of the first snapshot because
|
||||
// of this issue.
|
||||
assertThat(topLeftY).isEqualTo(0)
|
||||
assertThat(bottomRightY).isEqualTo(-316)
|
||||
assertThat(topLeftY).isEqualTo(-316)
|
||||
assertThat(bottomRightY).isEqualTo(0)
|
||||
}
|
||||
|
||||
/** Test updateSplitIconsPosition */
|
||||
|
||||
Reference in New Issue
Block a user