Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c28d5919 authored by Matt Casey's avatar Matt Casey
Browse files

Make magnifier show up opposite touch

Touch on left -> magnifier on right, touch on right -> magnifier on
left.

No dynamic switching for now, just affecting initial placement.

Bug: 179499370
Test: Bring up crop UI, drag handles on the left and right, observe
      magnifier doesn't show up beneath thumb.
Change-Id: Ib020b99fec41637bce4e1797412afbdbd9447ab2
parent bf03ae3b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -144,7 +144,9 @@ public class MagnifierView extends View implements CropView.CropInteractionListe
                setAlpha(0f);
                setTranslationX((getParentWidth() - getWidth()) / 2);
                setVisibility(View.VISIBLE);
                animate().alpha(1f).translationX(0).scaleX(1f).scaleY(1f).start();
                boolean touchOnRight = event.getX() > getParentWidth() / 2;
                float translateXTarget = touchOnRight ? 0 : getParentWidth() - getWidth();
                animate().alpha(1f).translationX(translateXTarget).scaleX(1f).scaleY(1f).start();
                break;
            case MotionEvent.ACTION_MOVE:
                mLastCropPosition = cropPosition;