Skip to content

Commit 4bc13a5

Browse files
authored
Merge #67 -> develop
[Mod/#67] 1차 QA 수정
2 parents ac59ca0 + 6778c34 commit 4bc13a5

File tree

24 files changed

+596
-430
lines changed

24 files changed

+596
-430
lines changed

app/src/main/java/com/paw/key/core/designsystem/component/CourseCard.kt

Lines changed: 67 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import androidx.compose.foundation.layout.width
1818
import androidx.compose.foundation.shape.CircleShape
1919
import com.paw.key.R
2020
import androidx.compose.foundation.shape.RoundedCornerShape
21+
import androidx.compose.material3.HorizontalDivider
2122
import androidx.compose.material3.Icon
2223
import androidx.compose.material3.Text
2324
import androidx.compose.runtime.Composable
@@ -48,7 +49,9 @@ fun CourseCard(
4849
petName:String,
4950
date: String,
5051
onCLickItem : () -> Unit,
51-
modifier: Modifier = Modifier
52+
modifier: Modifier = Modifier,
53+
isShared : Boolean = false, // true면 떠진거 false면 닫은거
54+
isRecord : Boolean = false // 기록한 아이템 - true면 하트, false면 공유 아이콘
5255
) {
5356
Column(
5457
modifier = modifier
@@ -65,30 +68,46 @@ fun CourseCard(
6568
modifier = Modifier
6669
.fillMaxWidth()
6770
.aspectRatio(343f / 172f)
68-
.clip(RoundedCornerShape(20.dp))
71+
.clip(RoundedCornerShape(10.dp))
6972
) {
70-
// 지도 이미지
73+
// 지도 이미지 Todo : 테스트용
7174
Image(
7275
painter = painterResource(id = R.drawable.dummy_map),
7376
contentDescription = null,
74-
modifier = Modifier.fillMaxSize(),
77+
modifier = Modifier
78+
.fillMaxSize()
79+
.padding(start = 8.dp, end = 8.dp, top = 8.dp)
80+
.clip(RoundedCornerShape(8.dp)),
7581
contentScale = ContentScale.Crop
7682
)
7783

84+
/*AsyncImage(
85+
model = ImageRequest.Builder(LocalContext.current)
86+
.data("https://pawkey-server.com/image.jpg") // ← 서버에서 받은 이미지 URL 넣깅
87+
.crossfade(true)
88+
.build(),
89+
contentDescription = null,
90+
modifier = Modifier.fillMaxSize(),
91+
contentScale = ContentScale.Crop
92+
)*/
93+
7894
// 하단 그라데이션 오버레이
7995
Box(
8096
modifier = Modifier
8197
.fillMaxWidth()
8298
.height(LocalConfiguration.current.screenHeightDp.dp * 0.6f) // 높이 조절 가능
99+
.padding(start = 8.dp, end = 8.dp, top = 8.dp)
83100
.align(Alignment.BottomCenter)
84101
.background(
85102
brush = Brush.verticalGradient(
86103
colors = listOf(
87104
PawKeyTheme.colors.black.copy(0.05f),
88105
PawKeyTheme.colors.black.copy(0.55f)
89106
)
90-
)
107+
),
108+
shape = RoundedCornerShape(8.dp)
91109
)
110+
.clip(RoundedCornerShape(8.dp))
92111
)
93112

94113
// 프로필 + 제목
@@ -131,40 +150,67 @@ fun CourseCard(
131150
)
132151
}
133152
}
134-
Spacer(modifier = Modifier.weight(1f)) // 아이콘을 Row 끝으로 밀기 위한 Spacer
153+
Spacer(modifier = Modifier.weight(1f))
135154

136-
val isLiked = remember { mutableStateOf(false) }
155+
when {
156+
isShared -> {
157+
Icon(
158+
imageVector = ImageVector.vectorResource(id = R.drawable.ic_eye_linear_valid),
159+
contentDescription = "공유됨",
160+
tint = PawKeyTheme.colors.gray200,
161+
)
162+
}
163+
isRecord -> {
164+
val isLiked = remember { mutableStateOf(false) }
137165

138-
Icon(
139-
imageVector = if (isLiked.value) {
140-
ImageVector.vectorResource(id = R.drawable.ic_heart_filled)
141-
} else {
142-
ImageVector.vectorResource(id = R.drawable.ic_heart_default)
143-
},
144-
contentDescription = "좋아요",
145-
tint = Color.Unspecified,
146-
modifier = Modifier.clickable {
147-
isLiked.value = !isLiked.value
166+
Icon(
167+
imageVector = if (isLiked.value) {
168+
ImageVector.vectorResource(id = R.drawable.ic_heart_filled)
169+
} else {
170+
ImageVector.vectorResource(id = R.drawable.ic_heart_default)
171+
},
172+
contentDescription = "좋아요",
173+
tint = Color.Unspecified,
174+
modifier = Modifier.clickable {
175+
isLiked.value = !isLiked.value
176+
}
177+
)
148178
}
149-
)
179+
else -> {
180+
Icon(
181+
imageVector = ImageVector.vectorResource(id = R.drawable.ic_eye_linear_invalid),
182+
contentDescription = "공유 안됨",
183+
tint = PawKeyTheme.colors.gray200,
184+
)
185+
}
186+
}
150187
}
151188
}
152189

