I'm facing a tricky situation here and I don't know how to solve this problem.
In my project I have a custom BottomSheetDialogFragment
and in the layout a FrameLayout
to add or replace Fragment
s.
Now I have a Fragment
and inside I have a RecyclerView
with the height:="wrap_content"
because I want the BottomSheetDialogFragment
only use the necessary space. Everything looks great, the problem appear when I put another view inside of the same layout and set the RecyclerView
bellow or above of that view.
The RecyclerView
ignores the size of the other view (or views) and always grows to the max screen size, and then it's no possible to see a few elements and even scroll.
I saw a solution, some developers are suggesting to add paddingBottom
equals to the height of the view. But in my case doesn't works because I want to have a dynamic solution.
Above I'll share a few images of the problem and GitHub Repository with a sample.