Density
Function
Common
fun Density(density: Float, fontScale: Float = 1f): Density
A density of the screen. Used for convert Dp
to pixels.
Parameters
density | The logical density of the display. This is a scaling factor for the Dp unit. |
fontScale | Current user preference for the scaling factor for fonts. |
Android
fun Density(context: Context): Density
Creates a Density
for this Context
.
Parameters
context | density values will be extracted from this Context |