Search code examples
androidandroid-layoutandroid-gridlayoutstaggeredgridlayout

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.


Solution

  • 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