Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
fun Int.dp(): Int =
toFloat().dp().toInt()
fun Float.dp(): Float = applyDimension(
COMPLEX_UNIT_DIP,
this,
Resources.getSystem().displayMetrics
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment