I have a DialogFragment that contains a RecyclerView (a list of cards).
DialogFragment
RecyclerView
Within this RecyclerView are one or more CardVi
CardVi
This comment helped me.Put the recyclerview in any other layout (Relative layout is preferable). Then change recyclerview's height/width as match parent to that layout and set the parent layout's height/width as wrap content.
Put the recyclerview in any other layout (Relative layout is preferable). Then change recyclerview's height/width as match parent to that layout and set the parent layout's height/width as wrap content.