# StopLogicEngine

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

*** ** * ** ***


```
class StopLogicEngine : StopEngine
```

<br />

*** ** * ** ***

This contains the class to provide the logic for an animation to come to a stop. The setup defines a series of velocity gradients that gets to the desired position ending at 0 velocity. The path is computed such that the velocities are continuous

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/StopLogicEngine.Decelerate : https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/StopEngine` |

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

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/StopLogicEngine#config(float,float,float,float,float,float)( currentPos: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, destination: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, currentVelocity: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, maxTime: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, maxAcceleration: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, maxVelocity: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/StopLogicEngine#debug(java.lang.String,float)(desc: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, time: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` Debugging logic to log the state. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/StopLogicEngine#getInterpolation(float)(v: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/StopLogicEngine#getVelocity()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/StopLogicEngine#getVelocity(float)(x: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/StopLogicEngine#isStopped()()` |

## Public constructors

### StopLogicEngine

Added in 1.1.2

```
StopLogicEngine()
```

## Public functions

### config

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

```
fun config(
    currentPos: Float,
    destination: Float,
    currentVelocity: Float,
    maxTime: Float,
    maxAcceleration: Float,
    maxVelocity: Float
): Unit
```

### debug

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

```
fun debug(desc: String!, time: Float): String!
```

Debugging logic to log the state.

| Parameters |
|---|---|
| `desc: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | Description to pre append |
| `time: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | Time during animation |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | string useful for debugging the state of the StopLogic |

### getInterpolation

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

```
fun getInterpolation(v: Float): Float
```

### getVelocity

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

```
fun getVelocity(): Float
```

### getVelocity

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

```
fun getVelocity(x: Float): Float
```

### isStopped

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

```
fun isStopped(): Boolean
```