material-components / material-components-android-codelabs

Codelabs for Material Components for Android (MDC-Android)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MD103 - Step 6 Should Use StaggeredGridLayoutManger

FZhg opened this issue · comments

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#