Upload files to "/"
This commit is contained in:
commit
97885f15f5
51
MainActivity.kt
Normal file
51
MainActivity.kt
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
package com.example.greetingcard
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.activity.ComponentActivity
|
||||||
|
import androidx.activity.compose.setContent
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.Surface
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
|
import com.example.greetingcard.ui.theme.GreetingCardTheme
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
|
||||||
|
class MainActivity : ComponentActivity() {
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
setContent {
|
||||||
|
GreetingCardTheme {
|
||||||
|
Surface(
|
||||||
|
modifier = Modifier.fillMaxSize(),
|
||||||
|
color = MaterialTheme.colorScheme.background
|
||||||
|
) {
|
||||||
|
Greeting("Markco Van Nistelrooy Sitanggang")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun Greeting(name: String, modifier: Modifier = Modifier) {
|
||||||
|
Surface(color = Color.Cyan) {
|
||||||
|
Text(
|
||||||
|
text = "Hi, my name is $name!",
|
||||||
|
modifier = modifier.padding(24.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Preview(showBackground = true)
|
||||||
|
@Composable
|
||||||
|
fun GreetingPreview() {
|
||||||
|
GreetingCardTheme {
|
||||||
|
Greeting("Markco")
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
tugas 2 android.png
Normal file
BIN
tugas 2 android.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 219 KiB |
Loading…
x
Reference in New Issue
Block a user