Skip to content

Instantly share code, notes, and snippets.

View saeedsh92's full-sized avatar
👻

S.Shahini saeedsh92

👻
  • Istanbul, Turkey
View GitHub Profile
@saeedsh92
saeedsh92 / MetricsUtil.kt
Created September 23, 2019 12:46 — forked from kevinhaitsma/MetricsUtil.kt
Convert dp to px and px to dp in Kotlin for Android
import android.content.Context
import android.content.res.Resources
import android.util.DisplayMetrics
/**
* Provides utilities for metrics.
*
* Original at:
* @see <a href="https://stackoverflow.com/a/9563438/8877070">stack overflow answer</a>
*