https://kotlinlang.org logo
Title
d

Dmitry Strekha

03/22/2022, 5:10 PM
Is there any way to overlap items in LazyList? In RecyclerView we could set negative offsets in
ItemDecoration#getItemOffsets
I tried
Modifier#offset
, but seems it affects only the item on which the modifier was applied, so items below do not shift
r

Robert Menke

03/22/2022, 5:20 PM
This seems hacky, but you could apply increasing offsets at an index. Not sure if you’d end up with a bunch of empty space in the column though.
m

myanmarking

03/22/2022, 7:47 PM
I think spacedBy modifier allows for negative space. Please check
:cool-doge: 1
d

Dmitry Strekha

03/23/2022, 5:51 PM
Robert's hack works, but yeah, there is some empty space left at the bottom of the column. Tried
verticalArrangement = spacedBy
, but all items now overlap. What I need is to shift some specific items. I think I'll use offset modifier for now, even though result isn't ideal
z

Zach Klippenstein (he/him) [MOD]

03/23/2022, 5:59 PM
You could file a feature request for this. Tracker link is in channel topic
🙏 2
m

myanmarking

03/23/2022, 9:55 PM
Yes please. A spaceBy modifier that receives an index and the item and returns the space would be very helfull @Zach Klippenstein (he/him) [MOD]
z

Zach Klippenstein (he/him) [MOD]

03/23/2022, 10:44 PM
If you file a feature request, I would suggest describing what you’re actually trying to achieve, rather than specifically saying a modifier (although you could propose a modifier as a possible/example solution). I’m not sure a modifier is actually the right thing here.