Upload files to "/"
Signed-off-by: 202310715083 RAKHA ADI SAPUTRO <202310715083@mhs.ubharajaya.ac.id>
This commit is contained in:
		
						commit
						9bbb4320aa
					
				
							
								
								
									
										52
									
								
								MainActivity.kt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								MainActivity.kt
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,52 @@
 | 
			
		||||
package com.example.greetingcard
 | 
			
		||||
 | 
			
		||||
import android.os.Bundle
 | 
			
		||||
import androidx.activity.ComponentActivity
 | 
			
		||||
import androidx.activity.compose.setContent
 | 
			
		||||
import androidx.activity.enableEdgeToEdge
 | 
			
		||||
import androidx.compose.foundation.layout.fillMaxSize
 | 
			
		||||
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.graphics.Color
 | 
			
		||||
import androidx.compose.ui.tooling.preview.Preview
 | 
			
		||||
import androidx.compose.ui.unit.dp
 | 
			
		||||
import com.example.greetingcard.ui.theme.GreetingCardTheme
 | 
			
		||||
 | 
			
		||||
class MainActivity : ComponentActivity() {
 | 
			
		||||
    override fun onCreate(savedInstanceState: Bundle?) {
 | 
			
		||||
        super.onCreate(savedInstanceState)
 | 
			
		||||
        enableEdgeToEdge()
 | 
			
		||||
        setContent {
 | 
			
		||||
            GreetingCardTheme {
 | 
			
		||||
                Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
 | 
			
		||||
                    Greeting(
 | 
			
		||||
                        name = "Android",
 | 
			
		||||
                        modifier = Modifier.padding(innerPadding)
 | 
			
		||||
                    )
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@Composable
 | 
			
		||||
fun Greeting(name: String, modifier: Modifier = Modifier) {
 | 
			
		||||
    Surface(color = Color.Magenta) {
 | 
			
		||||
        Text(
 | 
			
		||||
            text = "Hello My Name is $name!",
 | 
			
		||||
            modifier = modifier.padding(24.dp)
 | 
			
		||||
        )
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@Preview(showBackground = true)
 | 
			
		||||
@Composable
 | 
			
		||||
fun GreetingPreview() {
 | 
			
		||||
    GreetingCardTheme {
 | 
			
		||||
        Greeting("Rakha")
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user