Browse Source

Update README.md

pull/1037/head
Igor Demin 3 years ago committed by GitHub
parent
commit
3bc811f559
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      tutorials/Window_API_new/README.md

4
tutorials/Window_API_new/README.md

@ -440,10 +440,10 @@ import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogState
import androidx.compose.ui.window.Window import androidx.compose.ui.window.Window
import androidx.compose.ui.window.WindowPosition import androidx.compose.ui.window.WindowPosition
import androidx.compose.ui.window.application import androidx.compose.ui.window.application
import androidx.compose.ui.window.rememberDialogState
fun main() = application { fun main() = application {
Window( Window(
@ -458,7 +458,7 @@ fun main() = application {
if (isDialogOpen) { if (isDialogOpen) {
Dialog( Dialog(
onCloseRequest = { isDialogOpen = false }, onCloseRequest = { isDialogOpen = false },
state = DialogState(position = WindowPosition(Alignment.Center)) state = rememberDialogState(position = WindowPosition(Alignment.Center))
) { ) {
// Dialog's content // Dialog's content
} }

Loading…
Cancel
Save