Diff items in GridLayout
NetylkinOV opened this issue · 4 comments
NetylkinOV commented
mikepenz commented
@NetylkinOV yes this is possible.
See this example: https://github.com/mikepenz/FastAdapter/blob/develop/app/src/main/java/com/mikepenz/fastadapter/app/IconGridActivity.kt
NetylkinOV commented
Hi mikepenz, thank you so much for your help. The short answer is:
val gridLayoutManager = GridLayoutManager (this, 3)
gridLayoutManager.spanSizeLookup = object: GridLayoutManager.SpanSizeLookup () {
override fun getSpanSize (position: Int): Int {
return when (fastItemAdapter.getItemViewType (position)) {
R.id.fastadapter_expandable_item_id -> 3
R.id.fastadapter_icon_item_id -> 1
else -> -1
}
}
}
As I don't need an implementation with Expandable.
I have been using your library for several years now, it's amazing how powerful it is.
I'm still waiting for the multiplatform kotlin version :)))
NetylkinOV commented
I wish you health and good luck :)
mikepenz commented
Happy I could help :) Thanks for the kind words