wrap if's in {} for readability

This commit is contained in:
CarlosEsco 2020-04-22 12:47:47 -04:00
parent 3240260a91
commit 4e44ee3605

View file

@ -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<ReaderPresenter>(),
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<ReaderPresenter>(),
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)