# Transition.Segment

Artifact: [androidx.compose.animation:animation-core](https://developer.android.com/jetpack/androidx/releases/compose-animation) [View Source](https://cs.android.com/search?q=file:androidx/compose/animation/core/Transition.kt+class:androidx.compose.animation.core.Transition.Segment) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.0.0) Common/All
- Cmn

  ```
  interface Transition.Segment<S : Any?>
  ```
Known direct subclasses [AnimatedContentTransitionScope](https://developer.android.com/reference/kotlin/androidx/compose/animation/AnimatedContentTransitionScope)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/animation/AnimatedContentTransitionScope` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/AnimatedContentTransitionScope` provides functions that are convenient and only applicable in the context of `https://developer.android.com/reference/kotlin/androidx/compose/animation/AnimatedContent.composable#AnimatedContent(kotlin.Any,androidx.compose.ui.Modifier,kotlin.Function1,androidx.compose.ui.Alignment,kotlin.String,kotlin.Function1,kotlin.Function2)`, such as `https://developer.android.com/reference/kotlin/androidx/compose/animation/AnimatedContentTransitionScope#slideIntoContainer(androidx.compose.animation.AnimatedContentTransitionScope.SlideDirection,androidx.compose.animation.core.FiniteAnimationSpec,kotlin.Function1)` and `https://developer.android.com/reference/kotlin/androidx/compose/animation/AnimatedContentTransitionScope#slideOutOfContainer(androidx.compose.animation.AnimatedContentTransitionScope.SlideDirection,androidx.compose.animation.core.FiniteAnimationSpec,kotlin.Function1)`. |

*** ** * ** ***

`https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Transition.Segment` holds `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Transition.Segment#initialState()` and `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Transition.Segment#targetState()`, which are the beginning and end of a transition. These states will be used to obtain the animation spec that will be used for this transition from the child animations.

## Summary

| ### Public functions |
|---|---|---|
| `open infix https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `S.https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Transition.Segment#(kotlin.Any).isTransitioningTo(kotlin.Any)(targetState: S)` Returns whether the provided state matches the `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Transition.Segment#initialState()`\&\& the provided `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Transition.Segment#(kotlin.Any).isTransitioningTo(kotlin.Any)` matches `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Transition.Segment#targetState()`. | Cmn |

| ### Public properties |
|---|---|---|
| `S` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Transition.Segment#initialState()` Initial state of a Transition Segment. | Cmn |
| `S` | `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Transition.Segment#targetState()` Target state of a Transition Segment. | Cmn |

## Public functions

### S.isTransitioningTo

Cmn Artifact: [androidx.compose.animation:animation-core](https://developer.android.com/jetpack/androidx/releases/compose-animation) [View Source](https://cs.android.com/search?q=file:androidx/compose/animation/core/Transition.kt+function:isTransitioningTo) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.0.0)

```
open infix fun S.isTransitioningTo(targetState: S): Boolean
```

Returns whether the provided state matches the `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Transition.Segment#initialState()`\&\& the provided `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Transition.Segment#(kotlin.Any).isTransitioningTo(kotlin.Any)` matches `https://developer.android.com/reference/kotlin/androidx/compose/animation/core/Transition.Segment#targetState()`.

## Public properties

### initialState

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.0.0)

```
val initialState: S
```

Initial state of a Transition Segment. This is the state that transition starts from.

### targetState

Cmn Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/compose-animation#1.0.0)

```
val targetState: S
```

Target state of a Transition Segment. This is the state that transition will end on.