Android dp
extensions for View
and Context
. Particularly handy
when using Views DSL.
Supported platforms: Android.
The dp
and dip
extensions functions for View
and Context
are exactly the same,
use the naming you prefer. They convert a value in Android's dp
to pixels for use in code.
The overload taking an Int
returns an Int
, the one taking a Float
returns a Float
.
val minTapTargetSize = dip(48)
val circleDiameter = dp(48f)
implementation("com.louiscad.splitties:splitties-dimensions:$splitties_version")