I am extremely new to Compose and wearOS and I've been looking through a ton of tutorials trying to find a way to have a multi-screen application in wearOS that doesn't rely on tap events to navigate between views. I come from iOS and Swift/SwiftUI and it is extremely simple in that. I have a watch app for iOS and all I have to do is...
struct ContentView: View {
var body: some View {
TabView {
ProgressView()
.tabItem {
Text("Progress")
}
...
}
}
And that works perfectly on watchOS, you have multiple pages and just swipe left and right to change the page.
I can't figure out how to do that with wearOS and Compose. I have seen tutorials for regular Android applications using compose, but nothing for wearOS applications. I just need a multipage application that you can swipe left and right to change the page you are on. Am I missing something? Is that not allowed on wearOS? I know you can build tabs and things with Compose for Android apps, but I need it for wearOS and can't find anything. Every time I try to search for a multi-page application for wearOS all I can find is using the androidx wear navigation and have click events that take you to new destinations. The way the app is designed is there is no click events, just swipe left and right.
Sorry I don't have any code samples because I literally can't figure out how to get it done. I did try a SwipeDismissableNavHost
but that didn't seem to do anything...
@Composable
fun WearApp() {
WearAppTheme {
...
Scaffold(
timeText = {
TimeText(modifier = Modifier.scrollAway(listState))
}
...
) {
SwipeDismissableNavHost(
navController = navController,
startDestination = "progress_view"
) {
composable(route = "progress_view") {
ProgressView(listState = listState)
}
composable(route = "timer_view") {
TimerView()
}
}
}
}
}
However, when I run that in a simulator I only get a single page and no swipe action, I assume that's because the nav controller needs a click event to update the destination route, but I don't want a click, just swipe left or right to change the page.
Sorry for the long post. I appreciate any help. Thank you