fix tab bar showing when starting a download from details

only happens when going to the details page from recents
This commit is contained in:
Jays2Kings 2021-10-13 17:54:45 -04:00
parent ffd220a480
commit 7dfd3d0fe2

View file

@ -239,6 +239,11 @@ class RecentsController(bundle: Bundle? = null) :
(progress * 2f).coerceIn(0f, 1f) (progress * 2f).coerceIn(0f, 1f)
) )
) )
val oldShow = showingDownloads
showingDownloads = progress > 0.92f
if (router.backstack.lastOrNull()?.controller != this@RecentsController) {
return
}
binding.downloadBottomSheet.root.backgroundTintList = binding.downloadBottomSheet.root.backgroundTintList =
binding.downloadBottomSheet.sheetLayout.backgroundTintList binding.downloadBottomSheet.sheetLayout.backgroundTintList
activityBinding?.appBar?.y = max( activityBinding?.appBar?.y = max(
@ -253,8 +258,6 @@ class RecentsController(bundle: Bundle? = null) :
tabs.isVisible = true tabs.isVisible = true
} }
} }
val oldShow = showingDownloads
showingDownloads = progress > 0.92f
if (oldShow != showingDownloads) { if (oldShow != showingDownloads) {
updateTitleAndMenu() updateTitleAndMenu()
activity?.invalidateOptionsMenu() activity?.invalidateOptionsMenu()
@ -272,8 +275,10 @@ class RecentsController(bundle: Bundle? = null) :
activity?.invalidateOptionsMenu() activity?.invalidateOptionsMenu()
} }
activityBinding?.tabsFrameLayout?.isVisible = if (router.backstack.lastOrNull()?.controller == this@RecentsController) {
state != BottomSheetBehavior.STATE_EXPANDED activityBinding?.tabsFrameLayout?.isVisible =
state != BottomSheetBehavior.STATE_EXPANDED
}
if (state == BottomSheetBehavior.STATE_COLLAPSED) { if (state == BottomSheetBehavior.STATE_COLLAPSED) {
if (hasQueue()) { if (hasQueue()) {
binding.downloadBottomSheet.dlBottomSheet.sheetBehavior?.isHideable = binding.downloadBottomSheet.dlBottomSheet.sheetBehavior?.isHideable =