153190
Spacer(modifier = Modifier.height(12.dp))
154191

155192

156-
ChipRow(tags = listOf(
193+
ChipRow(
194+
tags = listOf(
157195
"이륜차 거의 없음",
158196
"배변 쓰레기통",
159197
"쉼터",
160198
"CCTV 있음",
161199
"물그릇 비치","이륜차 거의 없음",
162200
"배변 쓰레기통",
163-
"쉼터",
164-
))
201+
"쉼터",),
202+
modifier = Modifier
203+
.padding(start = 16.dp, end = 16.dp)
204+
)
165205

166206
Spacer(modifier = Modifier.height(12.dp))
167207
}
208+
209+
HorizontalDivider(
210+
color = PawKeyTheme.colors.gray50,
211+
thickness = 1.dp,
212+
modifier = Modifier.padding(start = 16.dp, end = 16.dp)
213+
)
168214
}
169215
@Preview(showBackground = true)
170216
@Composable
Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.paw.key.core.designsystem.component
22

33
import androidx.compose.foundation.clickable
4+
import androidx.compose.foundation.layout.Arrangement
45
import androidx.compose.foundation.layout.Box
56
import androidx.compose.foundation.layout.Row
67
import androidx.compose.foundation.layout.Spacer
@@ -14,38 +15,52 @@ import androidx.compose.ui.Alignment
1415
import androidx.compose.ui.Modifier
1516
import androidx.compose.ui.graphics.vector.ImageVector
1617
import androidx.compose.ui.res.vectorResource
18+
import androidx.compose.ui.tooling.preview.Preview
1719
import androidx.compose.ui.unit.dp
1820
import com.paw.key.R
1921
import com.paw.key.core.designsystem.theme.PawKeyTheme
2022

