Init
This commit is contained in:
commit
ac88e62abe
17 changed files with 716 additions and 0 deletions
49
composeApp/src/jvmMain/kotlin/com/rukira/wowbackup/App.kt
Normal file
49
composeApp/src/jvmMain/kotlin/com/rukira/wowbackup/App.kt
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
package com.rukira.wowbackup
|
||||
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.safeContentPadding
|
||||
import androidx.compose.material3.Button
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import org.jetbrains.compose.resources.painterResource
|
||||
import org.jetbrains.compose.ui.tooling.preview.Preview
|
||||
|
||||
import myapplication.composeapp.generated.resources.Res
|
||||
import myapplication.composeapp.generated.resources.compose_multiplatform
|
||||
|
||||
@Composable
|
||||
@Preview
|
||||
fun App() {
|
||||
MaterialTheme {
|
||||
var showContent by remember { mutableStateOf(false) }
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.background(MaterialTheme.colorScheme.primaryContainer)
|
||||
.safeContentPadding()
|
||||
.fillMaxSize(),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
) {
|
||||
Button(onClick = { showContent = !showContent }) {
|
||||
Text("Click me!")
|
||||
}
|
||||
AnimatedVisibility(showContent) {
|
||||
val greeting = remember { Greeting().greet() }
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
) {
|
||||
Image(painterResource(Res.drawable.compose_multiplatform), null)
|
||||
Text("Compose: $greeting")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package com.rukira.wowbackup
|
||||
|
||||
class Greeting {
|
||||
private val platform = getPlatform()
|
||||
|
||||
fun greet(): String {
|
||||
return "Hello, ${platform.name}!"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.rukira.wowbackup
|
||||
|
||||
class JVMPlatform {
|
||||
val name: String = "Java ${System.getProperty("java.version")}"
|
||||
}
|
||||
|
||||
fun getPlatform() = JVMPlatform()
|
||||
13
composeApp/src/jvmMain/kotlin/com/rukira/wowbackup/main.kt
Normal file
13
composeApp/src/jvmMain/kotlin/com/rukira/wowbackup/main.kt
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package com.rukira.wowbackup
|
||||
|
||||
import androidx.compose.ui.window.Window
|
||||
import androidx.compose.ui.window.application
|
||||
|
||||
fun main() = application {
|
||||
Window(
|
||||
onCloseRequest = ::exitApplication,
|
||||
title = "MyApplication",
|
||||
) {
|
||||
App()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue