Modern Apps git
git clone https://git.maproj.org/Modern-Apps.git
translate ▾

Modern-Apps.git / networklocation / src / main / java / com / vayunmathur / networklocation / ui / SetupScreen.kt

SetupScreen.kt40 lines · 1.8 KiBRaw
1package com.vayunmathur.networklocation.ui
2
3import androidx.compose.foundation.layout.Column
4import androidx.compose.foundation.layout.fillMaxWidth
5import androidx.compose.foundation.layout.padding
6import androidx.compose.foundation.rememberScrollState
7import androidx.compose.foundation.verticalScroll
8import androidx.compose.runtime.Composable
9import androidx.compose.ui.Modifier
10import androidx.compose.ui.unit.dp
11import com.vayunmathur.library.ui.AppScaffold
12import com.vayunmathur.library.ui.DesktopMaxWidthContainer
13import com.vayunmathur.library.ui.MaterialTheme
14import com.vayunmathur.library.ui.Text
15import com.vayunmathur.networklocation.ui.OfflineDatabaseSection
16
17/** First-run screen: what the app does, and the offline-database download it cannot work without. */
18@Composable
19fun SetupScreen(onReady: () -> Unit) {
20 AppScaffold(title = "Network Location") { padding ->
21 // Letterboxed on expanded windows so the status text keeps a readable measure.
22 DesktopMaxWidthContainer(Modifier.padding(padding)) {
23 Column(
24 Modifier
25 .fillMaxWidth()
26 .verticalScroll(rememberScrollState())
27 .padding(24.dp)
28 ) {
29 Text(
30 "Provides the system network-location provider and an on-device, offline " +
31 "geocoder. Both resolve entirely on device from the downloaded databases " +
32 "below — nothing is sent to a positioning service. Always on — there is no " +
33 "disable switch.",
34 style = MaterialTheme.typography.bodyMedium,
35 )
36 OfflineDatabaseSection(Modifier.padding(top = 24.dp), onReady = onReady)
37 }
38 }
39 }
40}