From 0cb0b19128eaeb8d874d17b4ae9032c69d605613 Mon Sep 17 00:00:00 2001 From: Phil Oliver <3497406+poliver@users.noreply.github.com> Date: Fri, 5 Sep 2025 13:24:41 -0400 Subject: [PATCH] Move "show app intro" to phone settings (#2984) --- app/src/main/java/com/geeksville/mesh/model/UIState.kt | 9 ++------- app/src/main/java/com/geeksville/mesh/ui/Main.kt | 1 - .../geeksville/mesh/ui/common/components/MainAppBar.kt | 1 - .../com/geeksville/mesh/ui/settings/SettingsScreen.kt | 9 +++++++++ 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/model/UIState.kt b/app/src/main/java/com/geeksville/mesh/model/UIState.kt index ea1d2e328..dfed41f21 100644 --- a/app/src/main/java/com/geeksville/mesh/model/UIState.kt +++ b/app/src/main/java/com/geeksville/mesh/model/UIState.kt @@ -63,7 +63,6 @@ import com.geeksville.mesh.repository.radio.MeshActivity import com.geeksville.mesh.repository.radio.RadioInterfaceService import com.geeksville.mesh.service.MeshServiceNotifications import com.geeksville.mesh.service.ServiceAction -import com.geeksville.mesh.ui.common.components.MainMenuAction import com.geeksville.mesh.ui.node.components.NodeMenuAction import com.geeksville.mesh.util.getShortDate import com.geeksville.mesh.util.positionToMeter @@ -1001,12 +1000,8 @@ constructor( private val _showAppIntro: MutableStateFlow = MutableStateFlow(!uiPrefs.appIntroCompleted) val showAppIntro: StateFlow = _showAppIntro.asStateFlow() - fun onMainMenuAction(action: MainMenuAction) { - when (action) { - MainMenuAction.SHOW_INTRO -> _showAppIntro.update { true } - - else -> Unit - } + fun showAppIntro() { + _showAppIntro.update { true } } // endregion diff --git a/app/src/main/java/com/geeksville/mesh/ui/Main.kt b/app/src/main/java/com/geeksville/mesh/ui/Main.kt index 5a062ffbc..3abb9431d 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/Main.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/Main.kt @@ -352,7 +352,6 @@ fun MainScreen( if (action is MainMenuAction) { when (action) { MainMenuAction.QUICK_CHAT -> navController.navigate(ContactsRoutes.QuickChat) - MainMenuAction.SHOW_INTRO -> uIViewModel.onMainMenuAction(action) else -> onAction(action) } } else if (action is NodeMenuAction) { diff --git a/app/src/main/java/com/geeksville/mesh/ui/common/components/MainAppBar.kt b/app/src/main/java/com/geeksville/mesh/ui/common/components/MainAppBar.kt index 723369b66..f3ae7fd26 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/common/components/MainAppBar.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/common/components/MainAppBar.kt @@ -206,7 +206,6 @@ private fun TopBarActions( enum class MainMenuAction(@StringRes val stringRes: Int) { EXPORT_RANGETEST(R.string.save_rangetest), - SHOW_INTRO(R.string.intro_show), QUICK_CHAT(R.string.quick_chat), } diff --git a/app/src/main/java/com/geeksville/mesh/ui/settings/SettingsScreen.kt b/app/src/main/java/com/geeksville/mesh/ui/settings/SettingsScreen.kt index a4c3ba2b3..096889890 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/settings/SettingsScreen.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/settings/SettingsScreen.kt @@ -30,6 +30,7 @@ import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.BugReport import androidx.compose.material.icons.rounded.FormatPaint import androidx.compose.material.icons.rounded.Language +import androidx.compose.material.icons.rounded.WavingHand import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf @@ -212,6 +213,14 @@ fun SettingsScreen( choices = themeMap.mapValues { (_, value) -> { uiViewModel.setTheme(value) } }, ) } + + SettingsItem( + text = stringResource(R.string.intro_show), + leadingIcon = Icons.Rounded.WavingHand, + trailingIcon = null, + ) { + uiViewModel.showAppIntro() + } } } }