Create hello-platform for Android (#12)
Co-authored-by: Михаил Капелько <kornerr@gmail.com>
This commit is contained in:
1 parent
cf79e89dc4
commit
45ca185094
45 files changed
+985
-25
No files matched your search
@@ -0,0 +1,14 @@
|
||||
package org.opengamestudio
|
||||
|
||||
object HPComponent {
|
||||
val ctrl = DialectController(HPContext())
|
||||
|
||||
init {
|
||||
hpRegisterEffects(ctrl)
|
||||
hpRegisterShoulds(ctrl)
|
||||
}
|
||||
|
||||
fun setup() {
|
||||
hpSet(F.didSetup, true)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package org.opengamestudio
|
||||
|
||||
import androidx.compose.runtime.*
|
||||
|
||||
object HPVM {
|
||||
var countText by mutableStateOf("")
|
||||
|
||||
var shared: HPVM? = this
|
||||
private set
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package org.opengamestudio
|
||||
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material3.*
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.*
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
||||
@Composable
|
||||
fun HPView() {
|
||||
Column(
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
modifier = Modifier.padding(40.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(16.dp)
|
||||
) {
|
||||
Text(
|
||||
style = MaterialTheme.typography.headlineLarge,
|
||||
text = "Hello, platform!"
|
||||
)
|
||||
|
||||
Text(
|
||||
fontFamily = FontFamily.Monospace,
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
text = HPVM.countText
|
||||
)
|
||||
|
||||
Button(
|
||||
onClick = { hpSet(F.didClickIncrement, true) }
|
||||
) {
|
||||
Text("Increment")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user