# CustomVariable

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/CustomVariable.java+class:androidx.constraintlayout.core.motion.CustomVariable) Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

*** ** * ** ***

<br />

```
class CustomVariable
```

<br />

*** ** * ** ***

Defines non standard Attributes

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#CustomVariable(androidx.constraintlayout.core.motion.CustomVariable)(c: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable!)` |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#CustomVariable(java.lang.String,int)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, attributeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#CustomVariable(androidx.constraintlayout.core.motion.CustomVariable,java.lang.Object)(source: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable!, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#CustomVariable(java.lang.String,int,java.lang.Object)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, attributeType: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#CustomVariable(java.lang.String,int,boolean)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#CustomVariable(java.lang.String,int,float)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#CustomVariable(java.lang.String,int,int)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#CustomVariable(java.lang.String,int,java.lang.String)(name: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!, type: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#applyToWidget(androidx.constraintlayout.core.motion.MotionWidget)(view: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/MotionWidget!)` |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#colorString(int)(v: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#copy()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#diff(androidx.constraintlayout.core.motion.CustomVariable)(customAttribute: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable!)` test if the two attributes are different |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#getBooleanValue()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#getColorValue()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#getFloatValue()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#getIntegerValue()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#getInterpolatedColor(float[])(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<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/CustomVariable#getName()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#getStringValue()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#getType()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#getValueToInterpolate()()` Transforms value to a float for the purpose of interpolation |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#getValuesToInterpolate(float[])(ret: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!)` |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#hsvToRgb(float,float,float)(hue: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, saturation: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, value: 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/CustomVariable#isContinuous()()` Continuous types are interpolated they are fired only at |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#numberOfInterpolatedValues()()` The number of interpolation values that need to be interpolated Typically 1 but 3 for colors. |
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#rgbaTocColor(float,float,float,float)(r: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, g: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, b: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, a: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#setBooleanValue(boolean)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#setFloatValue(float)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#setIntValue(int)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#setInterpolatedValue(androidx.constraintlayout.core.motion.MotionWidget,float[])(view: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/MotionWidget!, value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html>!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#setStringValue(java.lang.String)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#setValue(java.lang.Object)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomVariable#setValue(float[])(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float-array/index.html<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/CustomVariable#toString()()` |

## Public constructors

### CustomVariable

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

```
CustomVariable(c: CustomVariable!)
```

### CustomVariable

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

```
CustomVariable(name: String!, attributeType: Int)
```

### CustomVariable

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

```
CustomVariable(source: CustomVariable!, value: Any!)
```

### CustomVariable

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

```
CustomVariable(name: String!, attributeType: Int, value: Any!)
```

### CustomVariable

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

```
CustomVariable(name: String!, type: Int, value: Boolean)
```

### CustomVariable

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

```
CustomVariable(name: String!, type: Int, value: Float)
```

### CustomVariable

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

```
CustomVariable(name: String!, type: Int, value: Int)
```

### CustomVariable

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

```
CustomVariable(name: String!, type: Int, value: String!)
```

## Public functions

### applyToWidget

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

```
fun applyToWidget(view: MotionWidget!): Unit
```

### colorString

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

```
java-static fun colorString(v: Int): String!
```

### copy

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

```
fun copy(): CustomVariable!
```

### diff

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

```
fun diff(customAttribute: CustomVariable!): Boolean
```

test if the two attributes are different

### getBooleanValue

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

```
fun getBooleanValue(): Boolean
```

### getColorValue

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

```
fun getColorValue(): Int
```

### getFloatValue

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

```
fun getFloatValue(): Float
```

### getIntegerValue

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

```
fun getIntegerValue(): Int
```

### getInterpolatedColor

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

```
fun getInterpolatedColor(value: FloatArray<Float>!): Int
```

### getName

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

```
fun getName(): String!
```

### getStringValue

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

```
fun getStringValue(): String!
```

### getType

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

```
fun getType(): Int
```

### getValueToInterpolate

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

```
fun getValueToInterpolate(): Float
```

Transforms value to a float for the purpose of interpolation

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | interpolation value |

### getValuesToInterpolate

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

```
fun getValuesToInterpolate(ret: FloatArray<Float>!): Unit
```

### hsvToRgb

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

```
java-static fun hsvToRgb(hue: Float, saturation: Float, value: Float): Int
```

### isContinuous

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

```
fun isContinuous(): Boolean
```

Continuous types are interpolated they are fired only at

### numberOfInterpolatedValues

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

```
fun numberOfInterpolatedValues(): Int
```

The number of interpolation values that need to be interpolated Typically 1 but 3 for colors.

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | Typically 1 but 3 for colors. |

### rgbaTocColor

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

```
java-static fun rgbaTocColor(r: Float, g: Float, b: Float, a: Float): Int
```

### setBooleanValue

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

```
fun setBooleanValue(value: Boolean): Unit
```

### setFloatValue

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

```
fun setFloatValue(value: Float): Unit
```

### setIntValue

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

```
fun setIntValue(value: Int): Unit
```

### setInterpolatedValue

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

```
fun setInterpolatedValue(view: MotionWidget!, value: FloatArray<Float>!): Unit
```

### setStringValue

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

```
fun setStringValue(value: String!): Unit
```

### setValue

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

```
fun setValue(value: Any!): Unit
```

### setValue

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

```
fun setValue(value: FloatArray<Float>!): Unit
```

### toString

```
fun toString(): String!
```