Fix position of task menu in RTL

Bug: 71902072
Change-Id: I03659171a41448347dd6d13e8915125ee5ad4aaa
This commit is contained in:
Tony Wickham
2018-01-19 16:22:41 -08:00
parent 23608f7c9f
commit 0d00e52bd8
@@ -35,6 +35,7 @@ import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAnimUtils;
import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.RoundedRectRevealOutlineProvider;
import com.android.launcher3.dragndrop.DragLayer;
@@ -170,7 +171,8 @@ public class TaskMenuView extends AbstractFloatingView {
measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
mLauncher.getDragLayer().getDescendantRectRelativeToSelf(taskView, sTempRect);
Rect insets = mLauncher.getDragLayer().getInsets();
setX(sTempRect.left + (sTempRect.width() - getMeasuredWidth()) / 2 - insets.left);
int x = sTempRect.left + (sTempRect.width() - getMeasuredWidth()) / 2 - insets.left;
setX(Utilities.isRtl(getResources()) ? -x : x);
setY(sTempRect.top - mTaskIconAndName.getPaddingTop() - insets.top);
}