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
22 changes: 22 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
- 제목:
N주차 미션 / N조 000 (확인 후 지워주세요)

## 1. 미션
각 주차에 해당하는 미션 체크리스트

-

## 2. 구현에 대한 설명
본인이 구현한 것에 대한 설명

-

## 3. 스크린샷 & 실행영상
실행영상이 있다면 실행영상을, 없다면 스크린샷 첨부

-

## 4. 기타
기타 문의사항이나 질문사항, 그 외 하고싶은 말

-
8 changes: 8 additions & 0 deletions app/src/main/java/com/example/kuit7/Call.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.example.kuit7

data class Call(
val image: Int,
val name: String,
val phone: String
) {
}
141 changes: 141 additions & 0 deletions app/src/main/java/com/example/kuit7/ContactScreen.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
package com.example.kuit7

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp

@Composable
fun ContactScreen(modifier: Modifier = Modifier) {
val callList = listOf<Call>(
Call(
image = R.drawable.call1,
name = "박서연",
phone = "010-1234-5678"
),
Call(
image = R.drawable.call2,
name = "김건국",
phone = "010-1234-5678"
),
Call(
image = R.drawable.call3,
name = "홍길동",
phone = "010-1234-5678"
),
Call(
image = R.drawable.call1,
name = "박서연",
phone = "010-1234-5678"
),
Call(
image = R.drawable.call2,
name = "김건국",
phone = "010-1234-5678"
),
Call(
image = R.drawable.call3,
name = "홍길동",
phone = "010-1234-5678"
),
Call(
image = R.drawable.call1,
name = "박서연",
phone = "010-1234-5678"
),
Call(
image = R.drawable.call2,
name = "김건국",
phone = "010-1234-5678"
),
Call(
image = R.drawable.call3,
name = "홍길동",
phone = "010-1234-5678"
),
Call(
image = R.drawable.call1,
name = "박서연",
phone = "010-1234-5678"
),
Call(
image = R.drawable.call2,
name = "김건국",
phone = "010-1234-5678"
),
Call(
image = R.drawable.call3,
name = "홍길동",
phone = "010-1234-5678"
)
)
Column(Modifier.fillMaxSize()) {

Row(
Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.Center,
) {
Text(
text = "연락처",
fontSize = 20.sp,
fontWeight = FontWeight.Bold
)
}
Spacer(modifier = Modifier.height(height = 42.dp))

LazyColumn(Modifier.fillMaxSize().padding(horizontal = 20.dp)) {
items(callList) { call ->
Column() {
Spacer(modifier.height(3.dp))
Row(
modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween
) {
Image(
painterResource(call.image),
contentDescription = null,
modifier.size(63.dp)
)

Text(
text = call.name,
fontSize = 16.sp
)
Text(
text = call.phone,
fontSize = 16.sp
)
}

Spacer(modifier.height(10.dp))
HorizontalDivider(thickness = 1.dp)
}
}
}
}
}

@Preview(showBackground = true)
@Composable
private fun ContactScreenPreview() {
ContactScreen()
}
109 changes: 24 additions & 85 deletions app/src/main/java/com/example/kuit7/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,27 +1,16 @@
package com.example.kuit7
package com.example.kuit7 //test3

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.shape.RoundedCornerShape
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
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 androidx.compose.ui.tooling.preview.Preview
import com.example.kuit7.ui.theme.KUIT7week1Theme

class MainActivity : ComponentActivity() {
Expand All @@ -31,78 +20,28 @@ class MainActivity : ComponentActivity() {
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(
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)
)
}
}

}
Greeting(
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

NewsScreen을 호출해주시면 실행 화면에서도 확인하실 수 있습니다!
예) NewsScreen(modifier = Modifier.padding(innerPadding))

name = "Android",
modifier = Modifier.padding(innerPadding)
)
}
}
}
}
}

@Composable
fun Greeting(name: String, modifier: Modifier = Modifier) {
Text(
text = "Hello $name!",
modifier = modifier
)
}

@Preview(showBackground = true)
@Composable
fun GreetingPreview() {
KUIT7week1Theme() {
Greeting("Android")
}
}
Loading