From 452a3b676887197288b50b2532f527ef48014424 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 29 Jun 2019 16:57:22 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/ui/widget/TitleBar.kt | 3 ++- app/src/main/java/io/legado/app/utils/ContextExtensions.kt | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/widget/TitleBar.kt b/app/src/main/java/io/legado/app/ui/widget/TitleBar.kt index 0bd665736..ea0776e04 100644 --- a/app/src/main/java/io/legado/app/ui/widget/TitleBar.kt +++ b/app/src/main/java/io/legado/app/ui/widget/TitleBar.kt @@ -18,6 +18,7 @@ import io.legado.app.R import io.legado.app.lib.theme.DrawableUtils import io.legado.app.lib.theme.ThemeStore import io.legado.app.lib.theme.getPrimaryTextColor +import io.legado.app.utils.getNavigationBarHeight import io.legado.app.utils.getStatusBarHeight import org.jetbrains.anko.bottomPadding import org.jetbrains.anko.topPadding @@ -99,7 +100,7 @@ class TitleBar(context: Context, attrs: AttributeSet?) : AppBarLayout(context, a } if (a.getBoolean(R.styleable.TitleBar_fitNavigationBar, false)) { - bottomPadding = context.getStatusBarHeight() + bottomPadding = context.getNavigationBarHeight() } a.recycle() diff --git a/app/src/main/java/io/legado/app/utils/ContextExtensions.kt b/app/src/main/java/io/legado/app/utils/ContextExtensions.kt index 94eb8a122..50f9475a1 100644 --- a/app/src/main/java/io/legado/app/utils/ContextExtensions.kt +++ b/app/src/main/java/io/legado/app/utils/ContextExtensions.kt @@ -57,3 +57,8 @@ fun Context.getStatusBarHeight(): Int { val resourceId = resources.getIdentifier("status_bar_height", "dimen", "android") return resources.getDimensionPixelSize(resourceId) } + +fun Context.getNavigationBarHeight(): Int { + val resourceId = resources.getIdentifier("navigation_bar_height", "dimen", "android") + return resources.getDimensionPixelSize(resourceId) +}