https://kotlinlang.org logo
#compose-wear
Title
# compose-wear
l

Lauri Koskela

09/24/2023, 6:14 PM
Is there any way to enable screen enter transitions when using compose navigation on Wear (with WearNavScaffold)?
y

yschimke

09/24/2023, 6:20 PM
Can you explain more what you are trying to achieve?
l

Lauri Koskela

09/24/2023, 6:25 PM
I have a very simple two screen nav graph; one landing screen and one detail screen. The detail screen can be navigated to from buttons on the landing screen. Currently there's no transition animations when entering the detail screen. I'm wondering if there's anything like
enterTransition
on mobile?
y

yschimke

09/24/2023, 6:33 PM
I'm not actually sure. My impression is that wear compose SwipeDismissableNavHost is opinionated about it.
You can have you own screen level animations on first showing. And you can certainly implement yourself like accompanist did. But I wonder if you'd have to also reimplement SwipeToDismissBox?
I'm curious what the answer is, sorry I can't help
s

stevebower

09/25/2023, 3:43 PM
Hi - what you're describing is available in the Compose Navigation library from 2.7 onwards, where you can specify enter/exit and popEnter/popExit transitions. But this is not yet available in the Wear Compose Navigation library - sounds like what you need is for that to be carried over to Wear.
l

Lauri Koskela

09/25/2023, 5:19 PM
So is a custom implementation for the animations possible, and how complex would that be? Reimplementing SwipeToDismissBox etc. sounds a bit too much for my simple app
s

stevebower

09/26/2023, 9:51 AM
Transitions on navigation isn't supported right now, but is on our roadmap. If you really need transitions today, you could try hosting your detail screen in a Dialog (which does support in/out transitions) - the List screen would be a navigation destination as before and it would launch a Dialog under each List item.
l

Lauri Koskela

09/26/2023, 9:53 AM
That sounds like a good idea to try out. I don't really need the transitions, I just thought it was a bit strange that they were not implemented as the UI will look unpolished without them. I'll give the dialog a try. Thanks! 🙏
3 Views