Assigned
Status Update
Comments
st...@google.com <st...@google.com>
ss...@google.com <ss...@google.com> #2
The feature we need on Kotlin is not implemented yet:
There are some workaround, but they are not pretty, like:
val TransformingLazyColumnItemScope.scrollTransform : Modifier.(Color, Shape) -> Modifier
get() = { backgroundColor, shape ->
scrollTransform(this, backgroundColor, shape)
}
This allows you to call scrollTransform directly from the scope, but has 2 drawbacks:
- We can't set defaults for color/shape
- Parameters don't have names, so you can't use
scrollTransform(color = ..., shape = ...)
- A new lambda is created each time you call
.scrollTransform
ss...@google.com <ss...@google.com> #3
It may be possible if we annotate the class as @DslMarker , will check later.
ss...@google.com <ss...@google.com> #4
No that doesn't help, and it's already there.
Description
This
Modifier.fillMaxWidth().scrollTransform(this)
feels strange given the pattern set by Box, Column and friends with scope specific Modifiers such asalign()
.Can we remove
this
as the first param and put it on the scope?