Nikit Bhandari has written a post on how to implem...
# compose-wear
s
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
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
Thanks for the feedback @yschimke! Makes sense, I have updated this paragraph to avoid confusion.
y
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
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
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"