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
- the results are the same.
Codelab details (please complete the following information about the codelab):
- Level (MDC-103)
- Language ( Kotlin)
- Link to the codelab at the step with the issue https://codelabs.developers.google.com/codelabs/mdc-103-kotlin/index.html?index=..%2F..index#5
Additional context
https://stackoverflow.com/questions/33696096/setting-span-size-of-single-row-in-staggeredgridlayoutmanager/33707897#