Property

dp

Create a Dp using an Int: val left = 10 val x = left.dp // -- or -- val y = 10.dp

Source set: Common
public inline val Int.dp: Dp

Create a Dp using an Int: val left = 10 val x = left.dp // -- or -- val y = 10.dp

Source set: Common
public inline val Double.dp: Dp

Create a Dp using a Double: val left = 10.0 val x = left.dp // -- or -- val y = 10.0.dp

Source set: Common
public inline val Float.dp: Dp

Create a Dp using a Float: val left = 10f val x = left.dp // -- or -- val y = 10f.dp

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: