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

Commit 724943dc authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove unused Utilities methods related to motion event translation"...

Merge "Remove unused Utilities methods related to  motion event translation" into ub-launcher3-master
parents ff646727 aa7d8776
Loading
Loading
Loading
Loading
+0 −25
Original line number Diff line number Diff line
@@ -48,7 +48,6 @@ import android.util.Log;
import android.util.Pair;
import android.util.SparseArray;
import android.util.TypedValue;
import android.view.MotionEvent;
import android.view.View;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
@@ -236,30 +235,6 @@ public final class Utilities {
                localY < (v.getHeight() + slop);
    }

    /** Translates MotionEvents from src's coordinate system to dst's. */
    public static void translateEventCoordinates(View src, View dst, MotionEvent dstEvent) {
        toGlobalMotionEvent(src, dstEvent);
        toLocalMotionEvent(dst, dstEvent);
    }

    /**
     * Emulates View.toGlobalMotionEvent(). This implementation does not handle transformations
     * (scaleX, scaleY, etc).
     */
    private static void toGlobalMotionEvent(View view, MotionEvent event) {
        view.getLocationOnScreen(sLoc0);
        event.offsetLocation(sLoc0[0], sLoc0[1]);
    }

    /**
     * Emulates View.toLocalMotionEvent(). This implementation does not handle transformations
     * (scaleX, scaleY, etc).
     */
    private static void toLocalMotionEvent(View view, MotionEvent event) {
        view.getLocationOnScreen(sLoc0);
        event.offsetLocation(-sLoc0[0], -sLoc0[1]);
    }

    public static int[] getCenterDeltaInScreenSpace(View v0, View v1, int[] delta) {
        v0.getLocationInWindow(sLoc0);
        v1.getLocationInWindow(sLoc1);