mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 13:31:51 +01:00
Fix fullscreen not applying on opening reader (fixes #4723)
This commit is contained in:
parent
c4b975b777
commit
3d99a8ebdb
@ -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 New Issue
Block a user