mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
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:
parent
f826cac6c8
commit
664ebf218e
163 changed files with 503 additions and 4993 deletions
|
|
@ -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() },
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue