Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GridLayout vs. RecyclerView with GridLayoutManager

I am just starting with Android development and there are at least two ways to build a grid: using GridLayout or using a RecyclerView with a GridLayoutManager.

  • Is there any case/reason still to use a GridLayout?
  • Is it maybe faster at rendering/loading, as it maybe is simpler?

I want to build a grid of cards, likely around max. 50 cards.

like image 933
stefan.at.wpf Avatar asked Mar 20 '26 07:03

stefan.at.wpf


1 Answers

It's absolutely fine to just use GridLayout if you don't need the functionality of the RecyclerView. Nevertheless, you should get involved with the RecyclerView asap(it's a very strong tool).

Up to a certain size, the solo GridLayout will render/load faster but at some point, this effect will reverse:

Recycle (view): A view previously used to display data for a specific adapter position may be placed in a cache for later reuse to display the same type of data again later. This can drastically improve performance by skipping initial layout inflation or construction.

like image 164
Nils Ramon Avatar answered Mar 21 '26 19:03

Nils Ramon