mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-30 00:17:58 +01:00
Merge pull request #525 from trubitsyn/patch-2
Resources.getActionBarHeight() fix return style
This commit is contained in:
commit
49922159e0
1 changed files with 4 additions and 5 deletions
|
@ -6,11 +6,10 @@ import android.util.TypedValue
|
||||||
|
|
||||||
fun Resources.getActionBarHeight(context: Context): Int {
|
fun Resources.getActionBarHeight(context: Context): Int {
|
||||||
val tv = TypedValue()
|
val tv = TypedValue()
|
||||||
var height = 0
|
return if (context.theme.resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
|
||||||
if (context.theme.resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
|
TypedValue.complexToDimensionPixelSize(tv.data, displayMetrics)
|
||||||
height = TypedValue.complexToDimensionPixelSize(tv.data, displayMetrics)
|
} else
|
||||||
}
|
0
|
||||||
return height
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Resources.getStatusBarHeight(): Int {
|
fun Resources.getStatusBarHeight(): Int {
|
||||||
|
|
Loading…
Reference in a new issue