20 lines
562 B
Kotlin
20 lines
562 B
Kotlin
package com.lagradost.cloudstream3
|
|
|
|
import android.app.Activity
|
|
import android.view.View
|
|
|
|
object UIHelper {
|
|
fun Activity.getStatusBarHeight(): Int {
|
|
var result = 0
|
|
val resourceId = resources.getIdentifier("status_bar_height", "dimen", "android")
|
|
if (resourceId > 0) {
|
|
result = resources.getDimensionPixelSize(resourceId)
|
|
}
|
|
return result
|
|
|
|
}
|
|
|
|
fun Activity.fixPaddingStatusbar(v: View) {
|
|
v.setPadding(v.paddingLeft, v.paddingTop + getStatusBarHeight(), v.paddingRight, v.paddingBottom)
|
|
}
|
|
} |