Density

@Serializable
value class Density(val rawDensity: Double)

Represents a device's display density.

Parameters

rawDensity

The raw, platform-specific density which hasn't been normalized with respect to other platforms.

Constructors

Link copied to clipboard
constructor(rawDensity: Double)

Types

Link copied to clipboard
object Companion

Empty companion object used for extensions.

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun Double.toDp(): Dp
fun Float.toDp(): Dp
fun Int.toDp(): Dp

Convert a pixel value into a Dp.

Link copied to clipboard
fun Dp.toPx(): Double

Convert a Dp into a pixel value.

Link copied to clipboard
fun Dp.toPxInt(): Int

Convert a Dp into the nearest integer pixel value.