Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / networklocation / src / main / java / com / vayunmathur / networklocation / ui / SetupScreen.kt
SetupScreen.kt40 lines · 1.8 KiBRaw
| 1 | package com.vayunmathur.networklocation.ui |
| 2 | |
| 3 | import androidx.compose.foundation.layout.Column |
| 4 | import androidx.compose.foundation.layout.fillMaxWidth |
| 5 | import androidx.compose.foundation.layout.padding |
| 6 | import androidx.compose.foundation.rememberScrollState |
| 7 | import androidx.compose.foundation.verticalScroll |
| 8 | import androidx.compose.runtime.Composable |
| 9 | import androidx.compose.ui.Modifier |
| 10 | import androidx.compose.ui.unit.dp |
| 11 | import com.vayunmathur.library.ui.AppScaffold |
| 12 | import com.vayunmathur.library.ui.DesktopMaxWidthContainer |
| 13 | import com.vayunmathur.library.ui.MaterialTheme |
| 14 | import com.vayunmathur.library.ui.Text |
| 15 | import 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 |
| 19 | fun 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 | } |