mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-11-03 23:58:55 +01:00 
			
		
		
		
	Fix fullscreen not applying on opening reader (fixes #4723)
This commit is contained in:
		@@ -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
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        })
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user