diff --git a/app/src/main/java/com/github/libretube/constants/PreferenceKeys.kt b/app/src/main/java/com/github/libretube/constants/PreferenceKeys.kt index 9b624ebe8..56fce5f7c 100644 --- a/app/src/main/java/com/github/libretube/constants/PreferenceKeys.kt +++ b/app/src/main/java/com/github/libretube/constants/PreferenceKeys.kt @@ -139,4 +139,5 @@ object PreferenceKeys { const val LAST_WATCHED_FEED_TIME = "last_watched_feed_time" const val AUTH_PREF_FILE = "auth" const val IMAGE_PROXY_URL = "image_proxy_url" + const val SELECTED_CHANNEL_GROUP = "selected_channel_group" } diff --git a/app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt index 08b60b002..9cbc7e0ae 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/SubscriptionsFragment.kt @@ -58,7 +58,10 @@ class SubscriptionsFragment : DynamicLayoutManagerFragment() { private val viewModel: SubscriptionsViewModel by activityViewModels() private val playerModel: PlayerViewModel by activityViewModels() private val channelGroupsModel: EditChannelGroupsModel by activityViewModels() - private var selectedFilterGroup = 0 + private var selectedFilterGroup + set(value) = PreferenceHelper.putInt(PreferenceKeys.SELECTED_CHANNEL_GROUP, value) + get() = PreferenceHelper.getInt(PreferenceKeys.SELECTED_CHANNEL_GROUP, 0) + private var isCurrentTabSubChannels = false private var isAppBarFullyExpanded = true