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

*** ** * ** ***


```
public class StopLogicEngine implements 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 |
|---|
| `public class https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/StopLogicEngine.Decelerate implements https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/StopEngine` |

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

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

## Public constructors

### StopLogicEngine

Added in 1.1.2

```
public StopLogicEngine()
```

## Public methods

### config

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

```
public void config(
    float currentPos,
    float destination,
    float currentVelocity,
    float maxTime,
    float maxAcceleration,
    float maxVelocity
)
```

### debug

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

```
public String debug(String desc, float time)
```

Debugging logic to log the state.

| Parameters |
|---|---|
| `https://developer.android.com/reference/java/lang/String.html desc` | Description to pre append |
| `float time` | Time during animation |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/lang/String.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)

```
public float getInterpolation(float v)
```

### getVelocity

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

```
public float getVelocity()
```

### getVelocity

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

```
public float getVelocity(float x)
```

### isStopped

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

```
public boolean isStopped()
```