# 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)

*** ** * ** ***


```
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 |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#CONSTRAINT_OVERRIDE() = "ConstraintOverride"` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#CUSTOM_ATTRIBUTE() = "CustomAttribute"` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#CUSTOM_METHOD() = "CustomMethod"` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#KEY_FRAME_SET_TAG() = "KeyFrameSet"` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#ONSTATE_ACTION_DOWN() = 1` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#ONSTATE_ACTION_DOWN_UP() = 3` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#ONSTATE_ACTION_UP() = 2` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#ONSTATE_SHARED_VALUE_SET() = 4` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#ONSTATE_SHARED_VALUE_UNSET() = 5` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#VIEW_TRANSITION_TAG() = "ViewTransition"` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#getSharedValue()()` Gets the SharedValue it will be listening for. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#getSharedValueCurrent()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#getSharedValueID()()` Gets the ID of the SharedValue it will be listening for. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#getStateTransition()()` Gets the type of transition to listen to. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#setSharedValue(int)(sharedValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` sets the SharedValue it will be listening for. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#setSharedValueCurrent(int)(sharedValueCurrent: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#setSharedValueID(int)(sharedValueID: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` sets the ID of the SharedValue it will be listening for. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/motion/widget/ViewTransition#setStateTransition(int)(stateTransition: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` Sets the type of transition to listen to. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/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)

```
const val CONSTRAINT_OVERRIDE = "ConstraintOverride": String!
```

### CUSTOM_ATTRIBUTE

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

```
const val CUSTOM_ATTRIBUTE = "CustomAttribute": String!
```

### CUSTOM_METHOD

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

```
const val CUSTOM_METHOD = "CustomMethod": String!
```

### KEY_FRAME_SET_TAG

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

```
const val KEY_FRAME_SET_TAG = "KeyFrameSet": String!
```

### ONSTATE_ACTION_DOWN

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

```
const val ONSTATE_ACTION_DOWN = 1: Int
```

### ONSTATE_ACTION_DOWN_UP

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

```
const val ONSTATE_ACTION_DOWN_UP = 3: Int
```

### ONSTATE_ACTION_UP

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

```
const val ONSTATE_ACTION_UP = 2: Int
```

### ONSTATE_SHARED_VALUE_SET

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

```
const val ONSTATE_SHARED_VALUE_SET = 4: Int
```

### ONSTATE_SHARED_VALUE_UNSET

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

```
const val ONSTATE_SHARED_VALUE_UNSET = 5: Int
```

### VIEW_TRANSITION_TAG

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

```
const val VIEW_TRANSITION_TAG = "ViewTransition": String!
```

## Public functions

### getSharedValue

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

```
fun getSharedValue(): Int
```

Gets the SharedValue it will be listening for.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` |   |

### getSharedValueCurrent

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

```
fun getSharedValueCurrent(): Int
```

### getSharedValueID

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

```
fun getSharedValueID(): Int
```

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

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | the id of the shared value |

### getStateTransition

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

```
fun getStateTransition(): Int
```

Gets the type of transition to listen to.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | ONSTATE_TRANSITION_\* |

### setSharedValue

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

```
fun setSharedValue(sharedValue: Int): Unit
```

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)

```
fun setSharedValueCurrent(sharedValueCurrent: Int): Unit
```

### setSharedValueID

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

```
fun setSharedValueID(sharedValueID: Int): Unit
```

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)

```
fun setStateTransition(stateTransition: Int): Unit
```

Sets the type of transition to listen to.

| Parameters |
|---|---|
| `stateTransition: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` |   |

### toString

```
fun toString(): String!
```

debug string for a ViewTransition

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` |   |