louiscad
11/24/2022, 5:47 AMRecyclerView
or WearableRecyclerView
in a @Composable
function, you need to hack around to get rotary input to work.
If any of you need that, let me know, I will share my code in a gist or in an open source library.
BTW, does anyone know how to have something like ScalingLazyColumn
but with RecyclerView
?
Basically, I'm looking for the same effect as in the Settings app and in the App Drawer from the Pixel Watch.John Nichol
11/24/2022, 10:04 AMJohn Nichol
11/24/2022, 10:05 AMlouiscad
11/24/2022, 10:08 AMAndroidView
) as soon as they exit the screen, and when you have Views that are a bit expensive to instantiate, that makes a huge difference.
With RecyclerView, it barely lags. With LazyColumn and ScalingLazyColumn, you get dropped frames all the time because it keeps recreating AndroidView
elements, and it's not recycling them of course.louiscad
11/24/2022, 10:09 AMlouiscad
11/24/2022, 10:11 AMScalingLazyColumn
themselves? I really doubt it since you get the haptic feedback on rotary input that you currently only get when linked to a RecyclerView
.louiscad
11/24/2022, 10:11 AMyschimke
11/24/2022, 11:03 AMlouiscad
11/24/2022, 11:04 AMAndroidView
isn't that open actually, it's a pain to work with beyond the make this View composable use case.John Nichol
11/24/2022, 11:06 AMlouiscad
11/24/2022, 11:07 AMfactory
parameter passed to AndroidView
, but then I got errors like "this view already has a parent". Then I tried to remove it, but got other errors, after spending too much time on it, I gave up, tried my Compose RecyclerView wrappers, and I saw it was smoother, even when it only contains Composables, and especially in debug mode, so I only use that now.louiscad
11/24/2022, 11:09 AMRecyclerView
, some ListView
, ScalingLazyColumn
, or some add-on on top of the 2 former things I mentioned?John Nichol
11/24/2022, 11:14 AMyschimke
11/24/2022, 11:15 AMyschimke
11/24/2022, 11:16 AMlouiscad
11/24/2022, 11:16 AMlouiscad
11/24/2022, 11:19 AMScalingLazyColumn
, even though it's not working well for me at the moment. I guess I'll give up the scaling animations for now…John Nichol
11/24/2022, 11:20 AMlouiscad
11/24/2022, 11:21 AMlouiscad
11/24/2022, 11:25 AMAndroidView
, so you get frame drops every time a Composable that includes one comes back into the screen.
2. ScalingLazyColumn
and LazyColumn
is always insanely laggy in debug to the point that it's just unsuable, with or without AndroidView
. On the other hand RecyclerView
and WearableRecyclerView
(the screen curvature following one), even with `ComposeView`s all inside, and even when it's also inside a composition, is usable, and can be smooth.
3. RecyclerView
and friends are the only ones that provide the nice haptics when using rotary input now.louiscad
11/24/2022, 11:26 AMlouiscad
11/24/2022, 11:26 AMyschimke
11/24/2022, 11:30 AMlouiscad
11/24/2022, 11:31 AMyschimke
11/24/2022, 12:33 PMlouiscad
11/24/2022, 12:36 PMyschimke
11/24/2022, 12:38 PMyschimke
11/24/2022, 12:39 PMlouiscad
11/24/2022, 12:41 PMRecyclerView
composable wrappers.
There are some missing parts because I didn't need them yet, but I think it would be possible to bridge the gapyschimke
11/25/2022, 11:18 AM