Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/src/main/java/com/geeksville/mesh/ui/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.recalculateWindowInsets
import androidx.compose.foundation.layout.safeDrawingPadding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
Expand Down Expand Up @@ -445,7 +447,7 @@ fun MainScreen(uIViewModel: UIViewModel = hiltViewModel(), scanModel: ScannerVie
NavHost(
navController = navController,
startDestination = NodesRoutes.NodesGraph,
modifier = Modifier.fillMaxSize(),
modifier = Modifier.fillMaxSize().recalculateWindowInsets().safeDrawingPadding(),
) {
contactsGraph(navController, uIViewModel.scrollToTopEventFlow)
nodesGraph(navController, uIViewModel.scrollToTopEventFlow)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand All @@ -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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ private fun cacheManagerCallback(onTaskComplete: () -> Unit, onTaskFailed: (Int)
@Suppress("CyclomaticComplexMethod", "LongParameterList", "LongMethod")
@Composable
fun MapView(
modifier: Modifier = Modifier,
mapViewModel: MapViewModel = hiltViewModel(),
navigateToNodeDetails: (Int) -> Unit,
focusedNodeNum: Int? = null,
Expand Down Expand Up @@ -735,6 +736,7 @@ fun MapView(
}

Scaffold(
modifier = modifier,
floatingActionButton = {
DownloadButton(showDownloadButton && downloadRegionBoundingBox == null) { showCacheManagerDialog = true }
},
Expand Down
Loading
Loading