Is it possible to change the size of the RecyclerView?

I want to change the size of the RecyclerView when clicked. Such as his settings of width & height :
wrap content
 parent
And clicking I want to change to fixed settings.
June 27th 19 at 15:36
1 answer
June 27th 19 at 15:38
Wrap RecyclerView in RelativeLayout and use LayoutParams to it.

<relativelayout android:layout_width="parent" android:layout_height="wrap content">
 <android.support.v7.widget.recyclerview android:id="@+id/images" android:layout_width="wrap content" android:layout_height="360dp">
</android.support.v7.widget.recyclerview>
 </relativelayout>


RelativeLayout.LayoutParams lp =
 new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.PARENT, 500);
 recyclerView.setLayoutParams(lp);
when clicking, it works fine, and if you again click to show the full list, it duplicates each Item RecyclerView line - Princess_Treutel commented on June 27th 19 at 15:41

Find more questions by tags Android