mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-27 16:26:29 +03:00
Fix fullscreen not applying on opening reader (fixes #4723)
This commit is contained in:
parent
c4b975b777
commit
3d99a8ebdb
2 changed files with 10 additions and 7 deletions
|
@ -397,10 +397,6 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()
|
|||
* [animate] the views.
|
||||
*/
|
||||
fun setMenuVisibility(visible: Boolean, animate: Boolean = true) {
|
||||
if (visible == menuVisible) {
|
||||
return
|
||||
}
|
||||
|
||||
menuVisible = visible
|
||||
if (visible) {
|
||||
if (preferences.fullscreen().get()) {
|
||||
|
|
|
@ -23,13 +23,20 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : TabbedBottomSh
|
|||
|
||||
val filterTabIndex = getTabViews().indexOf(colorFilterSettings)
|
||||
binding.tabs.addOnTabSelectedListener(object : SimpleTabSelectedListener() {
|
||||
// Remove dimmed backdrop so color filter changes can be previewed
|
||||
override fun onTabSelected(tab: TabLayout.Tab?) {
|
||||
val isFilterTab = tab?.position == filterTabIndex
|
||||
|
||||
// Remove dimmed backdrop so color filter changes can be previewed
|
||||
window?.setDimAmount(if (isFilterTab) 0f else sheetBackgroundDim)
|
||||
activity.setMenuVisibility(!isFilterTab)
|
||||
|
||||
// Hide toolbars
|
||||
if (activity.menuVisible != !isFilterTab) {
|
||||
activity.setMenuVisibility(!isFilterTab)
|
||||
}
|
||||
|
||||
// Partially collapse the sheet for better preview
|
||||
if (isFilterTab) {
|
||||
sheetBehavior?.state = BottomSheetBehavior.STATE_HALF_EXPANDED
|
||||
sheetBehavior.state = BottomSheetBehavior.STATE_HALF_EXPANDED
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue