Thread
#compose-wear
    y

    yschimke

    11 months ago
    With Wear Navigation, what's the guidance for making a single large navigation graph with deeplinks, vs linking out to different distinct Activity's? Would something like settings be best as a separate Activity? Or does it cause any noticeable UX difference (backstack, ui transitions?).
    John Nichol

    John Nichol

    11 months ago
    @Steve Bower [G] - you are probably best placed to comment on this
    i

    Ian Lake

    11 months ago
    The Single Activity talk from a few years ago is even more relevant now:

    https://youtu.be/2k8x8V77CrU

    None of the legit use cases for multiple activities covered in that talk apply to Wear, FWIW
    Steve Bower [G]

    Steve Bower [G]

    11 months ago
    Thanks Ian - just to add, the Wear Compose Navigation library is a thin layer over androidx.navigation - and in most important respects can follow the example of Compose. As an example, a test app we use has 70 destinations within a nav graph 3 levels deep - handles ok within a single activity.
    Alex Vanyo

    Alex Vanyo

    11 months ago
    This specifically applies to Wear Compose Navigation, and not necessarily “normal” Fragment-based navigation on Wear OS, right?
    cc @codingjeremy
    codingjeremy

    codingjeremy

    11 months ago
    +1 - We still recommend only having one or two user journeys on Wear OS and also recommend using multiple Activities. You can still use Fragments if you want, but you have to disable the system swipe-to-dismiss gesture and handle that yourself (along with Ambient Mode work as well [see link]).
    i

    Ian Lake

    11 months ago
    You no longer need to disable the system level swipe to dismiss when using Wear Compose's
    SwipeToDismissBox
    or
    SwipeDismissableNavHost
    - they all work out of the box as of alpha08: https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0-alpha08
    For a fragment based Wear app, you'd need to make sure that each fragment has its own
    SwipeDismissFrameLayout
    , but it is almost easier to just move over to Wear Compose 😛
    codingjeremy

    codingjeremy

    11 months ago
    ha ha, yes! Sorry, I was only talking about views when I said +1... I should have clarified that ^_^;; Yes, Compose takes care of all that. I updated Compose navigation sample for Wear to show that off.