From b997930afcec95289c845030eb5c381cc99b4190 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Tue, 30 Nov 2021 19:58:00 -0800 Subject: [PATCH] Treat RTL split placeholder animation same as LTR * Since we're doing all transformations in screen coordinates we don't need to account for RTL. Bug: 202156862 Change-Id: Ibcbf698dbc5b8fabf2647949de6d2718937832d5 --- .../android/quickstep/views/FloatingTaskView.java | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java index 325ec044fe..a343e0a593 100644 --- a/quickstep/src/com/android/quickstep/views/FloatingTaskView.java +++ b/quickstep/src/com/android/quickstep/views/FloatingTaskView.java @@ -129,9 +129,7 @@ public class FloatingTaskView extends FrameLayout { public void update(RectF position, float progress, float windowRadius) { MarginLayoutParams lp = (MarginLayoutParams) getLayoutParams(); - float dX = mIsRtl - ? position.left - (lp.getMarginStart() - lp.width) - : position.left - lp.getMarginStart(); + float dX = position.left - lp.getMarginStart(); float dY = position.top - lp.topMargin; setTranslationX(dX); @@ -157,16 +155,10 @@ public class FloatingTaskView extends FrameLayout { lp.ignoreInsets = true; // Position the floating view exactly on top of the original lp.topMargin = Math.round(pos.top); - if (mIsRtl) { - lp.setMarginStart(Math.round(mLauncher.getDeviceProfile().widthPx - pos.right)); - } else { - lp.setMarginStart(Math.round(pos.left)); - } + 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 = mIsRtl - ? mLauncher.getDeviceProfile().widthPx - lp.getMarginStart() - lp.width - : lp.leftMargin; + int left = lp.leftMargin; layout(left, lp.topMargin, left + lp.width, lp.topMargin + lp.height); }