Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 51 additions & 79 deletions app/src/main/java/com/example/kuit7/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,106 +3,78 @@ package com.example.kuit7
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.kuit7.ui.theme.KUIT7week1Theme

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
KUIT7week1Theme {
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
Box(Modifier.padding(innerPadding)) {
Row {
Column(
Modifier
.padding(top = 30.dp, start = 70.dp),
verticalArrangement = Arrangement.spacedBy(20.dp)
) {
Box(
Modifier
.size(60.dp)
.background(Color.Black, shape = RoundedCornerShape(20.dp))
Box(
modifier = Modifier
.fillMaxSize()
.padding(innerPadding),
contentAlignment = Alignment.Center
) {
Column(
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

피그마처럼 테두리, 배경 색 적용해 주세요~

modifier = Modifier
.background(
Color(0xFFE0E0E0),
shape = RoundedCornerShape(16.dp)
)
Box(
Modifier
.size(60.dp)
.border(
width = 2.dp,
color = Color.Black,
shape = RoundedCornerShape(20.dp)
)
)
Box(
Modifier
.size(76.dp)
.border(width = 1.dp, color = Color.Black)
.padding(8.dp)
.background(Color.Red)
)
Image(
painter = painterResource(R.drawable.image),
contentDescription = "강아지 이미지",
modifier = Modifier.size(80.dp)
)
}
Column(
Modifier
.padding(top = 30.dp, start = 60.dp),
verticalArrangement = Arrangement.spacedBy(20.dp)
) {
Box(
Modifier
.size(60.dp)
.background(Color.Black, shape = CircleShape)
)
Box(
Modifier
.size(60.dp)
.border(
width = 2.dp,
color = Color.Black,
shape = CircleShape
)
)
Box(
Modifier
.size(76.dp)
.border(width = 1.dp, color = Color.Black)
.padding(8.dp)
.background(Color.Blue, CircleShape)
)
Image(
painter = painterResource(R.drawable.image),
contentDescription = "강아지 이미지",
modifier = Modifier.size(80.dp)
.clip(CircleShape)
)
}
.padding(24.dp),
horizontalAlignment = Alignment.CenterHorizontally
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Row/Column의 Alignment는 배치 방향의 수직 방향의 정렬을 맞춥니다 피그마 디자인에서 중앙 정렬을 요구하지 않았으니 빼면 됩니다!

) {
Image(
painter = painterResource(id = R.drawable.image),
contentDescription = "프로필 이미지",
modifier = Modifier
.size(100.dp)
.clip(RoundedCornerShape(16.dp))
)
Spacer(modifier = Modifier.height(16.dp))
Text(
text = "이름 : 류성민",
fontSize = 16.sp,
fontWeight = FontWeight.Bold
)
Spacer(modifier = Modifier.height(8.dp))
Text(
text = "학번 : 202410160",
fontSize = 16.sp,
fontWeight = FontWeight.Bold
)
Spacer(modifier = Modifier.height(8.dp))
Text(
text = "학과 : 철학과",
fontSize = 16.sp,
fontWeight = FontWeight.Bold
)
Spacer(modifier = Modifier.height(8.dp))
Text(
text = "생년월일 : 2001/03/21",
fontSize = 16.sp,
fontWeight = FontWeight.Bold
)
}

}
}
}
}
}
}
}
Binary file added app/src/main/res/drawable/image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.