Refrain from calculating hardcoded dimensions

This commit is contained in:
Mygod
2017-12-07 00:05:18 -08:00
parent d5c1455a00
commit efae2f02d0
5 changed files with 5 additions and 8 deletions
@@ -53,8 +53,6 @@ fun thread(start: Boolean = true, isDaemon: Boolean = false, contextClassLoader:
val URLConnection.responseLength: Long
get() = if (Build.VERSION.SDK_INT >= 24) contentLengthLong else contentLength.toLong()
fun Float.dp(): Float = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, this, app.resources.displayMetrics)
/**
* Based on: https://stackoverflow.com/a/15656428/2245107
*/