Update tutorials

This commit is contained in:
Igor Demin
2021-06-02 18:27:57 +03:00
committed by GitHub
parent b051250388
commit 69dbc82ec8

View File

@@ -336,17 +336,18 @@ fun main() = application {
val state = rememberWindowState()
Window(state) {
}
// Content
LaunchedEffect(state) {
snapshotFlow { state.size }
.onEach(::onWindowResize)
.launchIn(this)
LaunchedEffect(state) {
snapshotFlow { state.size }
.onEach(::onWindowResize)
.launchIn(this)
snapshotFlow { state.position }
.filterNot { it.isInitial }
.onEach(::onWindowRelocate)
.launchIn(this)
snapshotFlow { state.position }
.filterNot { it.isInitial }
.onEach(::onWindowRelocate)
.launchIn(this)
}
}
}
@@ -357,7 +358,6 @@ private fun onWindowResize(size: WindowSize) {
private fun onWindowRelocate(position: WindowPosition) {
println("onWindowRelocate $position")
}
```
## Handle window-level shortcuts