mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2024-11-25 04:22:30 +01:00
Fully working card and list view
This commit is contained in:
parent
c607089cbb
commit
f7e10eb094
@ -276,7 +276,7 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
|
||||
return@setOnItemLongClickListener true
|
||||
}
|
||||
|
||||
feedGroupsCarousel = FeedGroupCarouselItem(requireContext(), carouselAdapter, RecyclerView.HORIZONTAL)
|
||||
feedGroupsCarousel = FeedGroupCarouselItem(requireContext(), carouselAdapter, RecyclerView.HORIZONTAL, true)
|
||||
|
||||
feedGroupsSortMenuItem = HeaderWithMenuItem(
|
||||
getString(R.string.feed_groups_header_title),
|
||||
@ -326,7 +326,7 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
|
||||
listenerFeedVerticalGroups.held(item)
|
||||
return@setOnItemLongClickListener true
|
||||
}
|
||||
feedGroupsCarousel = FeedGroupCarouselItem(requireContext(), carouselAdapter, RecyclerView.VERTICAL)
|
||||
feedGroupsCarousel = FeedGroupCarouselItem(requireContext(), carouselAdapter, RecyclerView.VERTICAL, false)
|
||||
|
||||
feedGroupsSortMenuItem = HeaderWithMenuItem(
|
||||
getString(R.string.feed_groups_header_title),
|
||||
|
@ -15,7 +15,8 @@ import org.schabi.newpipe.local.subscription.decoration.FeedGroupCarouselDecorat
|
||||
class FeedGroupCarouselItem(
|
||||
context: Context,
|
||||
private val carouselAdapter: GroupAdapter<GroupieViewHolder<FeedItemCarouselBinding>>,
|
||||
private var listView: Int
|
||||
private var listView: Int,
|
||||
private var isGridLayout: Boolean
|
||||
) : BindableItem<FeedItemCarouselBinding>() {
|
||||
private val feedGroupCarouselDecoration = FeedGroupCarouselDecoration(context)
|
||||
|
||||
@ -44,7 +45,8 @@ class FeedGroupCarouselItem(
|
||||
adapter = carouselAdapter
|
||||
addItemDecoration(feedGroupCarouselDecoration)
|
||||
}
|
||||
viewHolder.recyclerView.setLayoutManager(GridLayoutManager(view.context, 3))
|
||||
if (isGridLayout)
|
||||
viewHolder.recyclerView.setLayoutManager(GridLayoutManager(view.context, 3))
|
||||
return viewHolder
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@
|
||||
|
||||
<!-- Feed Groups dimensions-->
|
||||
<dimen name="feed_group_carousel_start_end_margin">12dp</dimen>
|
||||
<dimen name="feed_group_carousel_top_bottom_margin">12dp</dimen>
|
||||
<dimen name="feed_group_carousel_top_bottom_margin">6dp</dimen>
|
||||
<dimen name="feed_group_carousel_between_items_margin">4dp</dimen>
|
||||
|
||||
<dimen name="search_suggestion_text_size">16sp</dimen>
|
||||
|
Loading…
Reference in New Issue
Block a user