public class

TouchUtils

extends Object
java.lang.Object
   ↳ com.davidluoye.support.util.TouchUtils

Summary

Public Constructors
TouchUtils()
Public Methods
static void drag(float fromX, float toX, float fromY, float toY, int stepCount)
Touching a specific location and dragging to a new location.
static boolean dragSync(float fromX, float toX, float fromY, float toY, int stepCount)
final static Instrumentation getInstrumentation()
final static PointF getLocation(View view)
final static Size getSize(View view)
final static ViewConfiguration getViewConfiguration()
static void sendClickEvent(float x, float y)
Touch and click a location.
static boolean sendClickEventSync(float x, float y)
static void sendLongClickEvent(float x, float y)
Touch and long click a location.
static boolean sendLongClickEventSync(float x, float y)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public TouchUtils ()

Public Methods

public static void drag (float fromX, float toX, float fromY, float toY, int stepCount)

Touching a specific location and dragging to a new location.

Parameters
fromX X coordinate of the initial touch, in screen coordinates
toX X coordinate of the drag destination, in screen coordinates
fromY X coordinate of the initial touch, in screen coordinates
toY Y coordinate of the drag destination, in screen coordinates
stepCount How many move steps to include in the drag

public static boolean dragSync (float fromX, float toX, float fromY, float toY, int stepCount)

public static final Instrumentation getInstrumentation ()

public static final PointF getLocation (View view)

public static final Size getSize (View view)

public static final ViewConfiguration getViewConfiguration ()

public static void sendClickEvent (float x, float y)

Touch and click a location.

Parameters
x X coordinate of the initial touch, in screen coordinates
y Y coordinate of the initial touch, in screen coordinates

public static boolean sendClickEventSync (float x, float y)

public static void sendLongClickEvent (float x, float y)

Touch and long click a location.

Parameters
x X coordinate of the initial touch, in screen coordinates
y Y coordinate of the initial touch, in screen coordinates

public static boolean sendLongClickEventSync (float x, float y)