TranslationScope

Known direct subclasses
LayerStyleScope

This interface is deprecated. This scope type is being removed.

Known indirect subclasses
StyleScope

This interface is deprecated. This scope type is being removed.


An interface that introduces the translation properties to a Style receiver scope.

See also
StyleScope

Summary

Public functions

Unit
translationX(value: @FloatRange(from = 0.0) Float)

This function is deprecated. This scope type is being removed.

Cmn
Unit
translationY(value: @FloatRange(from = 0.0) Float)

This function is deprecated. This scope type is being removed.

Cmn

Extension functions

Unit

This function is deprecated. This style property is being removed.

Cmn
Unit
@ExperimentalFoundationStyleApi
TranslationScope.translation(
    x: @FloatRange(from = 0.0) Float,
    y: @FloatRange(from = 0.0) Float
)

This function is deprecated. This style property is being removed.

Cmn

Public functions

translationX

fun translationX(value: @FloatRange(from = 0.0) Float): Unit

Translates (moves) the component horizontally. Positive values move it to the right, negative values to the left.

This property is not inherited

Parameters
value: @FloatRange(from = 0.0) Float

The translation amount on the X-axis in pixels.

translationY

fun translationY(value: @FloatRange(from = 0.0) Float): Unit

Translates (moves) the component vertically. Positive values move it down, negative values up.

This property is not inherited

Parameters
value: @FloatRange(from = 0.0) Float

The translation amount on the Y-axis in pixels.

Extension functions

TranslationScope.translation

@ExperimentalFoundationStyleApi
fun TranslationScope.translation(offset: Offset): Unit

Translates (moves) the component by the given Offset.

This property is not inherited

Parameters
offset: Offset

The translation offset in pixels.

TranslationScope.translation

@ExperimentalFoundationStyleApi
fun TranslationScope.translation(
    x: @FloatRange(from = 0.0) Float,
    y: @FloatRange(from = 0.0) Float
): Unit

Translates (moves) the component horizontally and vertically.

This property is not inherited

Parameters
x: @FloatRange(from = 0.0) Float

The translation amount on the X-axis in pixels.

y: @FloatRange(from = 0.0) Float

The translation amount on the Y-axis in pixels.