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

*** ** * ** ***


```
public class CustomAttribute
```

<br />

*** ** * ** ***

Defines non standard Attributes

## Summary

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

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute#CustomAttribute(java.lang.String,androidx.constraintlayout.core.motion.CustomAttribute.AttributeType)( https://developer.android.com/reference/java/lang/String.html name, https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute.AttributeType attributeType )` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute#CustomAttribute(androidx.constraintlayout.core.motion.CustomAttribute,java.lang.Object)(https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute source, https://developer.android.com/reference/java/lang/Object.html value)` |
| `https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute#CustomAttribute(java.lang.String,androidx.constraintlayout.core.motion.CustomAttribute.AttributeType,java.lang.Object,boolean)( https://developer.android.com/reference/java/lang/String.html name, https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute.AttributeType attributeType, https://developer.android.com/reference/java/lang/Object.html value, boolean method )` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute#diff(androidx.constraintlayout.core.motion.CustomAttribute)(https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute customAttribute)` test if the two attributes are different |
| `https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute.AttributeType` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute#getType()()` |
| `float` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute#getValueToInterpolate()()` Transforms value to a float for the purpose of interpolation |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute#getValuesToInterpolate(float[])(float[] ret)` |
| `static int` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute#hsvToRgb(float,float,float)(float hue, float saturation, float value)` |
| `boolean` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute#isContinuous()()` Continuous types are interpolated they are fired only at |
| `int` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute#numberOfInterpolatedValues()()` The number of interpolation values that need to be interpolated Typically 1 but 3 for colors. |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute#setColorValue(int)(int value)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute#setFloatValue(float)(float value)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute#setIntValue(int)(int value)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute#setStringValue(java.lang.String)(https://developer.android.com/reference/java/lang/String.html value)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute#setValue(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html value)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/CustomAttribute#setValue(float[])(float[] value)` |

## Public constructors

### CustomAttribute

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

```
public CustomAttribute(
    String name,
    CustomAttribute.AttributeType attributeType
)
```

### CustomAttribute

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

```
public CustomAttribute(CustomAttribute source, Object value)
```

### CustomAttribute

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

```
public CustomAttribute(
    String name,
    CustomAttribute.AttributeType attributeType,
    Object value,
    boolean method
)
```

## Public methods

### diff

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

```
public boolean diff(CustomAttribute customAttribute)
```

test if the two attributes are different

### getType

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

```
public CustomAttribute.AttributeType getType()
```

### getValueToInterpolate

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

```
public float getValueToInterpolate()
```

Transforms value to a float for the purpose of interpolation

| Returns |
|---|---|
| `float` | interpolation value |

### getValuesToInterpolate

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

```
public void getValuesToInterpolate(float[] ret)
```

### hsvToRgb

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

```
public static int hsvToRgb(float hue, float saturation, float value)
```

### isContinuous

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

```
public boolean isContinuous()
```

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)

```
public int numberOfInterpolatedValues()
```

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

| Returns |
|---|---|
| `int` | Typically 1 but 3 for colors. |

### setColorValue

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

```
public void setColorValue(int value)
```

### setFloatValue

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

```
public void setFloatValue(float value)
```

### setIntValue

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

```
public void setIntValue(int value)
```

### setStringValue

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

```
public void setStringValue(String value)
```

### setValue

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

```
public void setValue(Object value)
```

### setValue

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

```
public void setValue(float[] value)
```