Nikolay Igotti
3 years ago
4 changed files with 34 additions and 15 deletions
@ -1,23 +1,27 @@ |
|||||||
|
import androidx.compose.desktop.ui.tooling.preview.Preview |
||||||
import androidx.compose.material.Text |
import androidx.compose.material.Text |
||||||
import androidx.compose.material.Button |
import androidx.compose.material.Button |
||||||
import androidx.compose.material.MaterialTheme |
import androidx.compose.material.MaterialTheme |
||||||
import androidx.compose.runtime.getValue |
import androidx.compose.runtime.* |
||||||
import androidx.compose.runtime.mutableStateOf |
|
||||||
import androidx.compose.runtime.remember |
|
||||||
import androidx.compose.runtime.setValue |
|
||||||
import androidx.compose.ui.window.Window |
import androidx.compose.ui.window.Window |
||||||
import androidx.compose.ui.window.application |
import androidx.compose.ui.window.application |
||||||
|
|
||||||
fun main() = application { |
@Composable |
||||||
Window(onCloseRequest = ::exitApplication) { |
@Preview |
||||||
var text by remember { mutableStateOf("Hello, World!") } |
fun Screen() { |
||||||
|
var text by remember { mutableStateOf("Hello, World!") } |
||||||
|
|
||||||
MaterialTheme { |
MaterialTheme { |
||||||
Button(onClick = { |
Button(onClick = { |
||||||
text = "Hello, Desktop!" |
text = "Hello, Desktop!" |
||||||
}) { |
}) { |
||||||
Text(text) |
Text(text) |
||||||
} |
|
||||||
} |
} |
||||||
} |
} |
||||||
} |
} |
||||||
|
|
||||||
|
fun main() = application { |
||||||
|
Window(onCloseRequest = ::exitApplication) { |
||||||
|
Screen() |
||||||
|
} |
||||||
|
} |
||||||
|
@ -1 +1,10 @@ |
|||||||
actual fun getPlatformName(): String = "Desktop" |
import androidx.compose.runtime.Composable |
||||||
|
import androidx.compose.desktop.ui.tooling.preview.Preview |
||||||
|
|
||||||
|
actual fun getPlatformName(): String = "Desktop" |
||||||
|
|
||||||
|
@Preview |
||||||
|
@Composable |
||||||
|
fun AppPreview() { |
||||||
|
App() |
||||||
|
} |
Loading…
Reference in new issue