From 4e44ee36056b898f06cbaa85e7769fe44c18e45b Mon Sep 17 00:00:00 2001 From: CarlosEsco Date: Wed, 22 Apr 2020 12:47:47 -0400 Subject: [PATCH] wrap if's in {} for readability --- .../kanade/tachiyomi/ui/reader/ReaderActivity.kt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index ef3b98fd9c..477fd88cc9 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -21,7 +21,6 @@ import android.view.WindowManager import android.view.animation.Animation import android.view.animation.AnimationUtils import android.widget.SeekBar -import androidx.annotation.RequiresApi import androidx.appcompat.app.AppCompatDelegate import androidx.core.graphics.ColorUtils import com.davemorrissey.labs.subscaleview.SubsamplingScaleImageView @@ -247,10 +246,10 @@ class ReaderActivity : BaseRxActivity(), override fun onWindowFocusChanged(hasFocus: Boolean) { super.onWindowFocusChanged(hasFocus) if (hasFocus) { - if (menuStickyVisible) - setMenuVisibility(false) - else - setMenuVisibility(menuVisible, animate = false) + when (menuStickyVisible) { + true -> setMenuVisibility(false) + false -> setMenuVisibility(menuVisible, animate = false) + } } } @@ -376,10 +375,13 @@ class ReaderActivity : BaseRxActivity(), snackbar?.dismiss() systemUi?.show() reader_menu.visibility = View.VISIBLE - if (chapters_bottom_sheet.sheetBehavior?.state == BottomSheetBehavior.STATE_EXPANDED) + + if (chapters_bottom_sheet.sheetBehavior?.state == BottomSheetBehavior.STATE_EXPANDED) { chapters_bottom_sheet.sheetBehavior?.isHideable = false - if (chapters_bottom_sheet.sheetBehavior?.state != BottomSheetBehavior.STATE_EXPANDED && sheetManageNavColor) + } + if (chapters_bottom_sheet.sheetBehavior?.state != BottomSheetBehavior.STATE_EXPANDED && sheetManageNavColor) { window.navigationBarColor = Color.TRANSPARENT // getResourceColor(R.attr.colorPrimaryDark) + } if (animate) { if (!menuStickyVisible) { val toolbarAnimation = AnimationUtils.loadAnimation(this, R.anim.enter_from_top)