UiConfiguration

@Serializable
class UiConfiguration(val darkMode: Boolean = false, val safeAreaInsets: Margin = Margin.Zero, val viewInsets: Margin = Margin.Zero, val viewportSize: Size? = null, val density: Double = 1.0, val layoutDirection: LayoutDirection = LayoutDirection.Ltr)

Constructors

Link copied to clipboard
constructor(darkMode: Boolean = false, safeAreaInsets: Margin = Margin.Zero, viewInsets: Margin = Margin.Zero, viewportSize: Size? = null, density: Double = 1.0, layoutDirection: LayoutDirection = LayoutDirection.Ltr)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val darkMode: Boolean = false

True if the device is configured to use a dark color palette.

Link copied to clipboard
val density: Double = 1.0

The density of the display. This can be used to convert Dp within other properties back to raw pixels, if needed.

Link copied to clipboard

The device's layout direction. This defines whether Start alignment means left (as in LayoutDirection.Ltr) or right (as in LayoutDirection.Rtl), and conversely whether End alignment means right or left.

Link copied to clipboard

The insets of the host window, independent of where the Redwood composition is positioned within it. The Redwood composition is not responsible for consuming these insets.

Link copied to clipboard

The insets of the viewport that the composition is responsible for consuming.

Link copied to clipboard
val viewportSize: Size? = null

The size of the viewport into which the composition is rendering. This could be as lage as the entire screen or as small as an individual view within a larger native screen.

Functions

Link copied to clipboard
fun copy(darkMode: Boolean = this.darkMode, safeAreaInsets: Margin = this.safeAreaInsets, viewInsets: Margin = this.viewInsets, viewportSize: Size? = this.viewportSize, density: Double = this.density, layoutDirection: LayoutDirection = this.layoutDirection): UiConfiguration