Move "show app intro" to phone settings (#2984)

pull/2986/head
Phil Oliver 2025-09-05 13:24:41 -04:00 zatwierdzone przez GitHub
rodzic f78c440c61
commit 0cb0b19128
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
4 zmienionych plików z 11 dodań i 9 usunięć

Wyświetl plik

@ -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<Boolean> = MutableStateFlow(!uiPrefs.appIntroCompleted)
val showAppIntro: StateFlow<Boolean> = _showAppIntro.asStateFlow()
fun onMainMenuAction(action: MainMenuAction) {
when (action) {
MainMenuAction.SHOW_INTRO -> _showAppIntro.update { true }
else -> Unit
}
fun showAppIntro() {
_showAppIntro.update { true }
}
// endregion

Wyświetl plik

@ -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) {

Wyświetl plik

@ -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),
}

Wyświetl plik

@ -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()
}
}
}
}