hide downloads tab if already part of navbar

This commit is contained in:
Bnyro 2022-11-26 08:36:53 +01:00
parent 187f96bc49
commit e4beff22f5

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