There is a recycler inside the scroll. I understand what is wrong, but in no other way can I pull the Recycler out of the scroll.
The problem is that my Recycler elements consist of two parts. With tapas, the second appears on the first one and with one more press it disappears.
Here is the adpater code:
@Override public void onClick(View v) { switch (v.getId()) { case R.id.content_head: if (content.isShown()) { content.measure(0, 0); LayTrenn.reSizeRV(content.getMeasuredHeight(), false); content.setVisibility(View.GONE); } else { content.measure(0, 0); content.setVisibility(View.VISIBLE); LayTrenn.reSizeRV(content.getMeasuredHeight(), true); } break; } } And this is where the RV is:
public static void reSizeRV(int i, boolean b) { LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) rv.getLayoutParams(); if (b) params.height = rv.getHeight() + i; else params.height = rv.getHeight() - i; rv.setLayoutParams(params); } In this case, I have content that is hidden and opened, dynamic, and the height is taken from the maximum height of all elements. If you use getHeight() , it does not increase the first time, but only the second, as I understand, the element has not yet been drawn.
How can I solve the problem of increasing the size of Recycler to the height of the hidden content? If you need details, write in the comments.