{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

VectorConvertersKt

public final class VectorConvertersKt


Summary

Public methods

static final @NonNull TwoWayConverter<@NonNull T, @NonNull V>
<T extends Object, V extends AnimationVector> TwoWayConverter(
    @NonNull Function1<@NonNull T, @NonNull V> convertToVector,
    @NonNull Function1<@NonNull V, @NonNull T> convertFromVector
)

Factory method to create a TwoWayConverter that converts a type T from and to an AnimationVector type.

static final @NonNull TwoWayConverter<@NonNull Dp, @NonNull AnimationVector1D>

A type converter that converts a Dp to a AnimationVector1D, and vice versa.

static final @NonNull TwoWayConverter<@NonNull DpOffset, @NonNull AnimationVector2D>

A type converter that converts a DpOffset to a AnimationVector2D, and vice versa.

static final @NonNull TwoWayConverter<@NonNull Float, @NonNull AnimationVector1D>

A TwoWayConverter that converts Float from and to AnimationVector1D

static final @NonNull TwoWayConverter<@NonNull Integer, @NonNull AnimationVector1D>

A TwoWayConverter that converts Int from and to AnimationVector1D

static final @NonNull TwoWayConverter<@NonNull IntOffset, @NonNull AnimationVector2D>

A type converter that converts a IntOffset to a AnimationVector2D, and vice versa.

static final @NonNull TwoWayConverter<@NonNull IntSize, @NonNull AnimationVector2D>

A type converter that converts a IntSize to a AnimationVector2D, and vice versa.

static final @NonNull TwoWayConverter<@NonNull Offset, @NonNull AnimationVector2D>

A type converter that converts a Offset to a AnimationVector2D, and vice versa.

static final @NonNull TwoWayConverter<@NonNull Rect, @NonNull AnimationVector4D>

A type converter that converts a Rect to a AnimationVector4D, and vice versa.

static final @NonNull TwoWayConverter<@NonNull Size, @NonNull AnimationVector2D>

A type converter that converts a Size to a AnimationVector2D, and vice versa.

Public methods

TwoWayConverter

public static final @NonNull TwoWayConverter<@NonNull T, @NonNull V> <T extends Object, V extends AnimationVector> TwoWayConverter(
    @NonNull Function1<@NonNull T, @NonNull V> convertToVector,
    @NonNull Function1<@NonNull V, @NonNull T> convertFromVector
)

Factory method to create a TwoWayConverter that converts a type T from and to an AnimationVector type.

Parameters
@NonNull Function1<@NonNull T, @NonNull V> convertToVector

converts from type T to AnimationVector

@NonNull Function1<@NonNull V, @NonNull T> convertFromVector

converts from AnimationVector to type T

getVectorConverter

public static final @NonNull TwoWayConverter<@NonNull Dp, @NonNull AnimationVector1DgetVectorConverter(@NonNull Dp.Companion receiver)

A type converter that converts a Dp to a AnimationVector1D, and vice versa.

getVectorConverter

public static final @NonNull TwoWayConverter<@NonNull DpOffset, @NonNull AnimationVector2DgetVectorConverter(@NonNull DpOffset.Companion receiver)

A type converter that converts a DpOffset to a AnimationVector2D, and vice versa.

getVectorConverter

public static final @NonNull TwoWayConverter<@NonNull Float, @NonNull AnimationVector1DgetVectorConverter(@NonNull FloatCompanionObject receiver)

A TwoWayConverter that converts Float from and to AnimationVector1D

getVectorConverter

public static final @NonNull TwoWayConverter<@NonNull Integer, @NonNull AnimationVector1DgetVectorConverter(@NonNull IntCompanionObject receiver)

A TwoWayConverter that converts Int from and to AnimationVector1D

getVectorConverter

public static final @NonNull TwoWayConverter<@NonNull IntOffset, @NonNull AnimationVector2DgetVectorConverter(@NonNull IntOffset.Companion receiver)

A type converter that converts a IntOffset to a AnimationVector2D, and vice versa.

getVectorConverter

public static final @NonNull TwoWayConverter<@NonNull IntSize, @NonNull AnimationVector2DgetVectorConverter(@NonNull IntSize.Companion receiver)

A type converter that converts a IntSize to a AnimationVector2D, and vice versa.

getVectorConverter

public static final @NonNull TwoWayConverter<@NonNull Offset, @NonNull AnimationVector2DgetVectorConverter(@NonNull Offset.Companion receiver)

A type converter that converts a Offset to a AnimationVector2D, and vice versa.

getVectorConverter

public static final @NonNull TwoWayConverter<@NonNull Rect, @NonNull AnimationVector4DgetVectorConverter(@NonNull Rect.Companion receiver)

A type converter that converts a Rect to a AnimationVector4D, and vice versa.

getVectorConverter

public static final @NonNull TwoWayConverter<@NonNull Size, @NonNull AnimationVector2DgetVectorConverter(@NonNull Size.Companion receiver)

A type converter that converts a Size to a AnimationVector2D, and vice versa.