mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
fix: ui tweaks (#4696)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
657553f830
commit
c234ace312
5 changed files with 258 additions and 247 deletions
|
|
@ -25,7 +25,13 @@ fun getString(stringResource: StringResource): String = runBlocking { composeGet
|
|||
|
||||
/** Retrieves a formatted string from the [StringResource] in a blocking manner. */
|
||||
fun getString(stringResource: StringResource, vararg formatArgs: Any): String = runBlocking {
|
||||
composeGetString(stringResource, *formatArgs)
|
||||
val pattern = composeGetString(stringResource)
|
||||
if (formatArgs.isNotEmpty()) {
|
||||
@Suppress("SpreadOperator")
|
||||
pattern.format(*formatArgs)
|
||||
} else {
|
||||
pattern
|
||||
}
|
||||
}
|
||||
|
||||
/** Retrieves a string from the [StringResource] in a suspending manner. */
|
||||
|
|
@ -44,6 +50,11 @@ suspend fun getStringSuspend(stringResource: StringResource, vararg formatArgs:
|
|||
}
|
||||
.toTypedArray()
|
||||
|
||||
@Suppress("SpreadOperator")
|
||||
return composeGetString(stringResource, *resolvedArgs)
|
||||
val pattern = composeGetString(stringResource)
|
||||
return if (resolvedArgs.isNotEmpty()) {
|
||||
@Suppress("SpreadOperator")
|
||||
pattern.format(*resolvedArgs)
|
||||
} else {
|
||||
pattern
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue