Skip to content

Commit

Permalink
Add (My)BackHandler in main navigation to come back to main navigatio…
Browse files Browse the repository at this point in the history
…n when in credits
  • Loading branch information
opatry committed Oct 16, 2024
1 parent 13464d8 commit 6654a35
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import androidx.compose.ui.platform.LocalWindowInfo
import androidx.compose.ui.unit.dp
import net.opatry.tasks.app.ui.component.EditTextDialog
import net.opatry.tasks.app.ui.component.MissingScreen
import net.opatry.tasks.app.ui.component.MyBackHandler
import net.opatry.tasks.app.ui.component.ProfileIcon
import net.opatry.tasks.app.ui.screen.AboutApp
import net.opatry.tasks.app.ui.screen.AboutScreen
Expand Down Expand Up @@ -96,6 +97,10 @@ fun TasksApp(aboutApp: AboutApp, userViewModel: UserViewModel, tasksViewModel: T
var newTaskListDefaultTitle by remember { mutableStateOf("") }
var showNewTaskListDialog by remember { mutableStateOf(false) }

MyBackHandler({ selectedScreen != AppTasksScreen.Tasks }) {
selectedScreen = AppTasksScreen.Tasks
}

NavigationSuiteScaffold(navigationSuiteItems = {
AppTasksScreen.entries.forEach { screen ->
// hide unsupported screens for now
Expand Down

0 comments on commit 6654a35

Please sign in to comment.