material-components/material-components-android-codelabs

MD103 - Step 6 Should Use StaggeredGridLayoutManger

FZhg opened this issue · 0 comments

FZhg commented

Describe the bug
The GridLayoutManager is not the best for the job. We can use the StaggeredGridLayoutManager and in the adapter's onCreateViewHolderMethod we can change the StaggeredGridLayoutManager.LayoutParams.isFullSpan to true.

To Reproduce

  1. the results are the same.

Codelab details (please complete the following information about the codelab):

Additional context
https://stackoverflow.com/questions/33696096/setting-span-size-of-single-row-in-staggeredgridlayoutmanager/33707897#