-1

I don't have any coding question or something, I had this application that populates (from a webservice) a gridlayoutmanager recyclerview of 2 rows and now the client wants it to be a List. I just want to ask which is better for the performance setting the number of rows of the gridlayoutmanager to 1, or switching to LinearLayoutmanager. regards,

eshteghel company
  • 471
  • 1
  • 7
  • 22

2 Answers2

1

LinearLayoutManager :

  • LinearLayoutManager is similar to old ListView concept.
  • it's fully occupy the row they not bother but each item Text size or image width height etc.

GridLayoutManager :

  • Using GirdLayoutManager you can split each row more than one item.

  • You can add 3 in row or 4 row or etc but each row each item width and height are same like below,

enter image description here

  • Grid View shows symmetric items in view.

    Using GridLayoutManager you can also done alternative row count like odd row's are 2 items and even row's 4 items by using setSpanSizeLookup.

Finally myself main difference using GridLayoutManager you done better and innovative UI in Android.

enter image description here

Magesh Pandian
  • 8,789
  • 12
  • 45
  • 60
0

it's more elegant using LinearLayoutManager if you have one row, but for performance it's same.

Palak
  • 2,165
  • 2
  • 21
  • 31
an_droid_dev
  • 1,136
  • 14
  • 18