UIViewModel

class UIViewModel @Inject constructor(app: Application, nodeDB: NodeRepository, radioConfigRepository: RadioConfigRepository, radioInterfaceService: RadioInterfaceService, meshLogRepository: MeshLogRepository, deviceHardwareRepository: DeviceHardwareRepository, packetRepository: PacketRepository, quickChatActionRepository: QuickChatActionRepository, locationRepository: LocationRepository, firmwareReleaseRepository: FirmwareReleaseRepository, uiPrefs: UiPrefs, meshServiceNotifications: MeshServiceNotifications) : ViewModel, Logging

Constructors

Link copied to clipboard
@Inject
constructor(app: Application, nodeDB: NodeRepository, radioConfigRepository: RadioConfigRepository, radioInterfaceService: RadioInterfaceService, meshLogRepository: MeshLogRepository, deviceHardwareRepository: DeviceHardwareRepository, packetRepository: PacketRepository, quickChatActionRepository: QuickChatActionRepository, locationRepository: LocationRepository, firmwareReleaseRepository: FirmwareReleaseRepository, uiPrefs: UiPrefs, meshServiceNotifications: MeshServiceNotifications)

Types

Link copied to clipboard
data class AlertData(val title: String, val message: String? = null, val html: String? = null, val onConfirm: () -> Unit? = null, val onDismiss: () -> Unit? = null, val choices: Map<String, () -> Unit> = emptyMap())
Link copied to clipboard
data class NodeFilterState(val filterText: String, val includeUnknown: Boolean, val onlyOnline: Boolean, val onlyDirect: Boolean, val showIgnored: Boolean)

Properties

Link copied to clipboard
val channels: StateFlow<<Error class: unknown class>>
Link copied to clipboard
val clientNotification: StateFlow<<Error class: unknown class>?>
Link copied to clipboard
val config: <Error class: unknown class>
Link copied to clipboard
Link copied to clipboard
val contactList: <Error class: unknown class>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val firmwareEdition: <Error class: unknown class>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val lastTraceRouteTime: StateFlow<Long?>
Link copied to clipboard
val localConfig: StateFlow<<Error class: unknown class>>
Link copied to clipboard
Link copied to clipboard
val meshActivity: SharedFlow<MeshActivity>

Emits events for mesh network send/receive activity. This is a SharedFlow to ensure all events are delivered, even if they are the same.

Link copied to clipboard
val meshService: <Error class: unknown class>?
Link copied to clipboard
val module: <Error class: unknown class>
Link copied to clipboard
val moduleConfig: StateFlow<<Error class: unknown class>>
Link copied to clipboard
val myNodeInfo: StateFlow<MyNodeEntity?>
Link copied to clipboard
Link copied to clipboard
val nodeList: StateFlow<List<Node>>
Link copied to clipboard
val nodesUiState: StateFlow<NodesUiState>
Link copied to clipboard
val onlineNodeCount: StateFlow<Int>
Link copied to clipboard
val ourNodeInfo: StateFlow<Node?>
Link copied to clipboard
val provideLocation: StateFlow<Boolean>
Link copied to clipboard
val quickChatActions: <Error class: unknown class>
Link copied to clipboard
Link copied to clipboard
var region: <Error class: unknown class>
Link copied to clipboard
val requestChannelSet: StateFlow<<Error class: unknown class>?>
Link copied to clipboard
val sharedContactRequested: StateFlow<<Error class: unknown class>?>
Link copied to clipboard
val showAppIntro: StateFlow<Boolean>
Link copied to clipboard
val showIgnored: StateFlow<Boolean>
Link copied to clipboard
val showQuickChat: StateFlow<Boolean>
Link copied to clipboard
Link copied to clipboard
val theme: StateFlow<Int>
Link copied to clipboard
val title: StateFlow<String>
Link copied to clipboard
val totalNodeCount: StateFlow<Int>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val unfilteredNodeList: StateFlow<List<Node>>

Functions

Link copied to clipboard
Link copied to clipboard
fun addSharedContact(sharedContact: <Error class: unknown class>): Job
Link copied to clipboard
fun clearClientNotification(notification: <Error class: unknown class>)
Link copied to clipboard

Called immediately after activity observes requestChannelUrl

Link copied to clipboard
Link copied to clipboard
fun clearUnreadCount(contact: String, timestamp: Long): Job
Link copied to clipboard
fun deleteContacts(contacts: List<String>): Job
Link copied to clipboard
fun deleteMessages(uuidList: List<Long>): Job
Link copied to clipboard
Link copied to clipboard
fun deleteWaypoint(id: Int): Job
Link copied to clipboard
fun favoriteNode(node: Node): Job
Link copied to clipboard
Link copied to clipboard
fun getMessagesFrom(contactKey: String): StateFlow<List<Message>>
Link copied to clipboard
fun getNode(userId: String?): Node
Link copied to clipboard
fun getUser(userId: String?): <Error class: unknown class>
Link copied to clipboard
Link copied to clipboard
fun ignoreNode(node: Node): Job
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun removeNode(nodeNum: Int): Job
Link copied to clipboard
fun requestChannelUrl(url: Uri): <Error class: unknown class>
Link copied to clipboard
fun requestPosition(destNum: Int, position: Position = Position(0.0, 0.0, 0))
Link copied to clipboard
fun requestTraceroute(destNum: Int)
Link copied to clipboard
fun requestUserInfo(destNum: Int)
Link copied to clipboard
fun saveDataCsv(uri: Uri, filterPortnum: Int? = null)

Export all persisted packet data to a CSV file at the given URI.

Link copied to clipboard
fun sendMessage(str: String, contactKey: String = "0", replyId: Int? = null)
Link copied to clipboard
fun sendReaction(emoji: String, replyId: Int, contactKey: String): Job
Link copied to clipboard
fun sendWaypoint(wpt: <Error class: unknown class>, contactKey: String = "0")
Link copied to clipboard
fun setChannel(channel: <Error class: unknown class>)
Link copied to clipboard
fun setChannels(channelSet: <Error class: unknown class>): Job

Set the radio config (also updates our saved copy in preferences).

Link copied to clipboard
fun setConfig(config: <Error class: unknown class>)
Link copied to clipboard
fun setMuteUntil(contacts: List<String>, until: Long): Job
Link copied to clipboard
Link copied to clipboard
fun setNodeNotes(nodeNum: Int, notes: String): Job
Link copied to clipboard
fun setOwner(name: String)
Link copied to clipboard
Link copied to clipboard
fun setSharedContactRequested(sharedContact: <Error class: unknown class>?)
Link copied to clipboard
Link copied to clipboard
fun setTheme(theme: Int)
Link copied to clipboard
fun setTitle(title: String)
Link copied to clipboard
fun showAlert(title: String, message: String? = null, html: String? = null, onConfirm: () -> Unit? = {}, dismissable: Boolean = true, choices: Map<String, () -> Unit> = emptyMap())
Link copied to clipboard
Link copied to clipboard
fun showSnackBar(text: Int): Job
fun showSnackBar(text: String, actionLabel: String? = null, withDismissAction: Boolean = false, duration: SnackbarDuration = if (actionLabel == null) SnackbarDuration.Short else SnackbarDuration.Indefinite, onActionPerformed: () -> Unit = {}, onDismissed: () -> Unit = {}): Job
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard