mirror of
https://github.com/lizongying/my-tv.git
synced 2026-11-21 02:46:30 +08:00
change style
This commit is contained in:
@@ -77,5 +77,15 @@ object Utils {
|
||||
).toInt()
|
||||
}
|
||||
|
||||
fun pxToDp(px: Float): Int {
|
||||
val scale = Resources.getSystem().displayMetrics.density
|
||||
return (px / scale).toInt()
|
||||
}
|
||||
|
||||
fun pxToDp(px: Int): Int {
|
||||
val scale = Resources.getSystem().displayMetrics.density
|
||||
return (px / scale).toInt()
|
||||
}
|
||||
|
||||
fun isTmallDevice() = Build.MANUFACTURER.equals("Tmall", ignoreCase = true)
|
||||
}
|
||||
Reference in New Issue
Block a user