material-components-android-codelabs icon indicating copy to clipboard operation
material-components-android-codelabs copied to clipboard

MD103 - Step 6 Should Use StaggeredGridLayoutManger

Open FZhg opened this issue 5 years ago • 0 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):

  • 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#

FZhg avatar Mar 07 '20 10:03 FZhg