Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
4.3 kB
3
Indexable
Never
package com.example.my_first_application

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxScopeInstance.align
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.AccountCircle
import androidx.compose.material.icons.filled.AddCircle
import androidx.compose.material.icons.filled.Create
import androidx.compose.material.icons.filled.Settings
import androidx.compose.material3.Button
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.alpha
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.example.my_first_application.ui.theme.My_First_ApplicationTheme

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            My_First_ApplicationTheme {
                // A surface container using the 'background' color from the theme
                Surface(
                    modifier = Modifier.fillMaxSize(),
                    color = MaterialTheme.colorScheme.background
                ) {
                    Box (
                        modifier = Modifier
                            .fillMaxSize()
                    ){
                        Image(
                            painterResource(id = R.drawable.acer_wallpaper_01_3840x2400),
                            contentDescription = "",
                            modifier = Modifier
                                .fillMaxSize()
                                .alpha(0.5f),
                            contentScale = ContentScale.Crop
                        )
                    }
                    Column(
                        modifier = Modifier
                            .fillMaxWidth()
                            .background(Color.Red)
                            
                        //horizontalAlignment = Allignment.CenterHorizontally
                    ) {
                        Icon(
                            imageVector = Icons.Filled.AccountCircle,
                            contentDescription = "Icon Akun",
                            modifier = Modifier.size(150.dp)
                        )
                        Text(
                            text = "WILSON"
                            //fontSize
                        )
                        Row {
                            Icon(
                                imageVector = Icons.Filled.Create,
                                contentDescription = "Icon Akun",
                                modifier = Modifier.size(150.dp)
                            )
                            Icon(
                                imageVector = Icons.Filled.AddCircle,
                                contentDescription = "Icon Akun",
                                modifier = Modifier.size(150.dp)
                            )
                            Icon(
                                imageVector = Icons.Filled.Settings,
                                contentDescription = "Icon Akun",
                                modifier = Modifier.size(150.dp)
                            )
                        }
                    }
                }//
            }
        }
    }
}