# ViewTransition

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

*** ** * ** ***


```
public class ViewTransition
```

<br />

*** ** * ** ***

Provides a support for tag it Parses tag it implement the transition it will update ConstraintSet or sets For asynchronous it will create and drive a MotionController.

## Summary

| ### Constants |
|---|---|
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#CONSTRAINT_OVERRIDE() = "ConstraintOverride"` |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#CUSTOM_ATTRIBUTE() = "CustomAttribute"` |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#CUSTOM_METHOD() = "CustomMethod"` |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#KEY_FRAME_SET_TAG() = "KeyFrameSet"` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#ONSTATE_ACTION_DOWN() = 1` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#ONSTATE_ACTION_DOWN_UP() = 3` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#ONSTATE_ACTION_UP() = 2` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#ONSTATE_SHARED_VALUE_SET() = 4` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#ONSTATE_SHARED_VALUE_UNSET() = 5` |
| `static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#VIEW_TRANSITION_TAG() = "ViewTransition"` |

| ### Public methods |
|---|---|
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#getSharedValue()()` Gets the SharedValue it will be listening for. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#getSharedValueCurrent()()` |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#getSharedValueID()()` Gets the ID of the SharedValue it will be listening for. |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#getStateTransition()()` Gets the type of transition to listen to. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#setSharedValue(int)(int sharedValue)` sets the SharedValue it will be listening for. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#setSharedValueCurrent(int)(int sharedValueCurrent)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#setSharedValueID(int)(int sharedValueID)` sets the ID of the SharedValue it will be listening for. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#setStateTransition(int)(int stateTransition)` Sets the type of transition to listen to. |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/motion/widget/ViewTransition#toString()()` debug string for a ViewTransition |

## Constants

### CONSTRAINT_OVERRIDE

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

```
public static final String CONSTRAINT_OVERRIDE = "ConstraintOverride"
```

### CUSTOM_ATTRIBUTE

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

```
public static final String CUSTOM_ATTRIBUTE = "CustomAttribute"
```

### CUSTOM_METHOD

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

```
public static final String CUSTOM_METHOD = "CustomMethod"
```

### KEY_FRAME_SET_TAG

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

```
public static final String KEY_FRAME_SET_TAG = "KeyFrameSet"
```

### ONSTATE_ACTION_DOWN

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

```
public static final int ONSTATE_ACTION_DOWN = 1
```

### ONSTATE_ACTION_DOWN_UP

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

```
public static final int ONSTATE_ACTION_DOWN_UP = 3
```

### ONSTATE_ACTION_UP

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

```
public static final int ONSTATE_ACTION_UP = 2
```

### ONSTATE_SHARED_VALUE_SET

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

```
public static final int ONSTATE_SHARED_VALUE_SET = 4
```

### ONSTATE_SHARED_VALUE_UNSET

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

```
public static final int ONSTATE_SHARED_VALUE_UNSET = 5
```

### VIEW_TRANSITION_TAG

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

```
public static final String VIEW_TRANSITION_TAG = "ViewTransition"
```

## Public methods

### getSharedValue

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

```
public int getSharedValue()
```

Gets the SharedValue it will be listening for.

| Returns |
|---|---|
| `int` |   |

### getSharedValueCurrent

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

```
public int getSharedValueCurrent()
```

### getSharedValueID

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

```
public int getSharedValueID()
```

Gets the ID of the SharedValue it will be listening for.

| Returns |
|---|---|
| `int` | the id of the shared value |

### getStateTransition

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

```
public int getStateTransition()
```

Gets the type of transition to listen to.

| Returns |
|---|---|
| `int` | ONSTATE_TRANSITION_\* |

### setSharedValue

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

```
public void setSharedValue(int sharedValue)
```

sets the SharedValue it will be listening for.

### setSharedValueCurrent

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

```
public void setSharedValueCurrent(int sharedValueCurrent)
```

### setSharedValueID

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

```
public void setSharedValueID(int sharedValueID)
```

sets the ID of the SharedValue it will be listening for.

### setStateTransition

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

```
public void setStateTransition(int stateTransition)
```

Sets the type of transition to listen to.

| Parameters |
|---|---|
| `int stateTransition` |   |

### toString

```
public String toString()
```

debug string for a ViewTransition

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html` |   |