Skip to content
Snippets Groups Projects
Commit 37d38232 authored by Nicolas Pomepuy's avatar Nicolas Pomepuy
Browse files

Make the video grid at least 2 columns wide

Fixes #2303
parent 52ee2f2e
No related branches found
No related tags found
1 merge request!1330Make the video grid at least 2 columns wide
Pipeline #207815 passed with stage
in 21 minutes and 52 seconds
......@@ -64,7 +64,7 @@ class AutoFitRecyclerView : RecyclerView {
super.onMeasure(widthSpec, heightSpec)
if (spanCount == -1 && columnWidth > 0) {
val ratio = measuredWidth / columnWidth
val spanCount = Math.max(1, ratio)
val spanCount = 2.coerceAtLeast(ratio)
gridLayoutManager!!.spanCount = spanCount
} else
gridLayoutManager!!.spanCount = spanCount
......@@ -79,7 +79,7 @@ class AutoFitRecyclerView : RecyclerView {
val remainingSpace = displayWidth % columnWidth
val ratio = displayWidth / columnWidth
val spanCount = Math.max(1, ratio)
val spanCount = 2.coerceAtLeast(ratio)
return columnWidth + remainingSpace / spanCount
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment