# IntEvaluator

Artifact: [androidx.core:core-animation](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/animation/IntEvaluator.java+class:androidx.core.animation.IntEvaluator) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/core#1.0.0)

*** ** * ** ***


```
class IntEvaluator : TypeEvaluator<Int!>
```

<br />

*** ** * ** ***

This evaluator can be used to perform type interpolation between `int` values.

## Summary

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/core/animation/IntEvaluator#evaluate(float,java.lang.Integer,java.lang.Integer)(fraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, startValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, endValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` This function returns the result of linearly interpolating the start and end values, with `fraction` representing the proportion between the start and end values. |
| `java-static https://developer.android.com/reference/kotlin/androidx/core/animation/IntEvaluator` | `https://developer.android.com/reference/kotlin/androidx/core/animation/IntEvaluator#getInstance()()` Returns an instance of `IntEvaluator` that may be used in `https://developer.android.com/reference/kotlin/androidx/core/animation/ValueAnimator#setEvaluator(androidx.core.animation.TypeEvaluator)`. |

## Public functions

### evaluate

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

```
fun evaluate(fraction: Float, startValue: Int, endValue: Int): Int
```

This function returns the result of linearly interpolating the start and end values, with `fraction` representing the proportion between the start and end values. The calculation is a simple parametric calculation: `result = x0 + t * (x1 - x0)`, where `x0` is `startValue`, `x1` is `endValue`, and `t` is `fraction`.

| Parameters |
|---|---|
| `fraction: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | The fraction from the starting to the ending values |
| `startValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The start value; should be of type `int` or `Integer` |
| `endValue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | The end value; should be of type `int` or `Integer` |

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | A linear interpolation between the start and end values, given the `fraction` parameter. |

### getInstance

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

```
java-static fun getInstance(): IntEvaluator
```

Returns an instance of `IntEvaluator` that may be used in `https://developer.android.com/reference/kotlin/androidx/core/animation/ValueAnimator#setEvaluator(androidx.core.animation.TypeEvaluator)`. The same instance may be used in multiple `Animator`s because it holds no state.

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/core/animation/IntEvaluator` | An instance of `IntEvaluator`. |