@Deprecated public class TouchUtils extends Object
Constructor and Description |
---|
TouchUtils()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static void |
clickView(InstrumentationTestCase test,
View v)
Deprecated.
Simulate touching the center of a view and releasing.
|
static void |
drag(ActivityInstrumentationTestCase test,
float fromX,
float toX,
float fromY,
float toY,
int stepCount)
Deprecated.
ActivityInstrumentationTestCase is deprecated in favor of
ActivityInstrumentationTestCase2 , which provides more options for
configuring the Activity under test |
static void |
drag(InstrumentationTestCase test,
float fromX,
float toX,
float fromY,
float toY,
int stepCount)
Deprecated.
Simulate touching a specific location and dragging to a new location.
|
static void |
dragQuarterScreenDown(ActivityInstrumentationTestCase test)
Deprecated.
ActivityInstrumentationTestCase is deprecated in favor of
ActivityInstrumentationTestCase2 , which provides more options for
configuring the Activity under test |
static void |
dragQuarterScreenDown(InstrumentationTestCase test,
Activity activity)
Deprecated.
Simulate touching in the center of the screen and dragging one quarter of the way down
|
static void |
dragQuarterScreenUp(ActivityInstrumentationTestCase test)
Deprecated.
ActivityInstrumentationTestCase is deprecated in favor of
ActivityInstrumentationTestCase2 , which provides more options for
configuring the Activity under test |
static void |
dragQuarterScreenUp(InstrumentationTestCase test,
Activity activity)
Deprecated.
Simulate touching in the center of the screen and dragging one quarter of the way up
|
static int |
dragViewBy(ActivityInstrumentationTestCase test,
View v,
int gravity,
int deltaX,
int deltaY)
Deprecated.
ActivityInstrumentationTestCase is deprecated in favor of
ActivityInstrumentationTestCase2 , which provides more options for
configuring the Activity under test |
static int |
dragViewBy(InstrumentationTestCase test,
View v,
int gravity,
int deltaX,
int deltaY)
Deprecated.
ActivityInstrumentationTestCase is deprecated in favor of
ActivityInstrumentationTestCase2 , which provides more options for
configuring the Activity under test |
static int |
dragViewTo(ActivityInstrumentationTestCase test,
View v,
int gravity,
int toX,
int toY)
Deprecated.
ActivityInstrumentationTestCase is deprecated in favor of
ActivityInstrumentationTestCase2 , which provides more options for
configuring the Activity under test |
static int |
dragViewTo(InstrumentationTestCase test,
View v,
int gravity,
int toX,
int toY)
Deprecated.
Simulate touching a view and dragging it to a specified location.
|
static void |
dragViewToBottom(ActivityInstrumentationTestCase test,
View v)
Deprecated.
ActivityInstrumentationTestCase is deprecated in favor of
ActivityInstrumentationTestCase2 , which provides more options for
configuring the Activity under test |
static void |
dragViewToBottom(ActivityInstrumentationTestCase test,
View v,
int stepCount)
Deprecated.
ActivityInstrumentationTestCase is deprecated in favor of
ActivityInstrumentationTestCase2 , which provides more options for
configuring the Activity under test |
static void |
dragViewToBottom(InstrumentationTestCase test,
Activity activity,
View v)
Deprecated.
Simulate touching the center of a view and dragging to the bottom of the screen.
|
static void |
dragViewToBottom(InstrumentationTestCase test,
Activity activity,
View v,
int stepCount)
Deprecated.
Simulate touching the center of a view and dragging to the bottom of the screen.
|
static void |
dragViewToTop(ActivityInstrumentationTestCase test,
View v)
Deprecated.
ActivityInstrumentationTestCase is deprecated in favor of
ActivityInstrumentationTestCase2 , which provides more options for
configuring the Activity under test |
static void |
dragViewToTop(ActivityInstrumentationTestCase test,
View v,
int stepCount)
Deprecated.
ActivityInstrumentationTestCase is deprecated in favor of
ActivityInstrumentationTestCase2 , which provides more options for
configuring the Activity under test |
static void |
dragViewToTop(InstrumentationTestCase test,
View v)
Deprecated.
Simulate touching the center of a view and dragging to the top of the screen.
|
static void |
dragViewToTop(InstrumentationTestCase test,
View v,
int stepCount)
Deprecated.
Simulate touching the center of a view and dragging to the top of the screen.
|
static int |
dragViewToX(ActivityInstrumentationTestCase test,
View v,
int gravity,
int toX)
Deprecated.
ActivityInstrumentationTestCase is deprecated in favor of
ActivityInstrumentationTestCase2 , which provides more options for
configuring the Activity under test |
static int |
dragViewToX(InstrumentationTestCase test,
View v,
int gravity,
int toX)
Deprecated.
Simulate touching a view and dragging it to a specified location.
|
static int |
dragViewToY(ActivityInstrumentationTestCase test,
View v,
int gravity,
int toY)
Deprecated.
ActivityInstrumentationTestCase is deprecated in favor of
ActivityInstrumentationTestCase2 , which provides more options for
configuring the Activity under test |
static int |
dragViewToY(InstrumentationTestCase test,
View v,
int gravity,
int toY)
Deprecated.
Simulate touching a view and dragging it to a specified location.
|
static void |
longClickView(ActivityInstrumentationTestCase test,
View v)
Deprecated.
ActivityInstrumentationTestCase is deprecated in favor of
ActivityInstrumentationTestCase2 , which provides more options for
configuring the Activity under test |
static void |
longClickView(InstrumentationTestCase test,
View v)
Deprecated.
Simulate touching the center of a view, holding until it is a long press, and then releasing.
|
static void |
scrollToBottom(ActivityInstrumentationTestCase test,
ViewGroup v)
Deprecated.
ActivityInstrumentationTestCase is deprecated in favor of
ActivityInstrumentationTestCase2 , which provides more options for
configuring the Activity under test |
static void |
scrollToBottom(InstrumentationTestCase test,
Activity activity,
ViewGroup v)
Deprecated.
Scroll a ViewGroup to the bottom by repeatedly calling
dragQuarterScreenUp(InstrumentationTestCase, Activity) |
static void |
scrollToTop(ActivityInstrumentationTestCase test,
ViewGroup v)
Deprecated.
ActivityInstrumentationTestCase is deprecated in favor of
ActivityInstrumentationTestCase2 , which provides more options for
configuring the Activity under test |
static void |
scrollToTop(InstrumentationTestCase test,
Activity activity,
ViewGroup v)
Deprecated.
Scroll a ViewGroup to the top by repeatedly calling
dragQuarterScreenDown(InstrumentationTestCase, Activity) |
static void |
tapView(InstrumentationTestCase test,
View v)
Deprecated.
Simulate touching the center of a view and releasing quickly (before the tap timeout).
|
static void |
touchAndCancelView(InstrumentationTestCase test,
View v)
Deprecated.
Simulate touching the center of a view and cancelling (so no onClick should
fire, etc).
|
@Deprecated public static void dragQuarterScreenDown(ActivityInstrumentationTestCase test)
ActivityInstrumentationTestCase
is deprecated in favor of
ActivityInstrumentationTestCase2
, which provides more options for
configuring the Activity under testtest
- The test case that is being runpublic static void dragQuarterScreenDown(InstrumentationTestCase test, Activity activity)
test
- The test case that is being runactivity
- The activity that is in the foreground of the test case@Deprecated public static void dragQuarterScreenUp(ActivityInstrumentationTestCase test)
ActivityInstrumentationTestCase
is deprecated in favor of
ActivityInstrumentationTestCase2
, which provides more options for
configuring the Activity under testtest
- The test case that is being runpublic static void dragQuarterScreenUp(InstrumentationTestCase test, Activity activity)
test
- The test case that is being runactivity
- The activity that is in the foreground of the test case@Deprecated public static void scrollToBottom(ActivityInstrumentationTestCase test, ViewGroup v)
ActivityInstrumentationTestCase
is deprecated in favor of
ActivityInstrumentationTestCase2
, which provides more options for
configuring the Activity under testdragQuarterScreenUp(InstrumentationTestCase, Activity)
test
- The test case that is being runv
- The ViewGroup that should be draggedpublic static void scrollToBottom(InstrumentationTestCase test, Activity activity, ViewGroup v)
dragQuarterScreenUp(InstrumentationTestCase, Activity)
test
- The test case that is being runactivity
- The activity that is in the foreground of the test casev
- The ViewGroup that should be dragged@Deprecated public static void scrollToTop(ActivityInstrumentationTestCase test, ViewGroup v)
ActivityInstrumentationTestCase
is deprecated in favor of
ActivityInstrumentationTestCase2
, which provides more options for
configuring the Activity under testdragQuarterScreenDown(InstrumentationTestCase, Activity)
test
- The test case that is being runv
- The ViewGroup that should be draggedpublic static void scrollToTop(InstrumentationTestCase test, Activity activity, ViewGroup v)
dragQuarterScreenDown(InstrumentationTestCase, Activity)
test
- The test case that is being runactivity
- The activity that is in the foreground of the test casev
- The ViewGroup that should be dragged@Deprecated public static void dragViewToBottom(ActivityInstrumentationTestCase test, View v)
ActivityInstrumentationTestCase
is deprecated in favor of
ActivityInstrumentationTestCase2
, which provides more options for
configuring the Activity under testtest
- The test case that is being runv
- The view that should be draggedpublic static void dragViewToBottom(InstrumentationTestCase test, Activity activity, View v)
test
- The test case that is being runactivity
- The activity that is in the foreground of the test casev
- The view that should be dragged@Deprecated public static void dragViewToBottom(ActivityInstrumentationTestCase test, View v, int stepCount)
ActivityInstrumentationTestCase
is deprecated in favor of
ActivityInstrumentationTestCase2
, which provides more options for
configuring the Activity under testtest
- The test case that is being runv
- The view that should be draggedstepCount
- How many move steps to include in the dragpublic static void dragViewToBottom(InstrumentationTestCase test, Activity activity, View v, int stepCount)
test
- The test case that is being runactivity
- The activity that is in the foreground of the test casev
- The view that should be draggedstepCount
- How many move steps to include in the dragpublic static void tapView(InstrumentationTestCase test, View v)
test
- The test case that is being runv
- The view that should be clickedpublic static void touchAndCancelView(InstrumentationTestCase test, View v)
test
- The test case that is being runv
- The view that should be clickedpublic static void clickView(InstrumentationTestCase test, View v)
test
- The test case that is being runv
- The view that should be clicked@Deprecated public static void longClickView(ActivityInstrumentationTestCase test, View v)
ActivityInstrumentationTestCase
is deprecated in favor of
ActivityInstrumentationTestCase2
, which provides more options for
configuring the Activity under testtest
- The test case that is being runv
- The view that should be clickedpublic static void longClickView(InstrumentationTestCase test, View v)
test
- The test case that is being runv
- The view that should be clicked@Deprecated public static void dragViewToTop(ActivityInstrumentationTestCase test, View v)
ActivityInstrumentationTestCase
is deprecated in favor of
ActivityInstrumentationTestCase2
, which provides more options for
configuring the Activity under testtest
- The test case that is being runv
- The view that should be dragged@Deprecated public static void dragViewToTop(ActivityInstrumentationTestCase test, View v, int stepCount)
ActivityInstrumentationTestCase
is deprecated in favor of
ActivityInstrumentationTestCase2
, which provides more options for
configuring the Activity under testtest
- The test case that is being runv
- The view that should be draggedstepCount
- How many move steps to include in the dragpublic static void dragViewToTop(InstrumentationTestCase test, View v)
test
- The test case that is being runv
- The view that should be draggedpublic static void dragViewToTop(InstrumentationTestCase test, View v, int stepCount)
test
- The test case that is being runv
- The view that should be draggedstepCount
- How many move steps to include in the drag@Deprecated public static int dragViewBy(ActivityInstrumentationTestCase test, View v, int gravity, int deltaX, int deltaY)
ActivityInstrumentationTestCase
is deprecated in favor of
ActivityInstrumentationTestCase2
, which provides more options for
configuring the Activity under testtest
- The test case that is being runv
- The view that should be draggedgravity
- Which part of the view to use for the initial down event. A combination of
(TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL, RIGHT)deltaX
- Amount to drag horizontally in pixelsdeltaY
- Amount to drag vertically in pixels@Deprecated public static int dragViewBy(InstrumentationTestCase test, View v, int gravity, int deltaX, int deltaY)
ActivityInstrumentationTestCase
is deprecated in favor of
ActivityInstrumentationTestCase2
, which provides more options for
configuring the Activity under testtest
- The test case that is being runv
- The view that should be draggedgravity
- Which part of the view to use for the initial down event. A combination of
(TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL, RIGHT)deltaX
- Amount to drag horizontally in pixelsdeltaY
- Amount to drag vertically in pixels@Deprecated public static int dragViewTo(ActivityInstrumentationTestCase test, View v, int gravity, int toX, int toY)
ActivityInstrumentationTestCase
is deprecated in favor of
ActivityInstrumentationTestCase2
, which provides more options for
configuring the Activity under testtest
- The test case that is being runv
- The view that should be draggedgravity
- Which part of the view to use for the initial down event. A combination of
(TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL, RIGHT)toX
- Final location of the view after draggingtoY
- Final location of the view after draggingpublic static int dragViewTo(InstrumentationTestCase test, View v, int gravity, int toX, int toY)
test
- The test case that is being runv
- The view that should be draggedgravity
- Which part of the view to use for the initial down event. A combination of
(TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL, RIGHT)toX
- Final location of the view after draggingtoY
- Final location of the view after dragging@Deprecated public static int dragViewToX(ActivityInstrumentationTestCase test, View v, int gravity, int toX)
ActivityInstrumentationTestCase
is deprecated in favor of
ActivityInstrumentationTestCase2
, which provides more options for
configuring the Activity under testtest
- The test case that is being runv
- The view that should be draggedgravity
- Which part of the view to use for the initial down event. A combination of
(TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL, RIGHT)toX
- Final location of the view after draggingpublic static int dragViewToX(InstrumentationTestCase test, View v, int gravity, int toX)
test
- The test case that is being runv
- The view that should be draggedgravity
- Which part of the view to use for the initial down event. A combination of
(TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL, RIGHT)toX
- Final location of the view after dragging@Deprecated public static int dragViewToY(ActivityInstrumentationTestCase test, View v, int gravity, int toY)
ActivityInstrumentationTestCase
is deprecated in favor of
ActivityInstrumentationTestCase2
, which provides more options for
configuring the Activity under testtest
- The test case that is being runv
- The view that should be draggedgravity
- Which part of the view to use for the initial down event. A combination of
(TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL, RIGHT)toY
- Final location of the view after draggingpublic static int dragViewToY(InstrumentationTestCase test, View v, int gravity, int toY)
test
- The test case that is being runv
- The view that should be draggedgravity
- Which part of the view to use for the initial down event. A combination of
(TOP, CENTER_VERTICAL, BOTTOM) and (LEFT, CENTER_HORIZONTAL, RIGHT)toY
- Final location of the view after dragging@Deprecated public static void drag(ActivityInstrumentationTestCase test, float fromX, float toX, float fromY, float toY, int stepCount)
ActivityInstrumentationTestCase
is deprecated in favor of
ActivityInstrumentationTestCase2
, which provides more options for
configuring the Activity under testtest
- The test case that is being runfromX
- X coordinate of the initial touch, in screen coordinatestoX
- Xcoordinate of the drag destination, in screen coordinatesfromY
- X coordinate of the initial touch, in screen coordinatestoY
- Y coordinate of the drag destination, in screen coordinatesstepCount
- How many move steps to include in the dragpublic static void drag(InstrumentationTestCase test, float fromX, float toX, float fromY, float toY, int stepCount)
test
- The test case that is being runfromX
- X coordinate of the initial touch, in screen coordinatestoX
- Xcoordinate of the drag destination, in screen coordinatesfromY
- X coordinate of the initial touch, in screen coordinatestoY
- Y coordinate of the drag destination, in screen coordinatesstepCount
- How many move steps to include in the drag