Repository: Automattic/pocket-casts-android
File: wear/src/main/kotlin/au/com/shiftyjelly/pocketcasts/wear/MainActivity.kt (Kotlin)

Code before:
    onShowLoginScreen: () -> Unit,
    onRetrySync: () -> Unit,
    signOut: () -> Unit,
    showConnectivityNotification: Boolean,
    isConnected: Boolean,
    dismissConnectivityNotification: () -> Unit,
) {
    val navController = rememberSwipeDismissableNavController()
    val swipeToDismissState = rememberSwipeToDismissBoxState()
    val navState = rememberSwipeDismissableNavHostState(swipeToDismissState)

    if (showLoggingInScreen) {
        navController.navigate(LoggingInScreen.ROUTE_WITH_DELAY)
        onShowLoginScreen()
    }

    val userCanAccessWatch = signInState.isSignedInAsPlusOrPatron

    val waitingForSignIn = remember { mutableStateOf(false) }
    if (!userCanAccessWatch) {
        waitingForSignIn.value = true
    }

    val startDestination = if (userCanAccessWatch) WatchListScreen.ROUTE else RequirePlusScreen.ROUTE

    var timeTextVisible by remember { mutableStateOf(true) }

    // Reset to visible on every navigation change — NowPlayingPager will
    // override to false if it's on a non-zero page
    LaunchedEffect(navController) {
        navController.currentBackStackEntryFlow.collect {
            timeTextVisible = true
        }
    }

    CompositionLocalProvider(LocalSetTimeTextVisible provides { timeTextVisible = it }) {
        AppScaffold(
            timeText = {
                if (timeTextVisible) {
                    TimeTextWithConnectivity(isConnected = isConnected)
                }
            },
        ) {
            Box(modifier = Modifier.fillMaxSize()) {
                SwipeDismissableNavHost(
                    startDestination = startDestination,
                    navController = navController,
                    state = navState,
                ) {
                    composable(
                        route = RequirePlusScreen.ROUTE,

Review comment (suggestion):
I don't think it's a good idea to remove the time and connection status icons from the Now Playing page. If we remove the “Streaming may be affected” panel, we should ensure the cloud icon is clearly visible on the Now Playing screen so users still have feedback about the streaming status.

Code after:
    val swipeToDismissState = rememberSwipeToDismissBoxState()
    val navState = rememberSwipeDismissableNavHostState(swipeToDismissState)

    if (showLoggingInScreen) {
        navController.navigate(LoggingInScreen.ROUTE_WITH_DELAY)
        onShowLoginScreen()
    }

    val userCanAccessWatch = signInState.isSignedInAsPlusOrPatron

    val waitingForSignIn = remember { mutableStateOf(false) }
    if (!userCanAccessWatch) {
        waitingForSignIn.value = true
    }

    // Wrap in a State so that composable destinations inside the NavHost can read the latest value even though the nav graph is cached.
    val currentSyncState = rememberUpdatedState(syncState)

    val startDestination = if (userCanAccessWatch) WatchListScreen.ROUTE else RequirePlusScreen.ROUTE

    AppScaffold(
        timeText = {
            TimeTextWithConnectivity(isConnected = isConnected)
        },
    ) {
        Box(modifier = Modifier.fillMaxSize()) {
            SwipeDismissableNavHost(
                startDestination = startDestination,
                navController = navController,
                state = navState,
            ) {
                composable(
                    route = RequirePlusScreen.ROUTE,
                ) {
                    RequirePlusScreen(
                        onContinueToLogin = { navController.navigate(AUTHENTICATION_SUB_GRAPH) },
                    )
                }

                composable(
                    route = WatchListScreen.ROUTE,
                ) {
                    NowPlayingPager(
                        allowSwipeToDismiss = false,
                        navController = navController,
                        swipeToDismissState = swipeToDismissState,
                    ) {
                        val scope = rememberCoroutineScope()
                        WatchListScreen(
                            columnState = columnState,
                            navigateToRoute = navController::navigate,