Skip to content

Commit 49c12a3

Browse files
committed
Fix wrongly calculated channel groups span count
1 parent fc06159 commit 49c12a3

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

app/src/main/java/org/schabi/newpipe/local/subscription/item/FeedGroupCarouselItem.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import com.xwray.groupie.viewbinding.GroupieViewHolder
1010
import org.schabi.newpipe.R
1111
import org.schabi.newpipe.databinding.FeedItemCarouselBinding
1212
import org.schabi.newpipe.util.DeviceUtils
13-
import java.lang.Integer.max
13+
import org.schabi.newpipe.util.ThemeHelper.getGridSpanCount
1414

1515
class FeedGroupCarouselItem(
1616
private val carouselAdapter: GroupAdapter<GroupieViewHolder<FeedItemCarouselBinding>>,
@@ -71,10 +71,7 @@ class FeedGroupCarouselItem(
7171
carouselLayoutManager = if (listViewMode) {
7272
LinearLayoutManager(context)
7373
} else {
74-
GridLayoutManager(
75-
context,
76-
max(1, viewBinding.recyclerView.width / DeviceUtils.dpToPx(112, context))
77-
)
74+
GridLayoutManager(context, getGridSpanCount(context, DeviceUtils.dpToPx(112, context)))
7875
}
7976

8077
viewBinding.recyclerView.apply {

0 commit comments

Comments
 (0)