-
-
Notifications
You must be signed in to change notification settings - Fork 522
fix(Home): hide Trending category #7675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -141,7 +141,7 @@ class HomeFragment : Fragment(R.layout.fragment_home) { | |
| binding.trendingCategory.setOnClickListener { | ||
| val currentTrendingCategoryPref = PreferenceHelper.getString( | ||
| PreferenceKeys.TRENDING_CATEGORY, | ||
| TrendingCategory.TRENDING.name | ||
| TrendingCategory.LIVE.name | ||
| ).let { TrendingCategory.valueOf(it) } | ||
|
|
||
| val categories = trendingCategories.map { category -> | ||
|
|
@@ -201,12 +201,13 @@ class HomeFragment : Fragment(R.layout.fragment_home) { | |
| ) | ||
| } | ||
|
|
||
| private fun showTrending(streamItems: List<StreamItem>?) { | ||
| if (streamItems == null) return | ||
| private fun showTrending(trends: Pair<TrendingCategory, List<StreamItem>>?) { | ||
| if (trends == null) return | ||
| val (category, streamItems) = trends | ||
|
|
||
| // cache the loaded trends in the [TrendsViewModel] so that the trends don't need to be | ||
| // reloaded there | ||
| trendsViewModel.setStreamsForCategory(TrendingCategory.TRENDING, streamItems) | ||
| trendsViewModel.setStreamsForCategory(category, streamItems) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related: I noticed we currently only set the first 10 trending streams to the view model (because Ref: #7695 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for chiming in, I accidentally set the category to podcast, and my podcast is not showing (related: #7602). Since the returned Maybe kept There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, sounds like a good idea. |
||
|
|
||
| makeVisible(binding.trendingRV, binding.trendingTV) | ||
| trendingAdapter.submitList(streamItems) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!