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. 기타
기타 문의사항이나 질문사항, 그 외 하고싶은 말

-
7 changes: 7 additions & 0 deletions Call.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.example.kuitweek2

data class Call(
val image: Int,
val name: String,
val phone: String
)
97 changes: 97 additions & 0 deletions ContactScreen.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
package com.example.kuitweek2

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(
image = R.drawable.image1,
name = "박서연",
phone = "010-1234-5678"
),
Call(
image = R.drawable.image2,
name = "김건국",
phone = "010-1234-5678"
),
Call(
image = R.drawable.image3,
name = "홍길동",
phone = "010-1234-5678"
)
)

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

Spacer(modifier = Modifier.height(height = 42.dp))

LazyColumn(modifier = Modifier.fillMaxSize().padding(horizontal = 20.dp)) {
items(items = callList) { call ->
Column {
Spacer(modifier = Modifier.height(height = 3.dp))

Row(modifier = Modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
Image(
painter = painterResource(id = call.image),
contentDescription = null,
modifier = Modifier.size(size = 63.dp)
)

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

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

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

@Preview(showBackground = true)
@Composable
private fun ContactScreenPreview() {
ContactScreen()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.example.kuitweek2

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.example.kuitweek2", appContext.packageName)
}
}
101 changes: 9 additions & 92 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,23 @@ 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.shape.RoundedCornerShape
import androidx.compose.material3.Scaffold
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
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 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
.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)
)
}
}

}
MaterialTheme {
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
NewsScreen()
}
}
}
}
}
}
10 changes: 10 additions & 0 deletions app/src/main/java/com/example/kuit7/NewsArticle.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.example.kuit7

data class NewsArticle(
val image: Int,
val category: String,
val title: String,
val source: String,
val sourceIcon: Int,
val time: String
)
Loading