mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-01-08 10:30:30 +05:30
11 lines
210 B
Kotlin
11 lines
210 B
Kotlin
|
package com.github.libretube.extensions
|
||
|
|
||
|
import android.content.res.Resources
|
||
|
|
||
|
/**
|
||
|
* Convert DP to pixels
|
||
|
*/
|
||
|
fun Int.toPixel(): Float {
|
||
|
return this * Resources.getSystem().displayMetrics.density + 0.5f
|
||
|
}
|