Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android - Difference between Gridlayout and Staggered Gridlayout

I am working in android material design api & want to display some data in grid format. I tried both GridLayout and StaggeredGridlayout and both look same. For general information, i want to ask what is the difference between Gridlayout and StaggeredGridlayout?

Thank you.

like image 740
IBRAR AHMAD Avatar asked Dec 11 '15 05:12

IBRAR AHMAD


People also ask

What is the difference between GridLayout and GridView in Android?

Let us not get confused with GridView and GridLayout to be the same. GridView simply gives us a two-dimensional view to display the items on the screen, under ViewGroup. On the other hand, GridLayout is a layout manager that arranges the views in a grid.

What is a staggered layout?

androidx.recyclerview.widget.StaggeredGridLayoutManager. A LayoutManager that lays out children in a staggered grid formation. It supports horizontal & vertical layout as well as an ability to layout children in reverse. Staggered grids are likely to have gaps at the edges of the layout.

What is staggered view?

Staggered Grid View is a type of layout that is used to display images and posts. As you see in various social platforms such as Pinterest and many more. The main feature of Staggered Grid View is that it makes the layout beautiful and develop a great User Experience.

What is use of GridLayout manager?

GridLayoutManager is used for displaying the data items in grid format and we can easily define the orientation for the items.


1 Answers

Grid View : It is is a ViewGroup that displays items in a two-dimensional, scrollable grid. In this each Grid is of same size (Height and width). Grid View shows symmetric items in view.

Grid View

Staggered Grid View : It is basically an extension to Grid View but in this each Grid is of varying size(Height and width). Staggered Grid View shows asymmetric items in view.

staggered grid view

Tutorial to implement Staggered Grid View :

  1. Staggered Grid View
  2. Pinterest Masonry layout Staggered Grid View
like image 110
Vipul Asri Avatar answered Sep 30 '22 14:09

Vipul Asri