Compose for Wear OS <Alpha15> has been released. A...
# compose-wear
j
Compose for Wear OS Alpha15 has been released. A few additions and changes - one in particular to draw your attention to is that we have added what we call `autoCentering`which will automatically provide space before the first and after the last items in your
ScalingLazyColumn
removing the need to provide top/bottom/vertical content padding - so look to update your padding as part of upgrading.
πŸ™Œ 2
❀️ 11
πŸ‘πŸ½ 1
πŸ‘ 3
🦜 1
πŸ™ŒπŸ½ 1
πŸš€ 3
πŸ‘πŸΌ 1
Another thing worth mentioning is a repackaging (to
androidx.wear.compose.material.dialog
) of the Compose for Wear OS Dialogs as well as ensuring that they can be used as true full screen dialogs as well as Compose Navigation destinations.
Also the
Picker
classes are starting to take advantage of functionality recently added to the
ScalingLazyColumn
. Expect more from
Picker
in the next couple of releases.
d
I see there are some new Rotary input events for the Modifier in alpha 15, but that does not include native scrolling right? We still need to use our own implementation to scroll the screen?
s
Correct, there are some new modifiers in compose to receive the rotary events, but you still need to add code to scroll when receiving them. Note also that the element needs to have the focus to get these events. We will work on simplifying this.
πŸ‘ 1
y
Is there a demo for ScalingLazyColumn for the rotary inputs?
🀞 1
It's also working nicely for non-UI cases, like Volume control.
j
Note that we plan further integration of Rotary events into
Scrollable
containers (with focus) such as
ScalingLazyColumn
y
Nice.
The main thing I'm struggling with is my home screen, which uses Accompanist Horizontal Pager. I'm hoisting up the FocusRequesters, above the individual page screens. I think I'm close.
It seems like the ordering of modifiers has an effect, but I haven't conclusively proved it.
Copy code
modifier = modifier.onRotaryScrollEvent {
           ...
        }
            .focusRequester(focusRequester)
            .focusable()
My first attempt at hoisting was by passing them down through the Modifier, which I was sending anyway. But that put focusRequester and focusable before onRotaryScrollEvent.
Working now.