Correctly position the landscape / rtl FloatingIconView's background drawable when swiping back to home.

Bug: 235812580
Test: Verified the correct "Swipe Back to Home" position for the
floating icon view in landscape and portrait (rtl and ltr for both
orientations) with a tablet. There is a screen recording on the bug.

Change-Id: Id06f43e70ef617e39e1b26d0c8b7466147e325d2
This commit is contained in:
Stefan Andonian
2022-09-16 18:52:44 +00:00
parent dfaabbb499
commit d768f73f37

View File

@@ -15,6 +15,8 @@
*/
package com.android.launcher3.views;
import static android.view.Gravity.LEFT;
import static com.android.launcher3.Utilities.getBadge;
import static com.android.launcher3.Utilities.getFullDrawable;
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
@@ -181,8 +183,10 @@ public class FloatingIconView extends FrameLayout implements
updatePosition(positionOut, lp);
setLayoutParams(lp);
mClipIconView.setLayoutParams(new FrameLayout.LayoutParams(lp.width, lp.height));
mBtvDrawable.setLayoutParams(new FrameLayout.LayoutParams(lp.width, lp.height));
// For code simplicity, we always layout the child views using Gravity.LEFT
// and manually handle RTL for FloatingIconView when positioning it on the screen.
mClipIconView.setLayoutParams(new FrameLayout.LayoutParams(lp.width, lp.height, LEFT));
mBtvDrawable.setLayoutParams(new FrameLayout.LayoutParams(lp.width, lp.height, LEFT));
}
private void updatePosition(RectF pos, InsettableFrameLayout.LayoutParams lp) {