diff --git a/data/src/main/java/com/whyranoid/data/model/post/PostResponse.kt b/data/src/main/java/com/whyranoid/data/model/post/PostResponse.kt index 659f6ba..50927a3 100644 --- a/data/src/main/java/com/whyranoid/data/model/post/PostResponse.kt +++ b/data/src/main/java/com/whyranoid/data/model/post/PostResponse.kt @@ -18,6 +18,7 @@ data class PostResponse( @SerializedName("date") val date: String, @SerializedName("colorMode") val colorMode: Long, @SerializedName("historyContent") val historyContent: String, + @SerializedName("commentCount") val commentCount: Long, ) { fun toPostPreview(): PostPreview { val destructedHistoryContent = historyContent.split('_') @@ -33,6 +34,7 @@ data class PostResponse( timeText = destructedHistoryContent[3], paceText = destructedHistoryContent[4], address = destructedHistoryContent[1], + commentCount = commentCount, ) } @@ -52,6 +54,7 @@ data class PostResponse( timeText = destructedHistoryContent[3], paceText = destructedHistoryContent[4], address = destructedHistoryContent[1], + commentCount = commentCount, ) } diff --git a/domain/src/main/java/com/whyranoid/domain/model/post/Post.kt b/domain/src/main/java/com/whyranoid/domain/model/post/Post.kt index 1c4bc3c..e7e6b2e 100644 --- a/domain/src/main/java/com/whyranoid/domain/model/post/Post.kt +++ b/domain/src/main/java/com/whyranoid/domain/model/post/Post.kt @@ -18,6 +18,7 @@ data class Post( val timeText: String = "", val paceText: String = "", val address: String = "", + val commentCount: Long = 0, ) : Serializable { companion object { val DUMMY = diff --git a/domain/src/main/java/com/whyranoid/domain/model/post/PostPreview.kt b/domain/src/main/java/com/whyranoid/domain/model/post/PostPreview.kt index 6d07116..0f7737a 100644 --- a/domain/src/main/java/com/whyranoid/domain/model/post/PostPreview.kt +++ b/domain/src/main/java/com/whyranoid/domain/model/post/PostPreview.kt @@ -14,6 +14,7 @@ data class PostPreview( val timeText: String = "", val paceText: String = "", val address: String = "", + val commentCount: Long = 0, ) { companion object { val DUMMY_LIST = listOf( diff --git a/presentation/src/main/java/com/whyranoid/presentation/component/community/PostContentItem.kt b/presentation/src/main/java/com/whyranoid/presentation/component/community/PostContentItem.kt index 1f67275..b47ec6b 100644 --- a/presentation/src/main/java/com/whyranoid/presentation/component/community/PostContentItem.kt +++ b/presentation/src/main/java/com/whyranoid/presentation/component/community/PostContentItem.kt @@ -78,14 +78,13 @@ fun PostContentItem( Icon( modifier = Modifier - .graphicsLayer(scaleX = -1f) .size(28.dp) .clip(CircleShape) .clickable { onCommentClicked(post) } .padding(3.dp), - painter = painterResource(id = R.drawable.ic_comment_outlined_button), + painter = painterResource(id = R.drawable.ic_comment_button), contentDescription = "댓글 버튼", tint = WalkieColor.GrayBorder ) @@ -94,7 +93,7 @@ fun PostContentItem( Text( modifier = Modifier.align(Alignment.CenterVertically), - text = "?", // todo replace real count + text = post.commentCount.toString(), style = WalkieTypography.Body1_Normal, color = WalkieColor.GrayBorder ) diff --git a/presentation/src/main/java/com/whyranoid/presentation/screens/CommunityScreen.kt b/presentation/src/main/java/com/whyranoid/presentation/screens/CommunityScreen.kt index feecb16..2187693 100644 --- a/presentation/src/main/java/com/whyranoid/presentation/screens/CommunityScreen.kt +++ b/presentation/src/main/java/com/whyranoid/presentation/screens/CommunityScreen.kt @@ -61,6 +61,7 @@ fun CommunityScreen(navController: NavController) { modifier = Modifier .clickable { + navController.navigate(Screen.AddPostScreen.route) }, imageVector = Icons.Filled.Add, contentDescription = "추가 버튼", diff --git a/presentation/src/main/java/com/whyranoid/presentation/screens/mypage/MyPageScreen.kt b/presentation/src/main/java/com/whyranoid/presentation/screens/mypage/MyPageScreen.kt index 5e338ff..77a46a3 100644 --- a/presentation/src/main/java/com/whyranoid/presentation/screens/mypage/MyPageScreen.kt +++ b/presentation/src/main/java/com/whyranoid/presentation/screens/mypage/MyPageScreen.kt @@ -20,8 +20,10 @@ import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.pager.HorizontalPager import androidx.compose.foundation.pager.rememberPagerState +import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.foundation.verticalScroll import androidx.compose.material.Scaffold import androidx.compose.material.Tab import androidx.compose.material.TabRow @@ -375,17 +377,25 @@ fun UserPageContent( verticalAlignment = Alignment.Top, ) { pagerNum -> when (pagerNum) { - 0 -> state.userPostPreviewsState.getDataOrNull()?.let { postPreviews -> - PostPage( - nickname == null, - postPreviews, - onPostPreviewClicked, - onPostCreateClicked, - ) + 0 -> { + Column( + modifier = Modifier.verticalScroll(rememberScrollState()) + ) { + state.userPostPreviewsState.getDataOrNull()?.let { postPreviews -> + PostPage( + nickname == null, + postPreviews, + onPostPreviewClicked, + onPostCreateClicked, + ) + } + } } 1 -> { - Column { + Column( + modifier = Modifier.verticalScroll(rememberScrollState()) + ) { HistoryPage(onDayClicked = onDateClicked) state.calendarPreviewsState.getDataOrNull() ?.let { postPreviews -> @@ -405,12 +415,16 @@ fun UserPageContent( 2 -> { val itemList = state.challengingPreviewsState.getDataOrNull() if (itemList != null) { - ChallengePage( - itemList, - onChallengePreviewClicked, - goChallengeMainScreen, - nickname == null - ) + Column( + modifier = Modifier.verticalScroll(rememberScrollState()) + ) { + ChallengePage( + itemList, + onChallengePreviewClicked, + goChallengeMainScreen, + nickname == null + ) + } } else { Box(Modifier.fillMaxSize()) { CircularProgressIndicator(Modifier.align(Alignment.Center)) diff --git a/presentation/src/main/res/drawable/ic_comment_button.xml b/presentation/src/main/res/drawable/ic_comment_button.xml new file mode 100644 index 0000000..e2b757c --- /dev/null +++ b/presentation/src/main/res/drawable/ic_comment_button.xml @@ -0,0 +1,11 @@ + + + diff --git a/presentation/src/main/res/drawable/ic_comment_outlined_button.xml b/presentation/src/main/res/drawable/ic_comment_outlined_button.xml deleted file mode 100644 index 91d5a01..0000000 --- a/presentation/src/main/res/drawable/ic_comment_outlined_button.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - -