0

I would like to make a layout like this:

enter image description here

I tried with this code, but the second and third item's height are same as the first item.

val lm = GridLayoutManager(requireContext(), 2, RecyclerView.HORIZONTAL, false)
lm.spanSizeLookup = object : GridLayoutManager.SpanSizeLookup() {
    override fun getSpanSize(position: Int): Int {
        return if (position == 0) 2
        else 1
    }
}
Huy Nguyen
  • 1,032
  • 14
  • 38

0 Answers0