fun mockMotionEvent(action: Int, downTime: Long = System.currentTimeMillis(), eventTime: Long = System.currentTimeMillis(), x: Float = 0f, y: Float = 0f, metaState: Int = 0): MotionEvent
(source)
Creates a custom MotionEvent for testing. As of SDK 28 MotionEvents can't be mocked anymore and need to be created through MotionEvent.obtain.