mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 17:11:54 +01:00
wrap more if's and else with braces
This commit is contained in:
parent
4e44ee3605
commit
ca633b1f95
@ -315,8 +315,10 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
|
||||
private fun initializeMenu() {
|
||||
// Set toolbar
|
||||
setSupportActionBar(toolbar)
|
||||
val primaryColor = ColorUtils.setAlphaComponent(getResourceColor(R.attr.colorSecondary),
|
||||
200)
|
||||
val primaryColor = ColorUtils.setAlphaComponent(
|
||||
getResourceColor(R.attr.colorSecondary),
|
||||
200
|
||||
)
|
||||
appbar.setBackgroundColor(primaryColor)
|
||||
window.statusBarColor = Color.TRANSPARENT
|
||||
supportActionBar?.setDisplayHomeAsUpEnabled(true)
|
||||
@ -340,7 +342,8 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
|
||||
chapters_bottom_sheet.sheetBehavior?.state = BottomSheetBehavior.STATE_HIDDEN
|
||||
reader_menu.doOnApplyWindowInsets { v, insets, _ ->
|
||||
sheetManageNavColor = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q && (insets
|
||||
.systemWindowInsetBottom != insets.tappableElementInsets.bottom)) {
|
||||
.systemWindowInsetBottom != insets.tappableElementInsets.bottom)
|
||||
) {
|
||||
window.navigationBarColor = Color.TRANSPARENT
|
||||
false
|
||||
}
|
||||
@ -407,9 +410,10 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
|
||||
appbar.startAnimation(toolbarAnimation)
|
||||
BottomSheetBehavior.from(chapters_bottom_sheet).isHideable = true
|
||||
BottomSheetBehavior.from(chapters_bottom_sheet).state = BottomSheetBehavior.STATE_HIDDEN
|
||||
} else
|
||||
} else {
|
||||
reader_menu.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
menuStickyVisible = false
|
||||
}
|
||||
|
||||
@ -530,12 +534,15 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
|
||||
page_text.text = "${page.number} / ${pages.size}"
|
||||
|
||||
if (newChapter) {
|
||||
if (config?.showNewChapter == false) systemUi?.show()
|
||||
if (config?.showNewChapter == false) {
|
||||
systemUi?.show()
|
||||
}
|
||||
} else if (chapters_bottom_sheet.shouldCollaspe && chapters_bottom_sheet.sheetBehavior?.state == BottomSheetBehavior.STATE_EXPANDED) {
|
||||
chapters_bottom_sheet.sheetBehavior?.state = BottomSheetBehavior.STATE_COLLAPSED
|
||||
}
|
||||
if (chapters_bottom_sheet.selectedChapterId != page.chapter.chapter.id)
|
||||
if (chapters_bottom_sheet.selectedChapterId != page.chapter.chapter.id) {
|
||||
chapters_bottom_sheet.refreshList()
|
||||
}
|
||||
chapters_bottom_sheet.shouldCollaspe = true
|
||||
|
||||
// Set seekbar progress
|
||||
@ -638,11 +645,13 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
|
||||
* depending on the [result].
|
||||
*/
|
||||
fun onSetAsCoverResult(result: ReaderPresenter.SetAsCoverResult) {
|
||||
toast(when (result) {
|
||||
toast(
|
||||
when (result) {
|
||||
Success -> R.string.cover_updated
|
||||
AddToLibraryFirst -> R.string.must_be_in_library_to_edit
|
||||
Error -> R.string.failed_to_update_cover
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
override fun onVisibilityChange(visible: Boolean) {
|
||||
|
Loading…
Reference in New Issue
Block a user