Skip to content

Commit

Permalink
[fix/#133] 카카오 공유하기 딥링크 수정 및 공유하기 플로우 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Jokwanhee committed Aug 27, 2024
1 parent cda4297 commit 63cfe43
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ fun seatFeed(
title = title,
description = description,
imageUrl = imageUrl,
link = Link()
link = Link(
androidExecutionParams = queryParams
)
),
buttons = listOf(
Button(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.dpm.presentation.viewfinder.compose.detailpicture

import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
Expand All @@ -23,6 +24,7 @@ import com.dpm.designsystem.compose.ui.SpotTheme

@Composable
fun DetailReviewInteractionItems(
isScrap: Boolean,
isLike: Boolean,
likeCount: Long,
modifier: Modifier = Modifier,
Expand Down Expand Up @@ -63,12 +65,20 @@ fun DetailReviewInteractionItems(
IconButton(onClick = {
onClickScrap()
}, modifier.size(24.dp)) {
Icon(
painter = painterResource(id = R.drawable.ic_scrap),
contentDescription = null,
tint = SpotTheme.colors.foregroundWhite,
modifier = Modifier.size(24.dp)
)
if (isScrap) {
Image(
painter = painterResource(id = R.drawable.ic_scrap_active),
contentDescription = null,
modifier = Modifier.size(24.dp)
)
} else {
Icon(
painter = painterResource(id = R.drawable.ic_scrap),
contentDescription = null,
tint = SpotTheme.colors.foregroundWhite,
modifier = Modifier.size(24.dp)
)
}
}
Spacer(modifier = Modifier.height(20.dp))
IconButton(onClick = onClickShare, modifier.size(24.dp)) {
Expand All @@ -86,6 +96,7 @@ fun DetailReviewInteractionItems(
@Composable
private fun DetailReviewInteractionItemsLikePreview() {
DetailReviewInteractionItems(
isScrap = false,
isLike = true,
likeCount = 1,
onClickLike = {},
Expand All @@ -98,6 +109,7 @@ private fun DetailReviewInteractionItemsLikePreview() {
@Composable
private fun DetailReviewInteractionItemsPreview() {
DetailReviewInteractionItems(
isScrap = true,
isLike = false,
likeCount = 1,
onClickLike = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import com.dpm.domain.entity.response.viewfinder.ResponseBlockReview
@Composable
fun DetailViewPagerLayer(
context: Context,
isScrap: Boolean,
isLike: Boolean,
likeCount: Long,
isFirstLike: Boolean,
Expand All @@ -38,6 +39,7 @@ fun DetailViewPagerLayer(
horizontalAlignment = Alignment.CenterHorizontally
) {
StadiumDetailPictureViewPager(
isScrap = isScrap,
isLike = isLike,
context = context,
pictures = pictures,
Expand Down Expand Up @@ -75,6 +77,7 @@ private fun DetailViewPagerLayerPreview() {
DetailViewPagerLayer(
context = LocalContext.current,
isDimmed = true,
isScrap = true,
isLike = true,
isFirstLike = true,
likeCount = 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import kotlinx.coroutines.launch
fun StadiumDetailPictureViewPager(
context: Context,
isLike: Boolean,
isScrap: Boolean,
isFirstLike: Boolean,
likeCount: Long,
verticalPagerState: PagerState,
Expand Down Expand Up @@ -135,6 +136,7 @@ fun StadiumDetailPictureViewPager(
contentAlignment = Alignment.CenterEnd
) {
DetailReviewInteractionItems(
isScrap = isScrap,
isLike = isLike,
likeCount = likeCount,
onClickLike = {
Expand Down Expand Up @@ -189,6 +191,7 @@ private fun StadiumDetailPictureViewPagerPreview() {
}
StadiumDetailPictureViewPager(
context = LocalContext.current,
isScrap = true,
isLike = true,
likeCount = 1,
isFirstLike = true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ fun StadiumDetailReviewViewPager(
DetailViewPagerLayer(
context = context,
isDimmed = isDimmed,
isScrap = reviews[page].isScrap,
isLike = reviews[page].isLike,
isFirstLike = isFirstLike,
likeCount = reviews[page].likesCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ fun StadiumDetailPictureTopScreen(
isFirstLikeState = false
stadiumDetailViewModel.updateTopReviewLike(id)
},
onClickScrap = onClickScrap,
onClickScrap = { id ->
onClickScrap(id)
if (!stadiumDetailViewModel.checkTopReviewScrap(id)) {
stadiumDetailViewModel.updateTopReviewScrap(id)
}
},
onClickShare = { imagePosition ->
onClickShare()
KakaoUtils().share(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fun StadiumDetailPictureMainScreen(
onClickScrap: (id: Long) -> Unit = {},
onClickShare: () -> Unit = {}
) {
when(uiState) {
when (uiState) {
is StadiumDetailUiState.ReviewsData -> {
val visited = remember {
mutableStateListOf(
Expand Down Expand Up @@ -100,7 +100,12 @@ fun StadiumDetailPictureMainScreen(
isFirstLikeState = false
stadiumDetailViewModel.updateLike(id)
},
onClickScrap = onClickScrap,
onClickScrap = { id ->
onClickScrap(id)
if (!stadiumDetailViewModel.checkScrap(id)) {
stadiumDetailViewModel.updateScrap(id)
}
},
onClickShare = { imagePosition ->
onClickShare()
KakaoUtils().share(
Expand All @@ -121,6 +126,7 @@ fun StadiumDetailPictureMainScreen(
}
)
}

else -> Unit
}
}
Expand Down

0 comments on commit 63cfe43

Please sign in to comment.