Code example for GestureDetector

Methods: onTouchEvent

0
        motionEvent = MotionEvent.obtain(-1, -1, MotionEvent.ACTION_UP, 100, 30, -1);
    } 
 
    @Test 
    public void test_getOnTouchEventMotionEvent() throws Exception { 
        detector.onTouchEvent(motionEvent);
        assertSame(motionEvent, shadowOf(detector).getOnTouchEventMotionEvent());
    } 
 
    @Test 
    public void test_reset() throws Exception { 
        detector.onTouchEvent(motionEvent);
        assertSame(motionEvent, shadowOf(detector).getOnTouchEventMotionEvent());
 
        shadowOf(detector).reset();
        assertNull(shadowOf(detector).getOnTouchEventMotionEvent());
    } 
 
    @Test 
    public void test_setNextOnTouchEventReturnValue() throws Exception { 
        assertTrue(detector.onTouchEvent(motionEvent));