Skip to content

Commit cddcb9c

Browse files
committed
feat/#40: 마이페이지 각 섹션 클릭 시 해당 뷰 네비게이션 연결
1 parent 909adec commit cddcb9c

File tree

6 files changed

+43
-40
lines changed

6 files changed

+43
-40
lines changed

app/src/main/java/com/paw/key/presentation/ui/mypage/MyPageScreen.kt

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.paw.key.presentation.ui.mypage
22

33
import androidx.compose.foundation.background
4+
import androidx.compose.foundation.clickable
45
import androidx.compose.foundation.layout.*
56
import androidx.compose.foundation.lazy.LazyColumn
67
import androidx.compose.foundation.shape.CircleShape
@@ -69,7 +70,7 @@ fun MyPageScreen(
6970
style = PawKeyTheme.typography.head22B,
7071
modifier = Modifier.padding(start = 16.dp, top = 16.dp, bottom = 12.dp)
7172
)
72-
OwnerCard(ownerName = "김도기님", role = "견주")
73+
OwnerCard(ownerName = "김도기님", role = "견주", navigateUserProfile = navigateUserProfile)
7374

7475
Spacer(modifier = Modifier.height(19.dp))
7576

@@ -79,12 +80,15 @@ fun MyPageScreen(
7980
gender = "여아",
8081
tags = listOf("조금 느긋해요", "#오토바이소리", "#대형견"),
8182
walkCount = "7회",
82-
totalDistance = "14km"
83+
totalDistance = "14km",
84+
navigatePetProfile = navigatePetProfile
8385
)
8486
Spacer(modifier = Modifier.height(12.dp))
8587

