Initial commit

This commit is contained in:
2025-09-26 13:49:11 -03:00
parent c6f1764a9d
commit a67ea33a9c
22 changed files with 27 additions and 82 deletions

View File

@@ -0,0 +1,48 @@
package dev.carlosmartino.template
import androidx.compose.animation.AnimatedVisibility
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.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import dev.carlosmartino.features.common.CommonGreetings
import org.jetbrains.compose.ui.tooling.preview.Preview
@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 { CommonGreetings().greet() }
Column(
modifier = Modifier.fillMaxWidth(),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Text("Compose: $greeting")
}
}
}
}
}

View File

@@ -0,0 +1,7 @@
package dev.carlosmartino.template
class Greeting {
private val platform = getPlatform()
fun greet(): String = "Hello, ${platform.name}!"
}

View File

@@ -0,0 +1,7 @@
package dev.carlosmartino.template
interface Platform {
val name: String
}
expect fun getPlatform(): Platform