Upload files to "/"
This commit is contained in:
parent
adfab0b14c
commit
66a89a0eef
70
MainActivity.kt
Normal file
70
MainActivity.kt
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
/*
|
||||||
|
Nama: Rafi Fattan Fitriardi
|
||||||
|
NPM : 202310715002
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.example.helloworld
|
||||||
|
|
||||||
|
import android.os.Bundle
|
||||||
|
import androidx.activity.ComponentActivity
|
||||||
|
import androidx.activity.compose.setContent
|
||||||
|
import androidx.activity.enableEdgeToEdge
|
||||||
|
import androidx.compose.foundation.layout.Box
|
||||||
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.material3.Scaffold
|
||||||
|
import androidx.compose.material3.Surface
|
||||||
|
import androidx.compose.material3.Text
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
|
import com.example.helloworld.ui.theme.HelloWorldTheme
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
|
import androidx.compose.ui.unit.dp
|
||||||
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
|
|
||||||
|
class MainActivity : ComponentActivity() {
|
||||||
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
|
super.onCreate(savedInstanceState)
|
||||||
|
enableEdgeToEdge()
|
||||||
|
setContent {
|
||||||
|
HelloWorldTheme {
|
||||||
|
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
|
||||||
|
Greeting(
|
||||||
|
name = "Android",
|
||||||
|
modifier = Modifier.padding(innerPadding)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
fun Greeting(name: String, modifier: Modifier = Modifier) {
|
||||||
|
Surface(color = Color.Green) {
|
||||||
|
androidx.compose.foundation.layout.Column(
|
||||||
|
modifier = modifier.padding(24.dp)
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = "Hello, $name!",
|
||||||
|
textAlign = TextAlign.Justify
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
text = "Mobile Programming 25/26.",
|
||||||
|
textAlign = TextAlign.Justify
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Preview(showBackground = true)
|
||||||
|
@Composable
|
||||||
|
fun GreetingPreview() {
|
||||||
|
HelloWorldTheme {
|
||||||
|
Greeting("Rafi Fattan")
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
Tugas 1.PNG
Normal file
BIN
Tugas 1.PNG
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.4 KiB |
Loading…
x
Reference in New Issue
Block a user