mirror of
https://github.com/jlengrand/compose-multiplatform.git
synced 2026-03-10 08:11:20 +00:00
Merge pull request #88 from JetBrains/todo_fix
Regression in Todo example app after multiple Compose updates
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package example.todo.common.edit.ui
|
||||
|
||||
import androidx.compose.foundation.Icon
|
||||
import androidx.compose.foundation.Text
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
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.material.Checkbox
|
||||
import androidx.compose.material.IconButton
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material.TextField
|
||||
import androidx.compose.material.TopAppBar
|
||||
import androidx.compose.material.icons.Icons
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package example.todo.common.main.ui
|
||||
|
||||
import androidx.compose.foundation.Text
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
@@ -17,6 +16,7 @@ import androidx.compose.material.Divider
|
||||
import androidx.compose.material.Icon
|
||||
import androidx.compose.material.IconButton
|
||||
import androidx.compose.material.OutlinedTextField
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.material.TopAppBar
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Delete
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package example.todo.desktop
|
||||
|
||||
import androidx.compose.desktop.AppWindow
|
||||
import androidx.compose.desktop.DesktopTheme
|
||||
import androidx.compose.desktop.Window
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
@@ -24,17 +23,19 @@ fun main() {
|
||||
val lifecycle = LifecycleRegistry()
|
||||
lifecycle.resume()
|
||||
|
||||
val todoRoot = TodoRoot(
|
||||
componentContext = DefaultComponentContext(lifecycle),
|
||||
dependencies = object : TodoRoot.Dependencies {
|
||||
override val storeFactory = DefaultStoreFactory
|
||||
override val database = TodoDatabase(TodoDatabaseDriver())
|
||||
}
|
||||
)
|
||||
|
||||
Window("Todo") {
|
||||
Surface(modifier = Modifier.fillMaxSize()) {
|
||||
MaterialTheme {
|
||||
DesktopTheme {
|
||||
TodoRoot(
|
||||
componentContext = DefaultComponentContext(lifecycle),
|
||||
dependencies = object : TodoRoot.Dependencies {
|
||||
override val storeFactory = DefaultStoreFactory
|
||||
override val database = TodoDatabase(TodoDatabaseDriver())
|
||||
}
|
||||
).invoke()
|
||||
todoRoot()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user