|
|
|
@ -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 |
|
|
|
@ -8,9 +7,7 @@ import androidx.compose.material.MaterialTheme
|
|
|
|
|
import androidx.compose.material.Surface |
|
|
|
|
import androidx.compose.ui.Modifier |
|
|
|
|
import com.arkivanov.decompose.ComponentContext |
|
|
|
|
import com.arkivanov.decompose.extensions.compose.jetbrains.rootComponent |
|
|
|
|
import com.arkivanov.decompose.lifecycle.LifecycleRegistry |
|
|
|
|
import com.arkivanov.decompose.lifecycle.resume |
|
|
|
|
import com.arkivanov.decompose.extensions.compose.jetbrains.rememberRootComponent |
|
|
|
|
import com.arkivanov.mvikotlin.main.store.DefaultStoreFactory |
|
|
|
|
import com.badoo.reaktive.coroutinesinterop.asScheduler |
|
|
|
|
import com.badoo.reaktive.scheduler.overrideSchedulers |
|
|
|
@ -19,19 +16,15 @@ import example.todo.common.root.TodoRoot
|
|
|
|
|
import example.todo.common.ui.TodoRootContent |
|
|
|
|
import example.todo.database.TodoDatabase |
|
|
|
|
import kotlinx.coroutines.Dispatchers |
|
|
|
|
import javax.swing.SwingUtilities |
|
|
|
|
|
|
|
|
|
fun main() { |
|
|
|
|
overrideSchedulers(main = Dispatchers.Main::asScheduler) |
|
|
|
|
|
|
|
|
|
val lifecycle = LifecycleRegistry() |
|
|
|
|
lifecycle.resume() |
|
|
|
|
|
|
|
|
|
Window("Todo") { |
|
|
|
|
Surface(modifier = Modifier.fillMaxSize()) { |
|
|
|
|
MaterialTheme { |
|
|
|
|
DesktopTheme { |
|
|
|
|
TodoRootContent(rootComponent(factory = ::todoRoot)) |
|
|
|
|
TodoRootContent(rememberRootComponent(factory = ::todoRoot)) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|