Merge pull request #2064 from Bnyro/close-fullscreen

hide downloads tab if already part of navbar
This commit is contained in:
Bnyro 2022-11-26 08:37:23 +01:00 committed by GitHub
commit 8de48a0d86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,7 @@ import com.github.libretube.ui.adapters.PlaylistsAdapter
import com.github.libretube.ui.base.BaseFragment
import com.github.libretube.ui.dialogs.CreatePlaylistDialog
import com.github.libretube.ui.models.PlayerViewModel
import com.github.libretube.util.NavBarHelper
import com.github.libretube.util.PreferenceHelper
class LibraryFragment : BaseFragment() {
@ -68,6 +69,11 @@ class LibraryFragment : BaseFragment() {
findNavController().navigate(R.id.downloadsFragment)
}
val navBarItems = NavBarHelper.getNavBarItems(requireContext())
if (navBarItems.filter { it.isVisible }.any { it.itemId == R.id.downloadsFragment }) {
binding.downloads.visibility = View.GONE
}
fetchPlaylists()
binding.playlistRefresh.isEnabled = true