Start native apps faster with the Composables CLI ->
Function

toMeter

Converts a Dp value to Meter.

toMeter

Deprecated

Use LocalSession.current?.scene?.virtualPixelDensity instead. See androidx.xr.compose.samples.SceneCoreEntitySample for an example.

Source set: Android
public inline fun Dp.toMeter(): Meter

Converts a Dp value to Meter.

Handles unspecified and infinite Dp values gracefully.

Returns

the equivalent value in meters, or Meter.NaN if the Dp is unspecified, or Meter.Infinity if the Dp is infinite.

Last updated: