blob: c7ff9f2f5a6debf3bf2bcf0cd6d72c2d3cf760de (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
package ca.allanwang.kau.utils
import android.content.res.Resources
/**
* Created by Allan Wang on 2017-05-28.
*/
val dpToPx = fun Int.(): Int = (this * Resources.getSystem().displayMetrics.density).toInt()
val pxToDp = fun Int.(): Int = (this / Resources.getSystem().displayMetrics.density).toInt()
|