8688
WalkRouteList(
87-
routes = listOf("저장한 산책 루트", "내가 기록한 산책 루트")
89+
routes = listOf("저장한 산책 루트", "내가 기록한 산책 루트"),
90+
navigateSavedCourse = navigateSavedCourse,
91+
navigateArchivedCourse = navigateArchivedCourse
8892
)
8993
}
9094
}
@@ -94,6 +98,7 @@ fun MyPageScreen(
9498
fun OwnerCard(
9599
ownerName: String,
96100
role: String,
101+
navigateUserProfile: () -> Unit,
97102
modifier: Modifier = Modifier
98103
) {
99104
Row(
@@ -112,6 +117,7 @@ fun OwnerCard(
112117
Spacer(modifier = Modifier.weight(1f))
113118
Icon(
114119
imageVector = ImageVector.vectorResource(id = R.drawable.ic_arrow_right),
120+
modifier = modifier.clickable { navigateUserProfile() },
115121
contentDescription = "견주 프로필 이동"
116122
)
117123
}
@@ -125,6 +131,7 @@ fun PetCard(
125131
tags: List<String>,
126132
walkCount: String,
127133
totalDistance: String,
134+
navigatePetProfile: () -> Unit,
128135
modifier: Modifier = Modifier
129136
) {
130137
Column(
@@ -157,6 +164,7 @@ fun PetCard(
157164
Spacer(modifier = Modifier.weight(1f))
158165
Icon(
159166
imageVector = ImageVector.vectorResource(id = R.drawable.ic_arrow_right),
167+
modifier = modifier.clickable { navigatePetProfile() },
160168
contentDescription = "반려견 프로필 이동",
161169
tint = Color.White
162170
)
@@ -231,8 +239,11 @@ fun PetCard(
231239
}
232240

233241
@Composable
234-
fun WalkRouteList(routes: List<String>,
235-
modifier: Modifier = Modifier
242+
fun WalkRouteList(
243+
routes: List<String>,
244+
navigateSavedCourse: () -> Unit,
245+
navigateArchivedCourse: () -> Unit,
246+
modifier: Modifier = Modifier
236247
) {
237248
Column(
238249
modifier = Modifier
@@ -262,6 +273,9 @@ fun WalkRouteList(routes: List<String>,
262273
)
263274
Icon(
264275
imageVector = ImageVector.vectorResource(id = R.drawable.ic_arrow_right),
276+
modifier = modifier.clickable {
277+
if (index == 0) navigateSavedCourse() else navigateArchivedCourse()
278+
},
265279
contentDescription = "산책루트 메뉴 이동"
266280
)
267281
}

app/src/main/res/drawable/baseline_home_filled_24.xml

Lines changed: 0 additions & 11 deletions
This file was deleted.

app/src/main/res/drawable/ic_community_fill.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
android:viewportHeight="24">
66
<path
77
android:pathData="M9,2C6.38,2 4.25,4.13 4.25,6.75C4.25,9.32 6.26,11.4 8.88,11.49C8.96,11.48 9.04,11.48 9.1,11.49C9.12,11.49 9.13,11.49 9.15,11.49C9.16,11.49 9.16,11.49 9.17,11.49C11.73,11.4 13.74,9.32 13.75,6.75C13.75,4.13 11.62,2 9,2Z"
8-
android:fillColor="#C9976E"/>
8+
android:fillColor="#39BA28"/>
99
<path
10-
android:pathData="M14.08,14.149C11.29,12.289 6.74,12.289 3.93,14.149C2.66,14.999 1.96,16.149 1.96,17.379C1.96,18.609 2.66,19.749 3.92,20.589C5.32,21.529 7.16,21.999 9,21.999C10.84,21.999 12.68,21.529 14.08,20.589C15.34,19.739 16.04,18.599 16.04,17.359C16.03,16.129 15.34,14.989 14.08,14.149Z"
11-
android:fillColor="#C9976E"/>
10+
android:pathData="M14.08,14.151C11.29,12.291 6.74,12.291 3.93,14.151C2.66,15.001 1.96,16.151 1.96,17.381C1.96,18.611 2.66,19.751 3.92,20.591C5.32,21.531 7.16,22.001 9,22.001C10.84,22.001 12.68,21.531 14.08,20.591C15.34,19.741 16.04,18.601 16.04,17.361C16.03,16.131 15.34,14.991 14.08,14.151Z"
11+
android:fillColor="#39BA28"/>
1212
<path
13-
android:pathData="M19.99,7.338C20.15,9.278 18.77,10.978 16.86,11.208C16.85,11.208 16.85,11.208 16.84,11.208H16.81C16.75,11.208 16.69,11.208 16.64,11.228C15.67,11.278 14.78,10.968 14.11,10.398C15.14,9.478 15.73,8.098 15.61,6.598C15.54,5.788 15.26,5.048 14.84,4.418C15.22,4.228 15.66,4.108 16.11,4.068C18.07,3.898 19.82,5.358 19.99,7.338Z"
14-
android:fillColor="#C9976E"/>
13+
android:pathData="M19.99,7.34C20.15,9.28 18.77,10.98 16.86,11.21C16.85,11.21 16.85,11.21 16.84,11.21H16.81C16.75,11.21 16.69,11.21 16.64,11.23C15.67,11.28 14.78,10.97 14.11,10.4C15.14,9.48 15.73,8.1 15.61,6.6C15.54,5.79 15.26,5.05 14.84,4.42C15.22,4.23 15.66,4.11 16.11,4.07C18.07,3.9 19.82,5.36 19.99,7.34Z"
14+
android:fillColor="#39BA28"/>
1515
<path
1616
android:pathData="M21.99,16.59C21.91,17.56 21.29,18.4 20.25,18.97C19.25,19.52 17.99,19.78 16.74,19.75C17.46,19.1 17.88,18.29 17.96,17.43C18.06,16.19 17.47,15 16.29,14.05C15.62,13.52 14.84,13.1 13.99,12.79C16.2,12.15 18.98,12.58 20.69,13.96C21.61,14.7 22.08,15.63 21.99,16.59Z"
17-
android:fillColor="#C9976E"/>
17+
android:fillColor="#39BA28"/>
1818
</vector>
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<vector xmlns:android="http://schemas.android.com/apk/res/android"
2-
android:width="20dp"
3-
android:height="20dp"
4-
android:viewportWidth="20"
5-
android:viewportHeight="20">
2+
android:width="24dp"
3+
android:height="24dp"
4+
android:viewportWidth="24"
5+
android:viewportHeight="24">
66
<path
7-
android:pathData="M18.04,4.822L12.28,0.792C10.71,-0.308 8.3,-0.248 6.79,0.922L1.78,4.832C0.78,5.612 -0.01,7.212 -0.01,8.472V15.372C-0.01,17.922 2.06,20.002 4.61,20.002H15.39C17.94,20.002 20.01,17.932 20.01,15.382V8.602C20.01,7.252 19.14,5.592 18.04,4.822ZM10.75,16.002C10.75,16.412 10.41,16.752 10,16.752C9.59,16.752 9.25,16.412 9.25,16.002V13.002C9.25,12.592 9.59,12.252 10,12.252C10.41,12.252 10.75,12.592 10.75,13.002V16.002Z"
8-
android:fillColor="#C9976E"/>
7+
android:pathData="M20.04,6.82L14.28,2.79C12.71,1.69 10.3,1.75 8.79,2.92L3.78,6.83C2.78,7.61 1.99,9.21 1.99,10.47V17.37C1.99,19.92 4.06,22 6.61,22H17.39C19.94,22 22.01,19.93 22.01,17.38V10.6C22.01,9.25 21.14,7.59 20.04,6.82ZM12.75,18C12.75,18.41 12.41,18.75 12,18.75C11.59,18.75 11.25,18.41 11.25,18V15C11.25,14.59 11.59,14.25 12,14.25C12.41,14.25 12.75,14.59 12.75,15V18Z"
8+
android:fillColor="#39BA28"/>
99
</vector>

app/src/main/res/drawable/ic_mypage_fill.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
android:viewportHeight="24">
66
<path
77
android:pathData="M12,12C14.761,12 17,9.761 17,7C17,4.239 14.761,2 12,2C9.239,2 7,4.239 7,7C7,9.761 9.239,12 12,12Z"
8-
android:fillColor="#C9976E"/>
8+
android:fillColor="#39BA28"/>
99
<path
1010
android:pathData="M12,14.5C6.99,14.5 2.91,17.86 2.91,22C2.91,22.28 3.13,22.5 3.41,22.5H20.59C20.87,22.5 21.09,22.28 21.09,22C21.09,17.86 17.01,14.5 12,14.5Z"
11-
android:fillColor="#C9976E"/>
11+
android:fillColor="#39BA28"/>
1212
</vector>

app/src/main/res/drawable/ic_walk_fill.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,35 @@
77
android:pathData="M4.41,16.75C4.17,19.64 6.35,22 9.25,22H14.04C17.3,22 19.54,19.37 19,16.15C18.43,12.77 15.17,10 11.74,10C8.02,10 4.72,13.04 4.41,16.75Z"
88
android:strokeLineJoin="round"
99
android:strokeWidth="1.5"
10-
android:fillColor="#C9976E"
11-
android:strokeColor="#C9976E"
10+
android:fillColor="#39BA28"
11+
android:strokeColor="#39BA28"
1212
android:strokeLineCap="round"/>
1313
<path
1414
android:pathData="M10.47,7.5C11.85,7.5 12.97,6.381 12.97,5C12.97,3.619 11.85,2.5 10.47,2.5C9.089,2.5 7.97,3.619 7.97,5C7.97,6.381 9.089,7.5 10.47,7.5Z"
1515
android:strokeLineJoin="round"
1616
android:strokeWidth="1.5"
17-
android:fillColor="#C9976E"
18-
android:strokeColor="#C9976E"
17+
android:fillColor="#39BA28"
18+
android:strokeColor="#39BA28"
1919
android:strokeLineCap="round"/>
2020
<path
2121
android:pathData="M17.3,8.699C18.404,8.699 19.3,7.804 19.3,6.699C19.3,5.595 18.404,4.699 17.3,4.699C16.195,4.699 15.3,5.595 15.3,6.699C15.3,7.804 16.195,8.699 17.3,8.699Z"
2222
android:strokeLineJoin="round"
2323
android:strokeWidth="1.5"
24-
android:fillColor="#C9976E"
25-
android:strokeColor="#C9976E"
24+
android:fillColor="#39BA28"
25+
android:strokeColor="#39BA28"
2626
android:strokeLineCap="round"/>
2727
<path
2828
android:pathData="M21,12.699C21.828,12.699 22.5,12.028 22.5,11.199C22.5,10.371 21.828,9.699 21,9.699C20.172,9.699 19.5,10.371 19.5,11.199C19.5,12.028 20.172,12.699 21,12.699Z"
2929
android:strokeLineJoin="round"
3030
android:strokeWidth="1.5"
31-
android:fillColor="#C9976E"
32-
android:strokeColor="#C9976E"
31+
android:fillColor="#39BA28"
32+
android:strokeColor="#39BA28"
3333
android:strokeLineCap="round"/>
3434
<path
3535
android:pathData="M3.97,10.699C5.074,10.699 5.97,9.804 5.97,8.699C5.97,7.595 5.074,6.699 3.97,6.699C2.865,6.699 1.97,7.595 1.97,8.699C1.97,9.804 2.865,10.699 3.97,10.699Z"
3636
android:strokeLineJoin="round"
3737
android:strokeWidth="1.5"
38-
android:fillColor="#C9976E"
39-
android:strokeColor="#C9976E"
38+
android:fillColor="#39BA28"
39+
android:strokeColor="#39BA28"
4040
android:strokeLineCap="round"/>
4141
</vector>

0 commit comments

Comments
 (0)