Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import android.view.View
fun View.dp_f(dp: Float): Float {
return TypedValue.applyDimension(
TypedValue.COMPLEX_UNIT_DIP, dp, context.resources.displayMetrics)
fun View.dp_i(dp: Float): Int {
return dp_f(dp).toInt()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.