Hello. There is a RecyclerView , filled with CardView . Inside each CardView is a ListView with items. With vertical scrolling of this design lags are noticeable. The RecyclerView and ListView used ViewHolder 's. The question is: is it worth trying to replace the ListView inside CardView with RecyclerView too or will it not help anyway? And are there any other ways to speed up their loading? Thank you in advance for your response.

UPD: Replaced ListView with RecyclerView , it became a little better, but there are still lags.

  • Most likely the problem is in the conflict of nested scrolling elements. Lags are not due to the large amount of data, but because of the "misunderstanding" which element should scroll. - pavlofff
  • @pavlofff are there any ways to improve the situation? - ahgpoug

1 answer 1

The point here is not at all in CardView , the response time of your list is more than 16 ms.

You can try to bring to another stream, or load the data in portions (if there are a lot of them), it is also possible that the phone simply does not have time to draw the items, and the problem of weak iron.

According to the information that you reported, you can’t tell more.

  • The adapter loads the widget data in "portions", for lists this is not a problem, moreover, that is why the adapter is used. - pavlofff