diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadMenu.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadMenu.kt index da1ce7511..7ed2418b2 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadMenu.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/ReadMenu.kt @@ -181,11 +181,10 @@ class ReadMenu : FrameLayout { override fun onAnimationEnd(animation: Animation) { vw_menu_bg.onClick { runMenuOut() } - if (context.getPrefBoolean("hideNavigationBar")) { - vwNavigationBar.layoutParams.height = context.getNavigationBarHeight() - } else { - vwNavigationBar.layoutParams.height = 0 - } + val lp = vwNavigationBar.layoutParams + lp.height = if (context.getPrefBoolean("hideNavigationBar")) + context.getNavigationBarHeight() else 0 + vwNavigationBar.layoutParams = lp } override fun onAnimationRepeat(animation: Animation) {