IndirectTouchEvent
Function
Android
@ExperimentalIndirectTouchTypeApi
fun IndirectTouchEvent(
motionEvent: MotionEvent,
primaryDirectionalMotionAxis: IndirectTouchEventPrimaryDirectionalMotionAxis =
IndirectTouchEventPrimaryDirectionalMotionAxis.None,
): IndirectTouchEvent
Allows creation of a IndirectTouchEvent
from a MotionEvent
for cross module testing.
IMPORTANT NOTE: Primary axis is determined by properties of the InputDevice
contained within
the MotionEvent
. However, when manually creating a MotionEvent
, there is no way to set the
InputDevice
. Therefore, this function allows you to manually set the primary axis for testing.
If you have a system created MotionEvent
, you can call indirectScrollAxis() on your
MotionEvent
to get the primary axis.