🌈 Create new beautiful Compose Gradients with our new wesite ->
Class

VerticalRuler

A vertical Ruler.

Source set: Common
public class VerticalRuler private constructor(calculation: (PlacementScope.(Float) -> Float)?) :
    Ruler(calculation)

A vertical Ruler. Defines a line that can be used by parent layouts to align or position their children horizontally. The position of the ruler can be retrieved with Placeable.PlacementScope.current and can be set with MeasureScope.layout using RulerScope.provides or RulerScope.providesRelative.

Functions

calculateCoordinate

Source set: Common
override fun calculateCoordinate(
        coordinate: Float,
        sourceCoordinates: LayoutCoordinates,
        targetCoordinates: LayoutCoordinates,
    ): Float

Creates a VerticalRuler whose values are directly provided. The developer can set the ruler value in MeasureScope.layout using RulerScope.provides or RulerScope.providesRelative.

Members

Companion

Source set: Common
public companion object

Functions

maxOf

Source set: Common
public fun maxOf(vararg rulers: VerticalRuler): VerticalRuler

Creates a VerticalRuler derived from the greater value of all VerticalRulers in rulers that supply a value. This is the bottom-most of all provided ruler values.

minOf

Source set: Common
public fun minOf(vararg rulers: VerticalRuler): VerticalRuler

Creates a VerticalRuler derived from the least value of all VerticalRulers in rulers that supply a value. This is the top-most of all provided ruler values.

derived

Source set: Common
public fun derived(
            calculation: PlacementScope.(defaultValue: Float) -> Float
        ): VerticalRuler

Creates a VerticalRuler whose values are derived from values available in the PlacementScope, such as other VerticalRulers.

Parameters

calculation A function that calculates the value of the ruler

Content updated: