Kalyan Dechiraju
Kalyan Dechiraju

Reputation: 1287

A recycler view vs the linear layout inside a scroll view?

Am trying to create a page with a scrollable list. Features would be a normal list to remove item by clicking on it. Number of items in that list are limited and added dynamically by user. You can consider a to do list as example. Now which would be a better approach to implement it? Recycler view with data bound to its adapter? Or the normal linear layout with items added as children at run time?

My current implementation is recycler view. But,I found it lagging and animations are not performing well. So a linear layout is auto animated by specifying it xml -- by setting animate layout changes to true.

FYI data is local and syncs in background.

Upvotes: 6

Views: 3294

Answers (1)

RussHWolf
RussHWolf

Reputation: 3654

Never use a LinearLayout for anything longer than a single screen. The whole point of ListView and RecyclerView is to efficiently reuse views instead of needing to hold things in memory when they're not visible. Maybe you can refine or reask your question so people can help you with whatever difficulty you're having with animations, rather than avoiding the issue.

Upvotes: 7

Related Questions