{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

MotionEventSubject

class MotionEventSubject


Subject for MotionEvent.

Summary

Public functions

MotionEventSubject
assertThat(event: MotionEvent)
Unit
hasAction(action: Int)
Unit
hasActionButton(actionButton: Int)

Check the value of MotionEvent#getActionButton()

Unit
hasButtonState(buttonState: Int)
Unit
hasDeviceId(deviceId: Int)
Unit
hasDownTime(downTime: Long)
Unit
hasEdgeFlags(edgeFlags: Int)
Unit
hasEventTime(eventTime: Long)
Unit
hasFlags(flags: Int)
Unit
hasHistorySize(historySize: Int)
Unit
hasMetaState(metaState: Int)
Unit
hasPointerCount(pointerCount: Int)
LongSubject
FloatSubject
PointerCoordsSubject
historicalPointerCoords(pointerIndex: Int, pos: Int)
FloatSubject
FloatSubject
FloatSubject
FloatSubject
FloatSubject
FloatSubject
FloatSubject
FloatSubject
Factory<MotionEventSubject, MotionEvent>
FloatSubject
FloatSubject
orientation(pointerIndex: Int)
PointerCoordsSubject
pointerCoords(pointerIndex: Int)
IntegerSubject
pointerId(pointerIndex: Int)
PointerPropertiesSubject
pointerProperties(pointerIndex: Int)
FloatSubject
FloatSubject
pressure(pointerIndex: Int)
FloatSubject
FloatSubject
FloatSubject
FloatSubject
size(pointerIndex: Int)
FloatSubject
FloatSubject
toolMajor(pointerIndex: Int)
FloatSubject
FloatSubject
toolMinor(pointerIndex: Int)
FloatSubject
FloatSubject
touchMajor(pointerIndex: Int)
FloatSubject
FloatSubject
touchMinor(pointerIndex: Int)
FloatSubject
x()
FloatSubject
x(pointerIndex: Int)
FloatSubject
FloatSubject
y()
FloatSubject
y(pointerIndex: Int)
FloatSubject

Public functions

assertThat

fun assertThat(event: MotionEvent): MotionEventSubject

hasAction

fun hasAction(action: Int): Unit

hasActionButton

fun hasActionButton(actionButton: Int): Unit

Check the value of MotionEvent#getActionButton()

Throws
java.lang.IllegalStateException

if called on below Android API 23

hasButtonState

fun hasButtonState(buttonState: Int): Unit

hasDeviceId

fun hasDeviceId(deviceId: Int): Unit

hasDownTime

fun hasDownTime(downTime: Long): Unit

hasEdgeFlags

fun hasEdgeFlags(edgeFlags: Int): Unit

hasEventTime

fun hasEventTime(eventTime: Long): Unit

hasFlags

fun hasFlags(flags: Int): Unit

hasHistorySize

fun hasHistorySize(historySize: Int): Unit

hasMetaState

fun hasMetaState(metaState: Int): Unit

hasPointerCount

fun hasPointerCount(pointerCount: Int): Unit

historicalEventTime

fun historicalEventTime(pos: Int): LongSubject

historicalOrientation

fun historicalOrientation(pos: Int): FloatSubject

historicalPointerCoords

fun historicalPointerCoords(pointerIndex: Int, pos: Int): PointerCoordsSubject

historicalPressure

fun historicalPressure(pos: Int): FloatSubject

historicalSize

fun historicalSize(pos: Int): FloatSubject

historicalToolMajor

fun historicalToolMajor(pos: Int): FloatSubject

historicalToolMinor

fun historicalToolMinor(pos: Int): FloatSubject

historicalTouchMajor

fun historicalTouchMajor(pos: Int): FloatSubject

historicalTouchMinor

fun historicalTouchMinor(pos: Int): FloatSubject

historicalX

fun historicalX(pos: Int): FloatSubject

historicalY

fun historicalY(pos: Int): FloatSubject

motionEvents

fun motionEvents(): Factory<MotionEventSubject, MotionEvent>

orientation

fun orientation(): FloatSubject

orientation

fun orientation(pointerIndex: Int): FloatSubject

pointerCoords

fun pointerCoords(pointerIndex: Int): PointerCoordsSubject

pointerId

fun pointerId(pointerIndex: Int): IntegerSubject

pointerProperties

fun pointerProperties(pointerIndex: Int): PointerPropertiesSubject

pressure

fun pressure(): FloatSubject

pressure

fun pressure(pointerIndex: Int): FloatSubject

rawX

fun rawX(): FloatSubject

rawY

fun rawY(): FloatSubject

size

fun size(): FloatSubject

size

fun size(pointerIndex: Int): FloatSubject

toolMajor

fun toolMajor(): FloatSubject

toolMajor

fun toolMajor(pointerIndex: Int): FloatSubject

toolMinor

fun toolMinor(): FloatSubject

toolMinor

fun toolMinor(pointerIndex: Int): FloatSubject

touchMajor

fun touchMajor(): FloatSubject

touchMajor

fun touchMajor(pointerIndex: Int): FloatSubject

touchMinor

fun touchMinor(): FloatSubject

touchMinor

fun touchMinor(pointerIndex: Int): FloatSubject

x

fun x(): FloatSubject

x

fun x(pointerIndex: Int): FloatSubject

xPrecision

fun xPrecision(): FloatSubject

y

fun y(): FloatSubject

y

fun y(pointerIndex: Int): FloatSubject

yPrecision

fun yPrecision(): FloatSubject