Function

Density

Creates a Density for this Context.

Density

Source set: Android
public fun Density(context: Context): Density

Creates a Density for this Context.

Parameters

context density values will be extracted from this Context

Density

Source set: Common
public 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.
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: