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

Steve Bower [G]

11/09/2021, 9:24 AM
Nikit Bhandari has written a post on how to implement Navigation in Compose for Wear OS using SwipeDismissableNavHost - see https://proandroiddev.com/compose-for-wear-os-navigation-40c42bce9df7
👀 4
🙏 2
y

yschimke

11/10/2021, 8:28 AM
Love the article - please keep these coming!
🙏 1
One nit, we wouldn't really promote this approach, it tends to be a lot harder to shrink down a mobile app, than select the bits you need for the core Watch experience and cherry pick those into a common module.
This is how simple it is to implement navigation in Wear OS, you can reuse the code used in the Android app and replace a few components to make your app ready for Wear OS!
cc @Nikit Bhandari
👍 1
n

Nikit Bhandari

11/10/2021, 9:41 AM
Thanks for the feedback @yschimke! Makes sense, I have updated this paragraph to avoid confusion.
y

yschimke

12/03/2021, 9:16 AM
reposting and ignored compose message here https://kotlinlang.slack.com/archives/CJLTWPH7S/p1638263882275800 Has anyone come up with guidance on navigation with a HorizontalPager
s

Steve Bower [G]

12/06/2021, 5:25 PM
You should be able to used named arguments on the navigation destinations to pick which of the pages in the HorizontalPager list to show when navigating within the App. As you've hinted, deep links are also available within androidx navigation, and if you add a deep link as well as a named argument onto a destination composable, that can be used via Intents.
y

yschimke

12/06/2021, 5:28 PM
Yep, as you've suggested I've wrapped the navcontroller so UI code isn't concatenating route strings with +"/"+ and am using named arguments.
I think i'd like route aliasing 🙂 "player" -> "pager/0", "playlists" -> "pager/1"