refactor: null safety, update date/time libraries, and migrate tests (#4900)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2026-03-23 18:17:50 -05:00 committed by GitHub
parent f826cac6c8
commit 664ebf218e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
163 changed files with 503 additions and 4993 deletions

View file

@ -90,21 +90,20 @@ fun MeshtasticDialog(
val confirmButtonText = confirmText ?: confirmTextRes?.let { stringResource(it) }
val dismissButtonText = dismissText ?: dismissTextRes?.let { stringResource(it) }
val htmlAnnotated =
html?.let {
annotatedStringFromHtml(
it,
linkStyles =
TextLinkStyles(
style =
SpanStyle(
textDecoration = TextDecoration.Underline,
fontStyle = FontStyle.Italic,
color = MaterialTheme.colorScheme.primary,
),
val htmlAnnotated = html?.let {
annotatedStringFromHtml(
it,
linkStyles =
TextLinkStyles(
style =
SpanStyle(
textDecoration = TextDecoration.Underline,
fontStyle = FontStyle.Italic,
color = MaterialTheme.colorScheme.primary,
),
)
}
),
)
}
AlertDialog(
onDismissRequest = { if (dismissable) onDismiss?.invoke() },

View file

@ -62,13 +62,12 @@ fun <T : Enum<T>> DropDownPreference(
enumEntriesOf(selectedItem).filter { it.name != "UNRECOGNIZED" && !it.isDeprecatedEnumEntry() }
}
val items =
enumConstants.map {
val label = itemLabel?.invoke(it) ?: it.name
val icon = itemIcon?.invoke(it)
val color = itemColor?.invoke(it)
DropDownItem(it, label, icon, color)
}
val items = enumConstants.map {
val label = itemLabel?.invoke(it) ?: it.name
val icon = itemIcon?.invoke(it)
val color = itemColor?.invoke(it)
DropDownItem(it, label, icon, color)
}
DropDownPreference(
title = title,

View file

@ -35,6 +35,7 @@ class SharedContactViewModel(nodeRepository: NodeRepository, private val service
val unfilteredNodes: StateFlow<List<Node>> =
nodeRepository.getNodes().stateInWhileSubscribed(initialValue = emptyList())
fun addSharedContact(sharedContact: SharedContact) =
viewModelScope.launch { serviceRepository.onServiceAction(ServiceAction.ImportContact(sharedContact)) }
fun addSharedContact(sharedContact: SharedContact) = viewModelScope.launch {
serviceRepository.onServiceAction(ServiceAction.ImportContact(sharedContact))
}
}