kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
Move "show app intro" to phone settings (#2984)
rodzic
f78c440c61
commit
0cb0b19128
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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),
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue