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
4 changes: 4 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.KUIT7week1">
<activity
android:name=".missionActivity"
android:exported="true" />

<activity
android:name=".MainActivity"
android:exported="true"
Expand Down
9 changes: 9 additions & 0 deletions app/src/main/java/com/example/kuit7/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
Expand Down Expand Up @@ -97,6 +98,14 @@ class MainActivity : ComponentActivity() {
modifier = Modifier.size(80.dp)
.clip(CircleShape)
)

Box(
modifier = Modifier
.size(100.dp)
.padding(16.dp)
.background(Color.Red)
.clickable { println("Box clicked!") }
)
}
}

Expand Down
63 changes: 63 additions & 0 deletions app/src/main/java/com/example/kuit7/missionActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
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.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
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.res.painterResource
import androidx.compose.ui.unit.dp
import com.example.kuit7.ui.theme.KUIT7week1Theme
class missionActivity :ComponentActivity(){
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

액티비티 자체를 다시 만들 필요 없이 Scaffold 내부에 구현하신 부분을 실습했던 것처럼 MainActivity에 넣는 등의 방식으로 수행해 주심 됩니다~

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
KUIT7week1Theme {
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
Box(
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.padding(innerPadding)
.padding(50.dp)
Copy link
Copy Markdown

@1hyok 1hyok Mar 21, 2026

Choose a reason for hiding this comment

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

박스 내부 컴포넌트의 배치는 패딩의 여백으로 밀어서 하기보다는 contentAlignment 파라미터를 활용해 보시기 바랍니다!

.border(
width = 2.dp,
color = Color.Black,
shape = RoundedCornerShape(size = 20.dp)
)
) {
Column(
Modifier.padding(50.dp),
verticalArrangement = Arrangement.spacedBy(20.dp)
) {
Image(
painter = painterResource(id = R.drawable.pfimg),
contentDescription = "프로필 이미지",
modifier = Modifier.size(60.dp)
.clip(RoundedCornerShape(15.dp))
)
Text("이름 : 이강준")
Text("학번 : 202312363")
Text("학과 : 컴퓨터공학부")
Text("생년월일 : 2003/11/06")

//ctrl alt l ,alt shift o
}

}

}
}
}
}
}
Binary file added app/src/main/res/drawable/pfimg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,5 +102,6 @@ Contribute 버튼을 눌러서 Open pull request 를 누릅니다.
> 기타 문의사항이나 질문사항, 그 외 하고싶은 말씀이 있다면 작성해주세요!

다 채우셨다면 하단에 Create pull request 를 눌러 완성하시면 됩니다 !
커밋용 수정 문구

<img src="https://github.com/user-attachments/assets/c23e33f7-ef43-4fc2-8cd0-35b2cc601111" width="600"/>