mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-08 23:07:26 -04:00
Writing getToolbarHeight clearly
This commit is contained in:
parent
673604636d
commit
fc6d72bb8a
@ -25,10 +25,9 @@ import androidx.appcompat.R.attr
|
||||
|
||||
object DimenUtils {
|
||||
@JvmStatic fun DisplayMetrics.getToolbarHeight(context: Context): Int {
|
||||
return TypedValue().let {
|
||||
context.theme.resolveAttribute(attr.actionBarSize, it, true)
|
||||
context.resources.getDimensionPixelSize(it.resourceId)
|
||||
}
|
||||
return context.resources.getDimensionPixelSize(TypedValue().apply {
|
||||
context.theme.resolveAttribute(attr.actionBarSize, this, true)
|
||||
}.resourceId)
|
||||
}
|
||||
|
||||
@JvmStatic fun DisplayMetrics.getWindowHeight(activity: Activity): Int =
|
||||
|
Loading…
x
Reference in New Issue
Block a user