diff --git a/app/src/main/java/com/github/libretube/ui/fragments/HomeFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/HomeFragment.kt index 9983c2262..95f6f621c 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/HomeFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/HomeFragment.kt @@ -4,6 +4,8 @@ import android.os.Bundle import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import androidx.core.view.isGone +import androidx.core.view.isVisible import androidx.fragment.app.Fragment import androidx.fragment.app.activityViewModels import androidx.lifecycle.Lifecycle @@ -91,6 +93,13 @@ class HomeFragment : Fragment() { async { if (visibleItems.contains(FEATURED)) loadFeed() }, async { if (visibleItems.contains(PLAYLISTS)) loadPlaylists() }, ) + + val binding = _binding ?: return@repeatOnLifecycle + // No category is shown because they are either empty or disabled + if (binding.progress.isVisible) { + binding.progress.isGone = true + binding.nothingHere.isVisible = true + } } } } @@ -190,11 +199,11 @@ class HomeFragment : Fragment() { private fun makeVisible(vararg views: View) { views.forEach { - it.visibility = View.VISIBLE + it.isVisible = true } val binding = _binding ?: return - binding.progress.visibility = View.GONE - binding.scroll.visibility = View.VISIBLE + binding.progress.isGone = true + binding.scroll.isVisible = true binding.refresh.isRefreshing = false } diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index ad60d6cc0..5f64b5dc8 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -89,4 +89,28 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_library.xml b/app/src/main/res/layout/fragment_library.xml index 3264cfdbd..50565897b 100644 --- a/app/src/main/res/layout/fragment_library.xml +++ b/app/src/main/res/layout/fragment_library.xml @@ -87,31 +87,28 @@ android:textSize="18sp" android:textStyle="bold" /> - - + - - + @@ -156,8 +153,8 @@ android:id="@+id/channel_groups" android:layout_width="wrap_content" android:layout_height="wrap_content" - app:checkedChip="@id/chip_all" android:layout_marginStart="5dp" + app:checkedChip="@id/chip_all" app:selectionRequired="true" app:singleLine="true" app:singleSelection="true">