I have a LinearLayout containing a RecyclerView. The RecyclerView's width is set to match_parent so it has the same width as the LinearLayout.
I want to set the width of the data items in the RecyclerView based on the width of the RecyclerView. For example, let's say the RecyclerView has width W and contains 3 data items, and I want to set the width of the first data item to 10dp and the width of the second and third data items to (W-10dp)/2.
How can I achieve this?