Fix translation for secondary split thumbnail in RTL

Fix: 225157531
Test: Swipe up in RTL shows both thumbnails
were expected.

Change-Id: I87d286b6ce6542c7cffadf86e3d4d99a3618f984
This commit is contained in:
Vinit Nayak
2022-03-29 15:41:23 -07:00
parent 4cb55616e2
commit 1322fc3710
4 changed files with 14 additions and 7 deletions
@@ -571,8 +571,8 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
@Override
public void measureGroupedTaskViewThumbnailBounds(View primarySnapshot, View secondarySnapshot,
int parentWidth, int parentHeight,
StagedSplitBounds splitBoundsConfig, DeviceProfile dp) {
int parentWidth, int parentHeight, StagedSplitBounds splitBoundsConfig,
DeviceProfile dp, boolean isRtl) {
int spaceAboveSnapshot = dp.overviewTaskThumbnailTopMarginPx;
int totalThumbnailHeight = parentHeight - spaceAboveSnapshot;
int dividerBar = splitBoundsConfig.appsStackedVertically
@@ -591,7 +591,13 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
secondarySnapshotHeight = totalThumbnailHeight;
secondarySnapshotWidth = parentWidth - primarySnapshotWidth - dividerBar;
int translationX = primarySnapshotWidth + dividerBar;
secondarySnapshot.setTranslationX(translationX);
if (isRtl) {
primarySnapshot.setTranslationX(-translationX);
secondarySnapshot.setTranslationX(0);
} else {
secondarySnapshot.setTranslationX(translationX);
primarySnapshot.setTranslationX(0);
}
secondarySnapshot.setTranslationY(spaceAboveSnapshot);
} else {
primarySnapshotWidth = parentWidth;
@@ -602,6 +608,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
int translationY = primarySnapshotHeight + spaceAboveSnapshot + dividerBar;
secondarySnapshot.setTranslationY(translationY);
secondarySnapshot.setTranslationX(0);
primarySnapshot.setTranslationX(0);
}
primarySnapshot.measure(
View.MeasureSpec.makeMeasureSpec(primarySnapshotWidth, View.MeasureSpec.EXACTLY),