I have this structure
RecyclerView
- ConstraintLayout
- - CardView
- - - ConstraintLayout
- - - - ImageView
- - - - TextView
- - - - TextView
Code:
vm = ViewModelProvider(this)[CatalogViewModel::class.java]
vm.getList().observe(this, Observer {
dataView = findViewById(R.id.dataList)
adapter = CatalogRecycleViewAdapter(this, it.data.data)
dataView.layoutManager = GridLayoutManager(this, 2, GridLayoutManager.VERTICAL, false);
dataView.adapter = adapter;
})
And if I have 2 or more items width different height, there's an empty space in a column.
How to remove it and make something like in picture?