Jetpack Compose 1.0.3 and related dependency updates

This commit is contained in:
John O'Reilly 2021-10-01 17:02:29 +01:00
parent bcb34d83d6
commit bb2d85b227
2 changed files with 28 additions and 27 deletions

View file

@ -7,14 +7,14 @@ object Versions {
const val kotlinCoroutines = "1.5.2-native-mt"
const val koin = "3.1.2"
const val ktor = "1.6.3"
const val ktor = "1.6.4"
const val kotlinxSerialization = "1.2.2"
const val kotlinxHtmlJs = "0.7.3"
const val compose = "1.1.0-alpha04"
const val wearCompose = "1.0.0-alpha06"
const val navCompose = "2.4.0-alpha09"
const val accompanist = "0.18.0"
const val compose = "1.0.3"
const val wearCompose = "1.0.0-alpha07"
const val navCompose = "2.4.0-alpha10"
const val accompanist = "0.19.0"
const val junit = "4.12"
const val androidXTestJUnit = "1.1.3"
@ -27,8 +27,8 @@ object Versions {
const val kotlinterGradle = "3.4.5"
const val material = "1.4.0"
const val activityCompose = "1.3.1"
const val lifecycleKtx = "2.4.0-alpha03"
const val activityCompose = "1.4.0-beta01"
const val lifecycleKtx = "2.4.0-rc01"
const val lifecycleRuntimeKtx = lifecycleKtx
const val lifecycleViewmodelKtx = lifecycleKtx
const val osmdroidAndroid = "6.1.10"

View file

@ -1,4 +1,3 @@
import androidx.compose.desktop.Window
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
@ -6,9 +5,7 @@ import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Scaffold
import androidx.compose.material.Text
import androidx.compose.material.TopAppBar
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@ -18,6 +15,9 @@ import androidx.compose.ui.graphics.asImageBitmap
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import androidx.compose.ui.window.rememberWindowState
import com.surrus.common.di.initKoin
import com.surrus.common.remote.Assignment
import com.surrus.common.remote.PeopleInSpaceApi
@ -33,7 +33,9 @@ import javax.imageio.ImageIO
private val koin = initKoin(enableNetworkLogs = true).koin
fun main() = Window {
fun main() = application {
val windowState = rememberWindowState()
var peopleState by remember { mutableStateOf(emptyList<Assignment>()) }
var selectedPerson by remember { mutableStateOf<Assignment?>(null) }
@ -44,30 +46,29 @@ fun main() = Window {
selectedPerson = peopleState.first()
}
MaterialTheme {
Scaffold(
topBar = {
TopAppBar(title = { Text("People In Space") })
}
) {
Window(
onCloseRequest = ::exitApplication,
state = windowState,
title = "People In Space"
) {
Row(Modifier.fillMaxSize()) {
Row(Modifier.fillMaxSize()) {
Box(Modifier.width(250.dp).fillMaxHeight().background(color = Color.LightGray)) {
PersonList(peopleState, selectedPerson) {
selectedPerson = it
}
Box(Modifier.width(250.dp).fillMaxHeight().background(color = Color.LightGray)) {
PersonList(peopleState, selectedPerson) {
selectedPerson = it
}
}
Spacer(modifier = Modifier.width(1.dp).fillMaxHeight())
Spacer(modifier = Modifier.width(1.dp).fillMaxHeight())
Box(Modifier.fillMaxHeight()) {
selectedPerson?.let {
PersonDetailsView(it)
}
Box(Modifier.fillMaxHeight()) {
selectedPerson?.let {
PersonDetailsView(it)
}
}
}
}
}