# CustomAttribute

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

*** ** * ** ***

<br />

```
class CustomAttribute
```

<br />

*** ** * ** ***

Defines non standard Attributes

## Summary

| ### Nested types |
|---|
| `enum https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomAttribute.AttributeType` |

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

| ### Public functions |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomAttribute#diff(androidx.constraintlayout.core.motion.CustomAttribute)(customAttribute: https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomAttribute!)` test if the two attributes are different |
| `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomAttribute.AttributeType!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomAttribute#getType()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomAttribute#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/CustomAttribute#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/CustomAttribute#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/CustomAttribute#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/CustomAttribute#numberOfInterpolatedValues()()` The number of interpolation values that need to be interpolated Typically 1 but 3 for colors. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/CustomAttribute#setColorValue(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/CustomAttribute#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/CustomAttribute#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/CustomAttribute#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/CustomAttribute#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/CustomAttribute#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>!)` |

## Public constructors

### CustomAttribute

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

```
CustomAttribute(
    name: String!,
    attributeType: CustomAttribute.AttributeType!
)
```

### CustomAttribute

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

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

### CustomAttribute

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

```
CustomAttribute(
    name: String!,
    attributeType: CustomAttribute.AttributeType!,
    value: Any!,
    method: Boolean
)
```

## Public functions

### diff

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

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

test if the two attributes are different

### getType

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

```
fun getType(): CustomAttribute.AttributeType!
```

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

### setColorValue

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

```
fun setColorValue(value: Int): 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
```

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