TransformationKt

Added in 1.4.0-alpha05

public final class TransformationKt


Summary

Public methods

static final @NonNull LayoutModifier
@RequiresSchemaVersion(major = 1, minor = 400)
pivotX(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float staticValueDp,
    DynamicBuilders.DynamicFloat dynamicValueDp
)

Sets the horizontal pivot offset for scaling and rotation as an absolute distance from the element center.

static final @NonNull LayoutModifier
@RequiresSchemaVersion(major = 1, minor = 400)
pivotY(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float staticValueDp,
    DynamicBuilders.DynamicFloat dynamicValueDp
)

Sets the vertical pivot offset for scaling and rotation as an absolute distance from the element center.

static final @NonNull LayoutModifier
@RequiresSchemaVersion(major = 1, minor = 400)
ratioPivotX(
    @NonNull LayoutModifier receiver,
    float staticRatio,
    DynamicBuilders.DynamicFloat dynamicRatio
)

Sets the horizontal pivot point for scaling and rotation as a location proportional to the bounding box width.

static final @NonNull LayoutModifier
@RequiresSchemaVersion(major = 1, minor = 400)
ratioPivotY(
    @NonNull LayoutModifier receiver,
    float staticRatio,
    DynamicBuilders.DynamicFloat dynamicRatio
)

Sets the vertical pivot point for scaling and rotation as a location proportional to the bounding box height.

static final @NonNull LayoutModifier
@RequiresSchemaVersion(major = 1, minor = 400)
rotate(
    @NonNull LayoutModifier receiver,
    float staticValueDegrees,
    DynamicBuilders.DynamicFloat dynamicValueDegrees
)

Rotates the layout element.

static final @NonNull LayoutModifier
@RequiresSchemaVersion(major = 1, minor = 400)
scaleX(
    @NonNull LayoutModifier receiver,
    @FloatRange(from = 0.0) float staticValue,
    DynamicBuilders.DynamicFloat dynamicValue
)

Scales the layout element along the X axis.

static final @NonNull LayoutModifier
@RequiresSchemaVersion(major = 1, minor = 400)
scaleY(
    @NonNull LayoutModifier receiver,
    @FloatRange(from = 0.0) float staticValue,
    DynamicBuilders.DynamicFloat dynamicValue
)

Scales the layout element along the Y axis.

static final @NonNull LayoutModifier
@RequiresSchemaVersion(major = 1, minor = 400)
translateX(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float staticValueDp,
    DynamicBuilders.DynamicFloat dynamicValueDp
)

Applies a translation to the layout element along the X axis.

static final @NonNull LayoutModifier
@RequiresSchemaVersion(major = 1, minor = 400)
translateY(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float staticValueDp,
    DynamicBuilders.DynamicFloat dynamicValueDp
)

Applies a translation to the layout element along the Y axis.

Public methods

@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier pivotX(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float staticValueDp,
    DynamicBuilders.DynamicFloat dynamicValueDp
)

Sets the horizontal pivot offset for scaling and rotation as an absolute distance from the element center.

Parameters
@Dimension(unit = 0) float staticValueDp

The static horizontal pivot in DP.

DynamicBuilders.DynamicFloat dynamicValueDp

The dynamic horizontal pivot offset.

@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier pivotY(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float staticValueDp,
    DynamicBuilders.DynamicFloat dynamicValueDp
)

Sets the vertical pivot offset for scaling and rotation as an absolute distance from the element center.

Parameters
@Dimension(unit = 0) float staticValueDp

The static vertical pivot in DP.

DynamicBuilders.DynamicFloat dynamicValueDp

The dynamic vertical pivot offset.

@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier ratioPivotX(
    @NonNull LayoutModifier receiver,
    float staticRatio,
    DynamicBuilders.DynamicFloat dynamicRatio
)

Sets the horizontal pivot point for scaling and rotation as a location proportional to the bounding box width.

Parameters
float staticRatio

The static horizontal pivot ratio (e.g., 0.5 for center). Value outside 0, 1 are also valid.

DynamicBuilders.DynamicFloat dynamicRatio

The dynamic horizontal pivot ratio.

@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier ratioPivotY(
    @NonNull LayoutModifier receiver,
    float staticRatio,
    DynamicBuilders.DynamicFloat dynamicRatio
)

Sets the vertical pivot point for scaling and rotation as a location proportional to the bounding box height.

Parameters
float staticRatio

The static vertical pivot ratio (e.g., 0.5 for center). Value outside 0, 1 are also valid.

DynamicBuilders.DynamicFloat dynamicRatio

The dynamic vertical pivot ratio.

@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier rotate(
    @NonNull LayoutModifier receiver,
    float staticValueDegrees,
    DynamicBuilders.DynamicFloat dynamicValueDegrees
)

Rotates the layout element. Positive values result in clockwise rotation.

Parameters
float staticValueDegrees

The static rotation angle in degrees.

DynamicBuilders.DynamicFloat dynamicValueDegrees

The dynamic rotations angle for animations or state binding.

@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier scaleX(
    @NonNull LayoutModifier receiver,
    @FloatRange(from = 0.0) float staticValue,
    DynamicBuilders.DynamicFloat dynamicValue
)

Scales the layout element along the X axis.

Parameters
@FloatRange(from = 0.0) float staticValue

The static scale factor (1.0 is original size).

DynamicBuilders.DynamicFloat dynamicValue

The dynamic scale factor for animations or state binding.

@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier scaleY(
    @NonNull LayoutModifier receiver,
    @FloatRange(from = 0.0) float staticValue,
    DynamicBuilders.DynamicFloat dynamicValue
)

Scales the layout element along the Y axis.

Parameters
@FloatRange(from = 0.0) float staticValue

The static scale factor (1.0 is original size).

DynamicBuilders.DynamicFloat dynamicValue

The dynamic scale factor for animations or state binding.

@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier translateX(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float staticValueDp,
    DynamicBuilders.DynamicFloat dynamicValueDp
)

Applies a translation to the layout element along the X axis.

Parameters
@Dimension(unit = 0) float staticValueDp

The static offset in DP.

DynamicBuilders.DynamicFloat dynamicValueDp

The dynamic offset for animations or state binding.

@RequiresSchemaVersion(major = 1, minor = 400)
public static final @NonNull LayoutModifier translateY(
    @NonNull LayoutModifier receiver,
    @Dimension(unit = 0) float staticValueDp,
    DynamicBuilders.DynamicFloat dynamicValueDp
)

Applies a translation to the layout element along the Y axis.

Parameters
@Dimension(unit = 0) float staticValueDp

The static offset in DP.

DynamicBuilders.DynamicFloat dynamicValueDp

The dynamic offset for animations or state binding.