Browse Source

Regression in Todo example app after multiple Compose updates

Closes https://github.com/JetBrains/compose-jb/issues/86
pull/88/head
Igor Demin 4 years ago
parent
commit
86a5977c9b
  1. 2
      examples/todoapp/common/edit/src/commonMain/kotlin/example/todo/common/edit/ui/TodoEditUi.kt
  2. 2
      examples/todoapp/common/main/src/commonMain/kotlin/example/todo/common/main/ui/TodoMainUi.kt
  3. 15
      examples/todoapp/desktop/src/jvmMain/kotlin/example/todo/desktop/Main.kt

2
examples/todoapp/common/edit/src/commonMain/kotlin/example/todo/common/edit/ui/TodoEditUi.kt

@ -1,7 +1,6 @@
package example.todo.common.edit.ui package example.todo.common.edit.ui
import androidx.compose.foundation.Icon import androidx.compose.foundation.Icon
import androidx.compose.foundation.Text
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
@ -10,6 +9,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.width
import androidx.compose.material.Checkbox import androidx.compose.material.Checkbox
import androidx.compose.material.IconButton import androidx.compose.material.IconButton
import androidx.compose.material.Text
import androidx.compose.material.TextField import androidx.compose.material.TextField
import androidx.compose.material.TopAppBar import androidx.compose.material.TopAppBar
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons

2
examples/todoapp/common/main/src/commonMain/kotlin/example/todo/common/main/ui/TodoMainUi.kt

@ -1,6 +1,5 @@
package example.todo.common.main.ui package example.todo.common.main.ui
import androidx.compose.foundation.Text
import androidx.compose.foundation.clickable import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
@ -17,6 +16,7 @@ import androidx.compose.material.Divider
import androidx.compose.material.Icon import androidx.compose.material.Icon
import androidx.compose.material.IconButton import androidx.compose.material.IconButton
import androidx.compose.material.OutlinedTextField import androidx.compose.material.OutlinedTextField
import androidx.compose.material.Text
import androidx.compose.material.TopAppBar import androidx.compose.material.TopAppBar
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Delete import androidx.compose.material.icons.filled.Delete

15
examples/todoapp/desktop/src/jvmMain/kotlin/example/todo/desktop/Main.kt

@ -1,6 +1,5 @@
package example.todo.desktop package example.todo.desktop
import androidx.compose.desktop.AppWindow
import androidx.compose.desktop.DesktopTheme import androidx.compose.desktop.DesktopTheme
import androidx.compose.desktop.Window import androidx.compose.desktop.Window
import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxSize
@ -24,17 +23,19 @@ fun main() {
val lifecycle = LifecycleRegistry() val lifecycle = LifecycleRegistry()
lifecycle.resume() lifecycle.resume()
Window("Todo") { val todoRoot = TodoRoot(
Surface(modifier = Modifier.fillMaxSize()) {
MaterialTheme {
DesktopTheme {
TodoRoot(
componentContext = DefaultComponentContext(lifecycle), componentContext = DefaultComponentContext(lifecycle),
dependencies = object : TodoRoot.Dependencies { dependencies = object : TodoRoot.Dependencies {
override val storeFactory = DefaultStoreFactory override val storeFactory = DefaultStoreFactory
override val database = TodoDatabase(TodoDatabaseDriver()) override val database = TodoDatabase(TodoDatabaseDriver())
} }
).invoke() )
Window("Todo") {
Surface(modifier = Modifier.fillMaxSize()) {
MaterialTheme {
DesktopTheme {
todoRoot.invoke()
} }
} }
} }

Loading…
Cancel
Save