class RemoteDensity


Represents the screen density and font scale factor used for unit conversions in a remote composition context. Similar to Compose Density.

Summary

Public companion properties

RemoteDensity

A RemoteDensity instance that represents the host's screen density, with font scale derived from the host's system font size and density settings.

Public constructors

RemoteDensity(density: RemoteFloat, fontScale: RemoteFloat)

Public functions

RemoteFloat

Converts a TextUnit to pixels using this RemoteDensity.

RemoteFloat

Converts a Dp to pixels using this RemoteDensity.

Public properties

RemoteFloat

The logical density of the display, used to convert DP to pixels.

RemoteFloat

The current user preference for the scaling factor for fonts.

Public companion properties

Host

Added in 1.0.0-alpha21
val Host: RemoteDensity

A RemoteDensity instance that represents the host's screen density, with font scale derived from the host's system font size and density settings.

Public constructors

RemoteDensity

Added in 1.0.0-alpha21
RemoteDensity(density: RemoteFloat, fontScale: RemoteFloat)

Public functions

fun TextUnit.toPx(): RemoteFloat

Converts a TextUnit to pixels using this RemoteDensity.

fun Dp.toPx(): RemoteFloat

Converts a Dp to pixels using this RemoteDensity.

Public properties

density

Added in 1.0.0-alpha21
val density: RemoteFloat

The logical density of the display, used to convert DP to pixels.

fontScale

Added in 1.0.0-alpha21
val fontScale: RemoteFloat

The current user preference for the scaling factor for fonts.