mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 16:30:31 +05:30
12 lines
278 B
Kotlin
12 lines
278 B
Kotlin
package com.github.libretube.extensions
|
|
|
|
import android.content.res.Resources
|
|
import androidx.core.util.TypedValueCompat
|
|
|
|
/**
|
|
* Convert dp to pixels
|
|
*/
|
|
fun Float.dpToPx(): Int {
|
|
return (TypedValueCompat.dpToPx(this, Resources.getSystem().displayMetrics) + 0.5f).toInt()
|
|
}
|