From 0ebbad7fff75c48afa66570dd5ae6fb08e914115 Mon Sep 17 00:00:00 2001 From: Nikola Trubitsyn Date: Tue, 26 Dec 2017 01:07:01 +0300 Subject: [PATCH] Resources.getActionBarHeight() fix return style Uses the same return style as in the other functions --- .../simplemobiletools/gallery/extensions/Resources.kt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Resources.kt b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Resources.kt index a2a2ef7af..73a56c5ba 100644 --- a/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Resources.kt +++ b/app/src/main/kotlin/com/simplemobiletools/gallery/extensions/Resources.kt @@ -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 {