diff --git a/tutorials/Window_API_new/README.md b/tutorials/Window_API_new/README.md index 7f54d8ccb5..1e0200d6fe 100644 --- a/tutorials/Window_API_new/README.md +++ b/tutorials/Window_API_new/README.md @@ -122,20 +122,6 @@ fun main() = application { ``` ![](ask_to_close.gif) - -There is a simplified function for creating a single window application: -``` -import androidx.compose.ui.window.singleWindowApplication - -fun main() = singleWindowApplication { - // Content -} -``` -Use it if: -- your application has only one window -- you don't need custom closing logic -- you don't need to change the window parameters after it is already created - If you don't need to close the window and just need to hide it (for example to the tray), you can change the `windowState.isVisible` state: ```kotlin import androidx.compose.material.Text @@ -262,6 +248,20 @@ private class MyWindowState( ``` ![](multiple_windows.gif) +## Function `singleWindowApplication` +There is a simplified function for creating a single window application: +``` +import androidx.compose.ui.window.singleWindowApplication + +fun main() = singleWindowApplication { + // Content +} +``` +Use it if: +- your application has only one window +- you don't need custom closing logic +- you don't need to change the window parameters after it is already created + ## Changing the state (maximized, minimized, fullscreen, size, position) of the window. Some states of the native window are moved into a separate API class, `WindowState`. You can change its properties in callbacks or observe it in Composable's. @@ -539,4 +539,4 @@ fun main() = singleWindowApplication( } } ``` -![](draggable_area.gif) \ No newline at end of file +![](draggable_area.gif)