Resources.getActionBarHeight() fix return style

Uses the same return style as in the other functions
This commit is contained in:
Nikola Trubitsyn 2017-12-26 01:07:01 +03:00 committed by GitHub
parent b9b6b80120
commit 0ebbad7fff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,11 +6,10 @@ import android.util.TypedValue
fun Resources.getActionBarHeight(context: Context): Int {
val tv = TypedValue()
var height = 0
if (context.theme.resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
height = TypedValue.complexToDimensionPixelSize(tv.data, displayMetrics)
}
return height
return if (context.theme.resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
TypedValue.complexToDimensionPixelSize(tv.data, displayMetrics)
} else
0
}
fun Resources.getStatusBarHeight(): Int {