[Android] Hide the favorite lane on Tv when there is no favorite
Nicolas Pomepuy
git at videolan.org
Tue Feb 13 10:19:45 UTC 2024
vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Thu Feb 8 07:44:36 2024 +0100| [84f89665e533b9f23f06609174a5a90636da62c1] | committer: Duncan McNamara
Hide the favorite lane on Tv when there is no favorite
> https://code.videolan.org/videolan/vlc-android/commit/84f89665e533b9f23f06609174a5a90636da62c1
---
.../src/main/java/org/videolan/television/ui/MainTvFragment.kt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/application/television/src/main/java/org/videolan/television/ui/MainTvFragment.kt b/application/television/src/main/java/org/videolan/television/ui/MainTvFragment.kt
index 44bf516467..02ec220753 100644
--- a/application/television/src/main/java/org/videolan/television/ui/MainTvFragment.kt
+++ b/application/television/src/main/java/org/videolan/television/ui/MainTvFragment.kt
@@ -117,6 +117,7 @@ class MainTvFragment : BrowseSupportFragment(), OnItemViewSelectedListener, OnIt
private var displayNowPlaying = false
private var displayRecentlyPlayed = false
private var displayRecentlyAdded = false
+ private var displayFavorites = false
private var selectedItem: Any? = null
private var lines: Int = 7
@@ -248,6 +249,7 @@ class MainTvFragment : BrowseSupportFragment(), OnItemViewSelectedListener, OnIt
addAndCheckLoadedLines(HEADER_NETWORK)
}
model.favoritesList.observe(requireActivity()) {
+ displayFavorites = it.isNotEmpty()
favoritesAdapter.setItems(it, diffCallback)
}
model.audioCategories.observe(requireActivity()) {
@@ -313,6 +315,7 @@ class MainTvFragment : BrowseSupportFragment(), OnItemViewSelectedListener, OnIt
!displayHistory && it == historyRow -> false
!displayPlaylist && it == playlistRow -> false
!displayNowPlaying && it == nowPlayingRow -> false
+ !displayFavorites && it == favoritesRow -> false
else -> true
}
More information about the Android
mailing list