R
R
Rellor2020-04-19 01:46:09
Android
Rellor, 2020-04-19 01:46:09

How to solve the problem with a sharp change in the height of the RecyclerView?

I have a RecyclerView in my layout in LinearLayout, under which there is one more element. The problem is that when items are added/removed to the RecyclerView, its "physical" height changes instantly, even though the (standard) animation has just begun. If this looks tolerable with the addition, then when the element is removed due to a sharply changed height, the element that was under the RecyclerView rises also sharply, while the animation of the shift of the RecyclerView elements is still playing => the lower element of the RecyclerView leaves under the element located under the RecyclerView .
I know of only one solution to this problem - make the element under the RecyclerView part of it, then the animation will work on it. But, in my opinion, such a decision is not always appropriate.
Is there any other way to solve this problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question