initial commit - source
This commit is contained in:
1 parent
003b5501f0
commit
e89bb29070
45 files changed
+5997
No files matched your search
@@ -0,0 +1,3 @@
|
||||
package net.keinekekse.app
|
||||
|
||||
const val SERVER_PORT = 7770
|
||||
@@ -0,0 +1,9 @@
|
||||
package net.keinekekse.app
|
||||
|
||||
class Greeting {
|
||||
private val platform = getPlatform()
|
||||
|
||||
fun greet(): String {
|
||||
return "Hello, ${platform.name}!"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package net.keinekekse.app
|
||||
|
||||
interface Platform {
|
||||
val name: String
|
||||
}
|
||||
|
||||
expect fun getPlatform(): Platform
|
||||
@@ -0,0 +1,31 @@
|
||||
package net.keinekekse.app.ui
|
||||
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.material3.CircularProgressIndicator
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.drawBehind
|
||||
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Composable
|
||||
fun ProgressIndicator(animationSize: Int = 48, paddingTop: Int = 16, strokeWidth: Int = 5) {
|
||||
val primaryColor = MaterialTheme.colorScheme.primary
|
||||
val backgroundColor = MaterialTheme.colorScheme.background
|
||||
val strokewidth = strokeWidth.dp
|
||||
CircularProgressIndicator(
|
||||
modifier =
|
||||
Modifier.padding(top = paddingTop.dp).size(animationSize.dp).drawBehind {
|
||||
drawCircle(
|
||||
primaryColor,
|
||||
radius = size.width / 2 - strokewidth.toPx() / 2,
|
||||
style = Stroke(strokewidth.toPx()),
|
||||
|
||||
)
|
||||
},
|
||||
color = backgroundColor,
|
||||
strokeWidth = strokewidth
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package net.keinekekse.app
|
||||
|
||||
class JVMPlatform : Platform {
|
||||
override val name: String = "Java ${System.getProperty("java.version")}"
|
||||
}
|
||||
|
||||
actual fun getPlatform(): Platform = JVMPlatform()
|
||||
@@ -0,0 +1,7 @@
|
||||
package net.keinekekse.app
|
||||
|
||||
class MacOsPlatform : Platform {
|
||||
override val name: String = "macOS"
|
||||
}
|
||||
|
||||
actual fun getPlatform(): Platform = MacOsPlatform()
|
||||
@@ -0,0 +1,7 @@
|
||||
package net.keinekekse.app
|
||||
|
||||
class WasmPlatform : Platform {
|
||||
override val name: String = "Web with Kotlin/Wasm"
|
||||
}
|
||||
|
||||
actual fun getPlatform(): Platform = WasmPlatform()
|
||||
Reference in new issue
Block a user