RelativeOffsetModifierElement

data class RelativeOffsetModifierElement(val horizontal: UiDp, val vertical: UiDp) : ModifierElement(source)

Offsets final placement along the logical horizontal axis without changing measured size.

Positive horizontal moves toward the logical end edge: right in LTR and left in RTL. Positive vertical moves down. Callers should normally create this Q3 coordinate contract through offsetRelative.

Samples

val modifier = Modifier
    .paddingRelative(start = 16.dp, end = 24.dp)
    .marginRelative(start = 8.dp, end = 12.dp)
    .offsetRelative(horizontal = 4.dp)
    .systemBarsInsetsPaddingRelative(start = true, top = false, end = false, bottom = false)
    .imeInsetsPaddingRelative(bottom = true)

check(modifier.elements.size == 5)

Constructors

Link copied to clipboard
constructor(horizontal: UiDp, vertical: UiDp)

Properties

Link copied to clipboard

logical horizontal offset in dp, positive toward end

Link copied to clipboard

physical vertical offset in dp, positive down