Posts

Showing posts with the label StaggeredGridLayoutManager

using LinearLayoutManager, GridLayoutManager and StaggeredGridLayoutManager with RecyclerView

Image
In the Previous Post , We have created a Recycler View with list of items like listview, Now we will see how simple to make a gridLayout and |StaggerdGrid with Recycler View by simply modifying the code in the method  to show the items in different ways in the UI .   mRecyclerView.setLayoutManager(glm); LinearLayoutManager ================= mRecyclerView = ( AutofitRecyclerView ) findViewById ( R . id . my_recycler_view ); // use this setting to improve performance if you know that changes // in content do not change the layout size of the RecyclerView mRecyclerView . setHasFixedSize ( true ); LinearLayoutManager llm = new LinearLayoutManager ( this ); // use a linear layout manager to show items like listview mRecyclerView . setLayoutManager (l lm ); // create an Object for Adapter mAdapter = new CardViewDataAdapter ( myDataset ); // set the adapter object to the Recyclerview mRecyclerView . setAdapter ( mAdapter ); ScreenShot: GridLayoutManager  ================ mRecycler