# MotionEventSubject

Artifact: [androidx.test.ext:truth](https://developer.android.com/jetpack/androidx/releases/test-ext) [View Source](https://cs.android.com/search?q=file:androidx/test/ext/truth/view/MotionEventSubject.java+class:androidx.test.ext.truth.view.MotionEventSubject)

*** ** * ** ***


```
public final class MotionEventSubject extends Subject
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [com.google.common.truth.Subject](https://truth.dev/api/0.41/com/google/common/truth/Subject.html) ||
|   | ↳ | [androidx.test.ext.truth.view.MotionEventSubject](https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject) |

*** ** * ** ***

`https://truth.dev/api/0.41/com/google/common/truth/Subject.html` for `https://developer.android.com/reference/android/view/MotionEvent.html`.

## Summary

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#assertThat(android.view.MotionEvent)(https://developer.android.com/reference/android/view/MotionEvent.html event)` |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#hasAction(int)(int action)` |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#hasActionButton(int)(int actionButton)` Check the value of `https://developer.android.com/reference/android/view/MotionEvent.html#getActionButton()` |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#hasButtonState(int)(int buttonState)` |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#hasDeviceId(int)(int deviceId)` |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#hasDownTime(long)(long downTime)` |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#hasEdgeFlags(int)(int edgeFlags)` |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#hasEventTime(long)(long eventTime)` |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#hasFlags(int)(int flags)` |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#hasHistorySize(int)(int historySize)` |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#hasMetaState(int)(int metaState)` |
| `void` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#hasPointerCount(int)(int pointerCount)` |
| `https://truth.dev/api/0.41/com/google/common/truth/LongSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#historicalEventTime(int)(int pos)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#historicalOrientation(int)(int pos)` |
| `https://developer.android.com/reference/androidx/test/ext/truth/view/PointerCoordsSubject` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#historicalPointerCoords(int,int)(int pointerIndex, int pos)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#historicalPressure(int)(int pos)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#historicalSize(int)(int pos)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#historicalToolMajor(int)(int pos)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#historicalToolMinor(int)(int pos)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#historicalTouchMajor(int)(int pos)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#historicalTouchMinor(int)(int pos)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#historicalX(int)(int pos)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#historicalY(int)(int pos)` |
| `static https://truth.dev/api/0.41/com/google/common/truth/Subject.Factory.html<https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject, https://developer.android.com/reference/android/view/MotionEvent.html>` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#motionEvents()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#orientation()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#orientation(int)(int pointerIndex)` |
| `https://developer.android.com/reference/androidx/test/ext/truth/view/PointerCoordsSubject` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#pointerCoords(int)(int pointerIndex)` |
| `https://truth.dev/api/0.41/com/google/common/truth/IntegerSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#pointerId(int)(int pointerIndex)` |
| `https://developer.android.com/reference/androidx/test/ext/truth/view/PointerPropertiesSubject` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#pointerProperties(int)(int pointerIndex)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#pressure()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#pressure(int)(int pointerIndex)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#rawX()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#rawY()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#size()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#size(int)(int pointerIndex)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#toolMajor()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#toolMajor(int)(int pointerIndex)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#toolMinor()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#toolMinor(int)(int pointerIndex)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#touchMajor()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#touchMajor(int)(int pointerIndex)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#touchMinor()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#touchMinor(int)(int pointerIndex)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#x()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#x(int)(int pointerIndex)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#xPrecision()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#y()()` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#y(int)(int pointerIndex)` |
| `https://truth.dev/api/0.41/com/google/common/truth/FloatSubject.html` | `https://developer.android.com/reference/androidx/test/ext/truth/view/MotionEventSubject#yPrecision()()` |

### Inherited methods

From [com.google.common.truth.Subject](https://truth.dev/api/0.41/com/google/common/truth/Subject.html) `https://developer.android.com/reference/java/lang/String.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#actualCustomStringRepresentation--()` `final boolean` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#equals-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html o)`

**This method is deprecated.**
`final void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#failWithActual-java.lang.String-java.lang.Object-(https://developer.android.com/reference/java/lang/String.html key, https://developer.android.com/reference/java/lang/Object.html value)` `final void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#failWithoutActual-com.google.common.truth.Fact-com.google.common.truth.Fact...-(https://truth.dev/api/0.41/com/google/common/truth/Fact.html first, Fact[] rest)` `final int` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#hashCode--()`

**This method is deprecated.**
`final https://truth.dev/api/0.41/com/google/common/truth/StandardSubjectBuilder.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#ignoreCheck--()` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isAnyOf-java.lang.Object-java.lang.Object-java.lang.Object...-(https://developer.android.com/reference/java/lang/Object.html first, https://developer.android.com/reference/java/lang/Object.html second, Object[] rest)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isEqualTo-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html expected)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isIn-java.lang.Iterable&lt;?&gt;-(https://developer.android.com/reference/java/lang/Iterable.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> iterable)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isInstanceOf-java.lang.Class&lt;?&gt;-(https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> clazz)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNoneOf-java.lang.Object-java.lang.Object-java.lang.Object...-(https://developer.android.com/reference/java/lang/Object.html first, https://developer.android.com/reference/java/lang/Object.html second, Object[] rest)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotEqualTo-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html unexpected)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotIn-java.lang.Iterable&lt;?&gt;-(https://developer.android.com/reference/java/lang/Iterable.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> iterable)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotInstanceOf-java.lang.Class&lt;?&gt;-(https://developer.android.com/reference/java/lang/Class.html<@https://developer.android.com/reference/androidx/annotation/NonNull ?> clazz)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotNull--()` `final void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNotSameInstanceAs-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html unexpected)` `void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isNull--()` `final void` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#isSameInstanceAs-java.lang.Object-(https://developer.android.com/reference/java/lang/Object.html expected)` `https://developer.android.com/reference/java/lang/String.html` `https://truth.dev/api/0.41/com/google/common/truth/Subject.html#toString--()`

## Public methods

### assertThat

```
public static MotionEventSubject assertThat(MotionEvent event)
```

### hasAction

```
public void hasAction(int action)
```

### hasActionButton

```
public void hasActionButton(int actionButton)
```

Check the value of `https://developer.android.com/reference/android/view/MotionEvent.html#getActionButton()`

### hasButtonState

```
public void hasButtonState(int buttonState)
```

### hasDeviceId

```
public void hasDeviceId(int deviceId)
```

### hasDownTime

```
public void hasDownTime(long downTime)
```

### hasEdgeFlags

```
public void hasEdgeFlags(int edgeFlags)
```

### hasEventTime

```
public void hasEventTime(long eventTime)
```

### hasFlags

```
public void hasFlags(int flags)
```

### hasHistorySize

```
public void hasHistorySize(int historySize)
```

### hasMetaState

```
public void hasMetaState(int metaState)
```

### hasPointerCount

```
public void hasPointerCount(int pointerCount)
```

### historicalEventTime

```
public LongSubject historicalEventTime(int pos)
```

### historicalOrientation

```
public FloatSubject historicalOrientation(int pos)
```

### historicalPointerCoords

```
public PointerCoordsSubject historicalPointerCoords(int pointerIndex, int pos)
```

### historicalPressure

```
public FloatSubject historicalPressure(int pos)
```

### historicalSize

```
public FloatSubject historicalSize(int pos)
```

### historicalToolMajor

```
public FloatSubject historicalToolMajor(int pos)
```

### historicalToolMinor

```
public FloatSubject historicalToolMinor(int pos)
```

### historicalTouchMajor

```
public FloatSubject historicalTouchMajor(int pos)
```

### historicalTouchMinor

```
public FloatSubject historicalTouchMinor(int pos)
```

### historicalX

```
public FloatSubject historicalX(int pos)
```

### historicalY

```
public FloatSubject historicalY(int pos)
```

### motionEvents

```
public static Subject.Factory<MotionEventSubject, MotionEvent> motionEvents()
```

### orientation

```
public FloatSubject orientation()
```

### orientation

```
public FloatSubject orientation(int pointerIndex)
```

### pointerCoords

```
public PointerCoordsSubject pointerCoords(int pointerIndex)
```

### pointerId

```
public IntegerSubject pointerId(int pointerIndex)
```

### pointerProperties

```
public PointerPropertiesSubject pointerProperties(int pointerIndex)
```

### pressure

```
public FloatSubject pressure()
```

### pressure

```
public FloatSubject pressure(int pointerIndex)
```

### rawX

```
public FloatSubject rawX()
```

### rawY

```
public FloatSubject rawY()
```

### size

```
public FloatSubject size()
```

### size

```
public FloatSubject size(int pointerIndex)
```

### toolMajor

```
public FloatSubject toolMajor()
```

### toolMajor

```
public FloatSubject toolMajor(int pointerIndex)
```

### toolMinor

```
public FloatSubject toolMinor()
```

### toolMinor

```
public FloatSubject toolMinor(int pointerIndex)
```

### touchMajor

```
public FloatSubject touchMajor()
```

### touchMajor

```
public FloatSubject touchMajor(int pointerIndex)
```

### touchMinor

```
public FloatSubject touchMinor()
```

### touchMinor

```
public FloatSubject touchMinor(int pointerIndex)
```

### x

```
public FloatSubject x()
```

### x

```
public FloatSubject x(int pointerIndex)
```

### xPrecision

```
public FloatSubject xPrecision()
```

### y

```
public FloatSubject y()
```

### y

```
public FloatSubject y(int pointerIndex)
```

### yPrecision

```
public FloatSubject yPrecision()
```