Solution 1 :
Yes, it is possible to have items in RecyclerView to have different height and width.
You should give wrap content for both list item and RecyclerView
Problem :
I am creating a recycler view and I have 2 types of itemviews in it. Each item view would have different widths(55dp for one and MatchParent for the another). If I create a recycler view with first 4 rows having width 55dp and the next 2 rows with width MatchParent, do you think my entire recycler view would have same width throughout? Or will it be 55 width for first 4 rows and MatchParent for the last 2 rows?
Please note I have set the width and height as wrapContent for the recycler view and using staggeredGridLayoutManager with single column and vertical scroll.
I only want a single column vertical scrolling recycler view with different widths at each row.
If you can imagine, it should look like an L – shaped recycler view.
Comments
Comment posted by Iman Nia
In have upvoted cause it is a good question (need editing though).
Comment posted by Reshma
I have actually made wrapContent for recycler view but for the itemviews, I strictly want them to be occupying 55dp for first 4 rows and need the last 2 rows to occupy the entire screen width.
Comment posted by Akash Starvin Dsouza
List items are same right for both the items? Only the text content is less in second one?
Comment posted by Reshma
Not really. The list items are totally different and also the content in them is.
Comment posted by Akash Starvin Dsouza
RecyclerView can bind ONLY one type of item. If you need different item with different contents within in then you should create two different RecyclerView and list items.