From my understanding `contentType` in LazyLayouts...
# compose
a
From my understanding
contentType
in LazyLayouts optimise performance by reusing the composeable. I am catering for a use-case where the user can toggle between grid and single row cells. More in 🧵
Is this a valid contentType
Copy code
contentType = {
    when (it) {
        is ListingModel -> if (isFatCard) "FatCard" else if (isGridView) "ListingCell" else "ListingRow"        
        is AdModel -> "AdPlaceholderModel"
        is HeaderModel -> "HeaderModel"
    }
},
The issue is that the same model can be a Cell in a grid or an entire row. I only change
GridItemSpan
Depending on a selection, the same item can also be either lean or Fat.
In short, ListingModel can show up as a 1. Lean Rectangle
GridItemSpan(2)
2. Fat Rectangle
GridItemSpan(2)
3. Square
GridItemSpan(1)
I am not quite clear on if I show provide
it
,
class
or if current way of doing it is the most optimal.
k
Its valid but the only issue i could see is it relies on external states type should should be encapsulated within the models like in your case it can be a sealed class shape from which they can inherit and polymorphic type can be determined by a discriminator