Home | History | Annotate | Download | only in cts

Lines Matching defs:MotionEvent

52 import android.view.MotionEvent;
77 private static final Matcher<MotionEvent> IS_ACTION_DOWN =
78 new MotionEventActionMatcher(MotionEvent.ACTION_DOWN);
79 private static final Matcher<MotionEvent> IS_ACTION_POINTER_DOWN =
80 new MotionEventActionMatcher(MotionEvent.ACTION_POINTER_DOWN);
81 private static final Matcher<MotionEvent> IS_ACTION_UP =
82 new MotionEventActionMatcher(MotionEvent.ACTION_UP);
83 private static final Matcher<MotionEvent> IS_ACTION_POINTER_UP =
84 new MotionEventActionMatcher(MotionEvent.ACTION_POINTER_UP);
85 private static final Matcher<MotionEvent> IS_ACTION_CANCEL =
86 new MotionEventActionMatcher(MotionEvent.ACTION_CANCEL);
87 private static final Matcher<MotionEvent> IS_ACTION_MOVE =
88 new MotionEventActionMatcher(MotionEvent.ACTION_MOVE);
91 final List<MotionEvent> mMotionEvents = new ArrayList<>();
148 waitForMotionEvents(any(MotionEvent.class), 2);
151 MotionEvent clickDown = mMotionEvents.get(0);
152 MotionEvent clickUp = mMotionEvents.get(1);
156 // Verify other MotionEvent fields in this test to make sure they get initialized.
183 waitForMotionEvents(any(MotionEvent.class), 2);
184 MotionEvent clickDown = mMotionEvents.get(0);
185 MotionEvent clickUp = mMotionEvents.get(1);
209 MotionEvent downEvent = mMotionEvents.get(0);
210 MotionEvent upEvent = mMotionEvents.get(numEvents - 1);
217 MotionEvent moveEvent = mMotionEvents.get(i);
283 MotionEvent.PointerCoords coords0 = new MotionEvent.PointerCoords();
284 MotionEvent.PointerCoords coords1 = new MotionEvent.PointerCoords();
285 MotionEvent event = mMotionEvents.get(i);
358 waitForMotionEvents(any(MotionEvent.class), 4);
472 List<MotionEvent> cancelEvent = getEventsMatching(IS_ACTION_CANCEL);
515 private void waitForMotionEvents(Matcher<MotionEvent> matcher, int numEventsExpected)
529 private List<MotionEvent> getEventsMatching(Matcher<MotionEvent> matcher) {
530 List<MotionEvent> events = new ArrayList<>();
532 for (MotionEvent event : mMotionEvents) {
541 private float distance(MotionEvent.PointerCoords point1, MotionEvent.PointerCoords point2) {
547 public boolean onTouch(View view, MotionEvent motionEvent) {
549 if (motionEvent.getActionMasked() == MotionEvent.ACTION_UP) {
552 mMotionEvents.add(MotionEvent.obtain(motionEvent));
628 private static class MotionEventActionMatcher extends TypeSafeMatcher<MotionEvent> {
637 protected boolean matchesSafely(MotionEvent motionEvent) {
638 return motionEvent.getActionMasked() == mAction;
643 description.appendText("Matching to action " + MotionEvent.actionToString(mAction));
648 Matcher<MotionEvent> isAtPoint(final PointF point) {
652 Matcher<MotionEvent> isAtPoint(final PointF point, final float tol) {
653 return new TypeSafeMatcher<MotionEvent>() {
655 protected boolean matchesSafely(MotionEvent event) {