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.
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.
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.
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.
GridLayoutManager is used for displaying the data items in grid format and we can easily define the orientation for the items.
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.
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.
Tutorial to implement Staggered Grid View :
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With