Hello, is there an equivalent to LazyColumn's `ani...
# compose-wear
l
Hello, is there an equivalent to LazyColumn's
animateItem()
for ScalingLazyColumn in Horologist, or in Wear Compose Foundation? I need to animate item additions, removals, and order changes.
1
y
I don't think so.
The Horologist one is a thin wrapper on top of wear compose
l
It'd be great that features added to the main LazyColumn make it to the Wear one promptly. I mean, people waited years for animateItem() in LazyColumn, and for Wear, it's still counting? I'll use RecyclerView in the meantime, glad it exists 🙂
y
Wear LazyColumn is being actively developed and I believe plan is similar support to the mobile one such as animation
l
Is it set to replace ScalingLazyColumn in the end?
y
For material3 yes
l
Also, why not just make LazyColumn adapt to the watch instead?
I mean, the Compose Foundation one that works on phones, tablets and desktops
y
I think there are some custom requirements that won't be supported in that. But that's a guess
l
That platform segregation isn't helping much IMO
I mean, we can make APIs that adapt to Android, iOS, and Web specificities, I don't see why it wouldn't be possible for Wear OS
SwiftUI went that route of sharing more between the phone and the watch, to the point you can develop a responsive widget that works nicely on both iOS and watchOS
I also think it's easier to not have code duplication within AndroidX for the maintainers… and avoids situations where "LazyColumn" supports feature X but also doesn't support feature X because there's LazyColumn, and LazyColumn (the other one).
y
I'm the wrong person to discuss this with
l
Who is?
Still interested in the answer. I'm kinda stuck in a uncomfortable spot: • Wrapping with RecyclerView leads to display glitches (wrong item data displayed until scroll is initiated again…) • LazyColumn (the one from the regular Foundation artifact) doesn't support rotary input by default, so I'd need to bridge it myself, which isn't easy since I want it to feel right to the user
y
cc @stevebower
👀 1
l
Thank you very much, adding the snippet below helped for the "mobile"
LazyColumn
(which works perfectly on desktop and wearables too now):
Copy code
val scrollableState = rememberLazyListState()
LazyColumn(
    modifier = Modifier.rotaryScrollable(
        RotaryScrollableDefaults.behavior(scrollableState),
        focusRequester = rememberActiveFocusRequester()
    ),
    state = scrollableState,
    ...
) {
    ...
}
🎉 2