Which layout for RecyclerView?
Linear Layout Manager
It is used for displaying the data items in a horizontal or vertical scrolling List. If we need a list(vertical or horizontal) then we need to use LinearLayoutManager with require orientation. In Simple words we can say that we use the LinearLayoutManager for displaying RecyclerView as a ListView.
How to change RecyclerView height dynamically in android?
You should use LayoutParams of parent's view in setLayoutParams(params). Change LayoutParams in the code. I just changed Linearlayout to Relative then it automatically resided.