# ViewState

Artifact: [androidx.constraintlayout:constraintlayout](https://developer.android.com/jetpack/androidx/releases/constraintlayout) [View Source](https://cs.android.com/search?q=file:androidx/constraintlayout/motion/utils/ViewState.java+class:androidx.constraintlayout.motion.utils.ViewState) Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

*** ** * ** ***


```
public class ViewState
```

<br />

*** ** * ** ***

Stores the bounds and rotation of a widget

## Summary

| ### Public fields |
|---|---|
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/motion/utils/ViewState#bottom()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/motion/utils/ViewState#left()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/motion/utils/ViewState#right()` |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/motion/utils/ViewState#rotation()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/motion/utils/ViewState#top()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/constraintlayout/motion/utils/ViewState#ViewState()()` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/utils/ViewState#getState(android.view.View)(https://developer.android.com/reference/android/view/View.html v)` Get the parameters of the view |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/motion/utils/ViewState#height()()` the height of the view |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/motion/utils/ViewState#width()()` The width of the view |

## Public fields

### bottom

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public int bottom
```

### left

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public int left
```

### right

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public int right
```

### rotation

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public float rotation
```

### top

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public int top
```

## Public constructors

### ViewState

Added in 2.2.2

```
public ViewState()
```

## Public methods

### getState

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public void getState(View v)
```

Get the parameters of the view

| Parameters |
|---|---|
| `https://developer.android.com/reference/android/view/View.html v` | the view |

### height

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public int height()
```

the height of the view

| Returns |
|---|---|
| `int` | the width |

### width

Added in [2.2.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#2.2.2)

```
public int width()
```

The width of the view

| Returns |
|---|---|
| `int` | the width |