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
113 changes: 49 additions & 64 deletions app/src/main/java/com/example/kuit7/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.example.kuit7

import android.R.attr.top
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
Expand All @@ -11,98 +12,82 @@ 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.fillMaxHeight
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.shape.RoundedCornerShape
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.layout
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.PlatformTextStyle
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.example.kuit7.ui.theme.KUIT7week1Theme

class MainActivity : ComponentActivity() {
val myTextStyle = TextStyle(
fontSize = 8.sp,
lineHeight = 10.sp,
platformStyle = PlatformTextStyle(
includeFontPadding = false
)
)

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
.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(
Column(
Modifier
.padding(top = 30.dp, start = 70.dp),
) {
Box(
Modifier
.padding(top = 30.dp, start = 60.dp),
verticalArrangement = Arrangement.spacedBy(20.dp)
.size(140.dp)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

말씀드린 대로 사이즈 하드 코딩하지 말고 자연스럽게 감싸 주시면 됩니다. 그리고 이 박스가 border 그리는 용도로만 사용되고 있어서 컬럼을 감싸지 말고 컬럼에다가 바로 border 스타일을 적용해 주면 좋습니다!

.border(
width = 1.dp,
color = Color.Black,
shape = RoundedCornerShape(10.dp)
)
) {
Box(
Modifier
.size(60.dp)
.background(Color.Black, shape = CircleShape)
)
Box(
Column(
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(top = 9.dp, start = 9.dp),
) {
Image(
painter = painterResource(R.drawable.image2),
contentDescription = "감자 이미지",
modifier = Modifier
.size(40.dp)
.clip(RoundedCornerShape(10.dp))
)
Column(
Modifier
.fillMaxHeight()
.padding(bottom = 9.dp),
verticalArrangement = Arrangement.SpaceEvenly
) {
Text("이름: 박민우", style = myTextStyle)
Text("학번: 202415187", style = myTextStyle)
Text("학과: 컴퓨터공학부", style = myTextStyle)
Text("생년월일: 2001/12/13", style = myTextStyle)
}
}
}
}

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