aboutsummaryrefslogtreecommitdiff
path: root/library/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt
diff options
context:
space:
mode:
Diffstat (limited to 'library/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt')
-rw-r--r--library/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt b/library/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt
index c7ff9f2..79f80f3 100644
--- a/library/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt
+++ b/library/src/main/kotlin/ca/allanwang/kau/utils/Utils.kt
@@ -6,6 +6,6 @@ import android.content.res.Resources
* Created by Allan Wang on 2017-05-28.
*/
-val dpToPx = fun Int.(): Int = (this * Resources.getSystem().displayMetrics.density).toInt()
+fun Int.dpToPx(): Int = (this * Resources.getSystem().displayMetrics.density).toInt()
-val pxToDp = fun Int.(): Int = (this / Resources.getSystem().displayMetrics.density).toInt()
+fun Int.pxToDp(px: Int) = (px / android.content.res.Resources.getSystem().displayMetrics.density).toInt() \ No newline at end of file