From 0f12803061033c3fc9e4a89dc24d31b2612375a5 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Tue, 7 Dec 2021 22:13:06 -0800 Subject: [PATCH] Fix split animation for grid RTL Fixes: 202156862 Test: Tested grid + non grid, RTL + LTR Change-Id: I303f60efdd9f2f2ea412e31e574d9a3b50fecf30 --- .../com/android/quickstep/views/FloatingTaskView.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java index a343e0a593..adcaf6538d 100644 --- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java +++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java @@ -129,7 +129,7 @@ public class FloatingTaskView extends FrameLayout { public void update(RectF position, float progress, float windowRadius) { MarginLayoutParams lp = (MarginLayoutParams) getLayoutParams(); - float dX = position.left - lp.getMarginStart(); + float dX = position.left - mStartingPosition.left; float dY = position.top - lp.topMargin; setTranslationX(dX); @@ -155,10 +155,15 @@ public class FloatingTaskView extends FrameLayout { lp.ignoreInsets = true; // Position the floating view exactly on top of the original lp.topMargin = Math.round(pos.top); - lp.setMarginStart(Math.round(pos.left)); + if (mIsRtl) { + lp.setMarginStart(mLauncher.getDeviceProfile().widthPx - Math.round(pos.right)); + } else { + lp.setMarginStart(Math.round(pos.left)); + } + // Set the properties here already to make sure they are available when running the first // animation frame. - int left = lp.leftMargin; + int left = (int) pos.left; layout(left, lp.topMargin, left + lp.width, lp.topMargin + lp.height); }