UIViewModel

class UIViewModel(nodeDB: NodeRepository, serviceRepository: ServiceRepository, radioController: RadioController, radioInterfaceService: RadioInterfaceService, meshLogRepository: MeshLogRepository, firmwareReleaseRepository: FirmwareReleaseRepository, uiPrefs: UiPrefs, notificationManager: NotificationManager, packetRepository: PacketRepository, val alertManager: AlertManager, val snackbarManager: SnackbarManager) : ViewModel(source)

Shared base for the application-level ViewModel.

Contains all platform-independent state and actions (themes, alerts, connection state, firmware checks, traceroute, shared contacts, channel sets, unread counts, etc.).

Constructors

Link copied to clipboard
constructor(nodeDB: NodeRepository, serviceRepository: ServiceRepository, radioController: RadioController, radioInterfaceService: RadioInterfaceService, meshLogRepository: MeshLogRepository, firmwareReleaseRepository: FirmwareReleaseRepository, uiPrefs: UiPrefs, notificationManager: NotificationManager, packetRepository: PacketRepository, alertManager: AlertManager, snackbarManager: SnackbarManager)

Properties

Link copied to clipboard
Link copied to clipboard
val appIntroCompleted: StateFlow<Boolean>
Link copied to clipboard
val clientNotification: StateFlow<ClientNotification?>
Link copied to clipboard

Canonical app-level connection state, sourced from ServiceRepository.connectionState.

Link copied to clipboard
val contrastLevel: StateFlow<Int>
Link copied to clipboard
Link copied to clipboard
val firmwareEdition: Flow<FirmwareEdition?>
Link copied to clipboard

Emits events for mesh network send/receive activity.

Link copied to clipboard
val myNodeInfo: StateFlow<MyNodeInfo?>
Link copied to clipboard
val navigationDeepLink: SharedFlow<List<NavKey>>
Link copied to clipboard
val neighborInfoResponse: StateFlow<String?>
Link copied to clipboard
val requestChannelSet: StateFlow<ChannelSet?>
Link copied to clipboard
Link copied to clipboard
val sharedContactRequested: StateFlow<SharedContact?>
Link copied to clipboard
Link copied to clipboard
val theme: StateFlow<Int>
Link copied to clipboard
Link copied to clipboard
val unreadMessageCount: StateFlow<Int>

Functions

Link copied to clipboard
expect open fun addCloseable(closeable: AutoCloseable)
expect fun addCloseable(key: String, closeable: AutoCloseable)
Link copied to clipboard
fun clearClientNotification(notification: ClientNotification)
Link copied to clipboard
Link copied to clipboard

Clears the pending channel set import request.

Link copied to clipboard

Clears the pending shared contact request.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
expect fun <T : AutoCloseable> getCloseable(key: String): T?
Link copied to clipboard
fun handleDeepLink(uri: CommonUri, onInvalid: () -> Unit = {})

Unified handler for all Meshtastic deep links and OS intents.

Link copied to clipboard
Link copied to clipboard
fun setDeviceAddress(address: String)
Link copied to clipboard
fun setRequestChannelSet(channelSet: ChannelSet?)
Link copied to clipboard
fun setSharedContactRequested(contact: SharedContact?)
Link copied to clipboard
fun showAlert(title: String? = null, titleRes: StringResource? = null, message: String? = null, messageRes: StringResource? = null, composableMessage: ComposableContent? = null, html: String? = null, onConfirm: () -> Unit? = {}, onDismiss: () -> Unit? = null, confirmText: String? = null, confirmTextRes: StringResource? = null, dismissText: String? = null, dismissTextRes: StringResource? = null, choices: Map<String, () -> Unit> = emptyMap())
Link copied to clipboard
fun showSnackbar(message: String, actionLabel: String? = null, onAction: () -> Unit? = null)
Link copied to clipboard