2123
@Composable
2224
fun TopBar(
2325
title: String,
24-
onBackClick: () -> Unit = {}
26+
onBackClick: () -> Unit,
27+
modifier: Modifier = Modifier,
28+
isBackVisible: Boolean = true,
2529
) {
26-
Row(
27-
modifier = Modifier
30+
Box(
31+
modifier = modifier
2832
.fillMaxWidth()
29-
.padding(vertical = 16.dp),
30-
verticalAlignment = Alignment.CenterVertically
33+
.padding(vertical = 12.dp, horizontal = 16.dp)
3134
) {
32-
33-
Icon(
34-
imageVector = ImageVector.vectorResource(R.drawable.ic_arrow_left_black),
35-
contentDescription = "뒤로가기",
36-
modifier = Modifier.clickable { onBackClick() }
37-
)
38-
39-
Box(
40-
modifier = Modifier.weight(1f),
41-
contentAlignment = Alignment.Center
42-
) {
43-
Text(
44-
text = title,
45-
style = PawKeyTheme.typography.body16Sb
35+
if (isBackVisible) {
36+
Icon(
37+
imageVector = ImageVector.vectorResource(R.drawable.ic_arrow_left_black),
38+
contentDescription = "뒤로가기",
39+
modifier = Modifier
40+
.align(Alignment.CenterStart)
41+
.clickable { onBackClick() }
4642
)
4743
}
4844

49-
Spacer(modifier = Modifier.width(24.dp))
45+
Text(
46+
text = title,
47+
style = PawKeyTheme.typography.head18Sb,
48+
modifier = Modifier
49+
.align(Alignment.Center)
50+
)
51+
}
52+
}
53+
54+
@Preview(showBackground = true)
55+
@Composable
56+
private fun TopBarPreview() {
57+
PawKeyTheme {
58+
TopBar(
59+
title = "산책 완료",
60+
onBackClick = {},
61+
isBackVisible = true,
62+
modifier = Modifier
63+
.fillMaxWidth()
64+
)
5065
}
5166
}

app/src/main/java/com/paw/key/data/repositoryimpl/RegionRepositoryImpl.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import com.paw.key.domain.model.entity.region.RegionDataEntity
66
import com.paw.key.domain.repository.RegionRepository
77
import javax.inject.Inject
88

9-
109
class RegionRepositoryImpl @Inject constructor(
1110
private val regionDataSource: RegionDataSource,
1211
private val mapper: RegionMapper

app/src/main/java/com/paw/key/presentation/ui/course/entire/EntireCourseScreen.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import androidx.compose.runtime.snapshotFlow
2121
import androidx.compose.ui.Modifier
2222
import androidx.compose.ui.platform.LocalContext
2323
import androidx.compose.ui.tooling.preview.Preview
24+
import androidx.compose.ui.unit.dp
2425
import androidx.core.content.ContextCompat
2526
import androidx.hilt.navigation.compose.hiltViewModel
2627
import androidx.lifecycle.compose.collectAsStateWithLifecycle
@@ -159,7 +160,8 @@ fun EntireCourseScreen(
159160
onTabSelected(it)
160161
},
161162
tabs = tabs,
162-
modifier = Modifier,
163+
modifier = Modifier
164+
.padding(top = 8.dp),
163165
)
164166

165167
when (currentPage) {

app/src/main/java/com/paw/key/presentation/ui/course/entire/tab/map/List/TabListScreen.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,18 @@ fun TabListScreen(
8686
}
8787

8888
LazyColumn(
89-
verticalArrangement = Arrangement.spacedBy(20.dp),
9089
modifier = modifier
9190
.fillMaxSize()
9291
.background(PawKeyTheme.colors.white2)
9392
.padding(bottom = 36.dp)
94-
9593
) {
9694

9795
item {
9896
CourseCard(
9997
title = "제목을 입력해주세요",
10098
petName = "안녕꼬리",
10199
date = "21/1/1",
100+
isRecord = true,
102101
onCLickItem = {}
103102
)
104103
}
@@ -107,6 +106,7 @@ fun TabListScreen(
107106
title = "제목을 입력해주세요",
108107
petName = "안녕꼬리",
109108
date = "21/1/1",
109+
isRecord = true,
110110
onCLickItem = {}
111111
)
112112
}
@@ -115,6 +115,7 @@ fun TabListScreen(
115115
title = "제목을 입력해주세요",
116116
petName = "안녕꼬리",
117117
date = "21/1/1",
118+
isRecord = true,
118119
onCLickItem = {}
119120
)
120121
}
@@ -123,6 +124,7 @@ fun TabListScreen(
123124
title = "제목을 입력해주세요",
124125
petName = "안녕꼬리",
125126
date = "21/1/1",
127+
isRecord = true,
126128
onCLickItem = {}
127129
)
128130
}

app/src/main/java/com/paw/key/presentation/ui/course/entire/tab/map/List/viewmodel/TapListViewModel.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ import javax.inject.Inject
1212
@HiltViewModel
1313
class TapListViewModel @Inject constructor(
1414

15-
)
16-
: ViewModel() {
15+
) : ViewModel() {
1716

1817
private val _state = MutableStateFlow(TapListContract.TapListState())
1918
val state: StateFlow<TapListContract.TapListState>

app/src/main/java/com/paw/key/presentation/ui/course/entire/tab/map/TapMapScreen.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.PaddingValues
99
import androidx.compose.foundation.layout.fillMaxWidth
1010
import androidx.compose.foundation.layout.navigationBarsPadding
1111
import androidx.compose.foundation.layout.padding
12+
import androidx.compose.foundation.layout.size
1213
import androidx.compose.foundation.shape.CircleShape
1314
import androidx.compose.foundation.shape.RoundedCornerShape
1415
import androidx.compose.material3.FloatingActionButton
@@ -239,9 +240,10 @@ fun TapMapScreen(
239240
FloatingActionButton(
240241
onClick = onClickTracking,
241242
shape = CircleShape,
242-
containerColor = PawKeyTheme.colors.gray50,
243+
containerColor = PawKeyTheme.colors.white1,
243244
modifier = Modifier
244-
.align(Alignment.BottomEnd)
245+
.align(Alignment.CenterEnd)
246+
.size(44.dp)
245247
) {
246248
Icon(
247249
imageVector = ImageVector.vectorResource(R.drawable.ic_course_map_tap_location_on),

0 commit comments

Comments
 (0)