# BaseKeyFrameScope

Artifact: [androidx.constraintlayout:constraintlayout-compose](https://developer.android.com/jetpack/androidx/releases/constraintlayout) [View Source](https://cs.android.com/search?q=file:androidx/constraintlayout/compose/TransitionScope.kt+class:androidx.constraintlayout.compose.BaseKeyFrameScope) Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)


```
@ExperimentalMotionApi
sealed class BaseKeyFrameScope
```

<br />

Known direct subclasses [KeyAttributeScope](https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/KeyAttributeScope), [KeyCycleScope](https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/KeyCycleScope), [KeyPositionScope](https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/KeyPositionScope)

|---|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/KeyAttributeScope` | Scope to define KeyFrame attributes. |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/KeyCycleScope` | Scope to define cycling KeyFrames. |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/KeyPositionScope` | Scope to define KeyFrame positions. |

*** ** * ** ***

The base/common scope for individual KeyFrame declarations.

Properties should be registered on `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/BaseKeyFrameScope#keyFramePropertiesValue()`, however, custom properties must use `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/BaseKeyFrameScope#customPropertiesValue()`.

## Summary

| ### Protected constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/BaseKeyFrameScope#BaseKeyFrameScope()()` |

| ### Protected functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.properties/-observable-property/index.html<E>` | `<E : https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/NamedPropertyOrValue?> https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/BaseKeyFrameScope#addNameOnPropertyChange(androidx.constraintlayout.compose.NamedPropertyOrValue,kotlin.String)( initialValue: E, nameOverride: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html? )` Property delegate that updates the `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/BaseKeyFrameScope#keyFramePropertiesValue()` map on value changes. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.properties/-observable-property/index.html<T>` | `<T : https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?> https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/BaseKeyFrameScope#addOnPropertyChange(kotlin.Any,kotlin.String)(initialValue: T, nameOverride: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html?)` When changed, updates the value of type `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/BaseKeyFrameScope#addOnPropertyChange(kotlin.Any,kotlin.String)` on the `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/BaseKeyFrameScope#keyFramePropertiesValue()` map. |

## Protected constructors

### BaseKeyFrameScope

```
protected BaseKeyFrameScope()
```

## Protected functions

### addNameOnPropertyChange

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

```
protected fun <E : NamedPropertyOrValue?> addNameOnPropertyChange(
    initialValue: E,
    nameOverride: String? = null
): ObservableProperty<E>
```

Property delegate that updates the `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/BaseKeyFrameScope#keyFramePropertiesValue()` map on value changes.

Where the Key is the property's name unless `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/BaseKeyFrameScope#addNameOnPropertyChange(androidx.constraintlayout.compose.NamedPropertyOrValue,kotlin.String)` is not null.

The value is the String given by `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/NamedPropertyOrValue#name()`.

Use when declaring properties that have a named value.

E.g.: `var curveFit: CurveFit? by addNameOnPropertyChange(null)`

### addOnPropertyChange

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

```
protected fun <T : Any?> addOnPropertyChange(initialValue: T, nameOverride: String? = null): ObservableProperty<T>
```

When changed, updates the value of type `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/BaseKeyFrameScope#addOnPropertyChange(kotlin.Any,kotlin.String)` on the `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/BaseKeyFrameScope#keyFramePropertiesValue()` map.

Where the Key is the property's name unless `https://developer.android.com/reference/kotlin/androidx/constraintlayout/compose/BaseKeyFrameScope#addOnPropertyChange(kotlin.Any,kotlin.String)` is not null.