diff --git a/app/src/main/java/com/dpm/spot/MyApp.kt b/app/src/main/java/com/dpm/spot/MyApp.kt index a8feb429..9b852854 100644 --- a/app/src/main/java/com/dpm/spot/MyApp.kt +++ b/app/src/main/java/com/dpm/spot/MyApp.kt @@ -19,10 +19,10 @@ class MyApp : Application() { } else { FirebaseAnalytics.getInstance(this).setAnalyticsCollectionEnabled(true) FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(true) - // MixpanelManager.initialize(this) + MixpanelManager.initialize(this) } KakaoSdk.init(this, BuildConfig.KAKAO_NATIVE_APP_KEY) // TODO : 데이터 트래킹 Dev 작동 확인 -> release 모드 실행 - MixpanelManager.initialize(this) +// MixpanelManager.initialize(this) } } diff --git a/buildSrc/src/main/kotlin/Constants.kt b/buildSrc/src/main/kotlin/Constants.kt index d8a5a848..fd35b6c9 100644 --- a/buildSrc/src/main/kotlin/Constants.kt +++ b/buildSrc/src/main/kotlin/Constants.kt @@ -3,6 +3,6 @@ object Constants { const val compileSdk = 34 const val minSdk = 28 const val targetSdk = 34 - var versionCode = 2 - var versionName = "1.0.0" + var versionCode = 3 + var versionName = "1.0.1" } diff --git a/presentation/build.gradle.kts b/presentation/build.gradle.kts index 8a742c31..6c45df05 100644 --- a/presentation/build.gradle.kts +++ b/presentation/build.gradle.kts @@ -15,7 +15,7 @@ android { testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") // TODO : 데이터 트래킹 Dev 작동 확인 -> prod.mixpanel_token 교체 - buildConfigField("String", "MIXPANEL_TOKEN", getApiKey("dev.mixpanel_token")) + buildConfigField("String", "MIXPANEL_TOKEN", getApiKey("prod.mixpanel_token")) } composeOptions { diff --git a/presentation/src/main/java/com/dpm/presentation/viewfinder/compose/StadiumDetailScreen.kt b/presentation/src/main/java/com/dpm/presentation/viewfinder/compose/StadiumDetailScreen.kt index ac167a28..7ce482ae 100644 --- a/presentation/src/main/java/com/dpm/presentation/viewfinder/compose/StadiumDetailScreen.kt +++ b/presentation/src/main/java/com/dpm/presentation/viewfinder/compose/StadiumDetailScreen.kt @@ -213,7 +213,7 @@ fun StadiumDetailScreen( ) } ) - Spacer(modifier = Modifier.height(40.dp)) + Spacer(modifier = Modifier.height(20.dp)) } } } diff --git a/presentation/src/main/java/com/dpm/presentation/viewfinder/compose/StadiumReviewContent.kt b/presentation/src/main/java/com/dpm/presentation/viewfinder/compose/StadiumReviewContent.kt index 38cfbca3..70ef1612 100644 --- a/presentation/src/main/java/com/dpm/presentation/viewfinder/compose/StadiumReviewContent.kt +++ b/presentation/src/main/java/com/dpm/presentation/viewfinder/compose/StadiumReviewContent.kt @@ -110,6 +110,7 @@ fun StadiumReviewContent( ) ) ), + error = painterResource(id = com.depromeet.designsystem.R.drawable.ic_default_profile), modifier = Modifier .size(20.dp) .clip(CircleShape) @@ -294,15 +295,16 @@ fun StadiumReviewContent( contentScale = ContentScale.FillHeight ) } - } - if (firstReview && isFirstShare) { - Box( - modifier = Modifier - .fillMaxWidth() - .padding(end = 16.dp), - contentAlignment = Alignment.CenterEnd - ) { - ShareTooltip(bias = 0.875f, content = "카카오톡으로 같이가는 친구에게 공유하기") + if (firstReview && isFirstShare) { + Box( + modifier = Modifier + .offset(y = 45.dp) + .fillMaxWidth() + .padding(end = 16.dp), + contentAlignment = Alignment.CenterEnd + ) { + ShareTooltip(bias = 0.875f, content = "카카오톡으로 같이가는 친구에게 공유하기") + } } } } diff --git a/presentation/src/main/java/com/dpm/presentation/viewfinder/compose/detailpicture/DetailCotentLayer.kt b/presentation/src/main/java/com/dpm/presentation/viewfinder/compose/detailpicture/DetailCotentLayer.kt index 83004774..782980c9 100644 --- a/presentation/src/main/java/com/dpm/presentation/viewfinder/compose/detailpicture/DetailCotentLayer.kt +++ b/presentation/src/main/java/com/dpm/presentation/viewfinder/compose/detailpicture/DetailCotentLayer.kt @@ -24,6 +24,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.painter.BrushPainter import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextDecoration import androidx.compose.ui.text.style.TextOverflow @@ -140,6 +141,7 @@ fun DetailContentHeader( ) ) ), + error = painterResource(id = com.depromeet.designsystem.R.drawable.ic_default_profile), modifier = Modifier .size(20.dp) .clip(CircleShape) diff --git a/presentation/src/main/java/com/dpm/presentation/viewfinder/viewmodel/StadiumDetailViewModel.kt b/presentation/src/main/java/com/dpm/presentation/viewfinder/viewmodel/StadiumDetailViewModel.kt index 0db9e435..e9d768df 100644 --- a/presentation/src/main/java/com/dpm/presentation/viewfinder/viewmodel/StadiumDetailViewModel.kt +++ b/presentation/src/main/java/com/dpm/presentation/viewfinder/viewmodel/StadiumDetailViewModel.kt @@ -11,6 +11,7 @@ import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.launch +import timber.log.Timber import javax.inject.Inject enum class Sort { @@ -67,120 +68,132 @@ class StadiumDetailViewModel @Inject constructor( fun updateLike(id: Long) { viewModelScope.launch { - viewfinderRepository.updateLike(id.toInt()) - _detailUiState.value = when (val currentState = _detailUiState.value) { - is StadiumDetailUiState.ReviewsData -> { - val updatedReviews = currentState.reviews.map { review -> - if (review.id == id) { - if (review.isLike) { - review.copy( - isLike = !review.isLike, - likesCount = review.likesCount - 1 - ) + viewfinderRepository.updateLike(id.toInt()).onSuccess { + _detailUiState.value = when (val currentState = _detailUiState.value) { + is StadiumDetailUiState.ReviewsData -> { + val updatedReviews = currentState.reviews.map { review -> + if (review.id == id) { + if (review.isLike) { + review.copy( + isLike = !review.isLike, + likesCount = review.likesCount - 1 + ) + } else { + review.copy( + isLike = !review.isLike, + likesCount = review.likesCount + 1 + ) + } } else { - review.copy( - isLike = !review.isLike, - likesCount = review.likesCount + 1 - ) + review } - } else { - review } + currentState.copy(reviews = updatedReviews) } - currentState.copy(reviews = updatedReviews) - } - else -> currentState + else -> currentState + } + }.onFailure { + Timber.e("error : ${it.message}") } } } fun updateTopReviewLike(id: Long) { viewModelScope.launch { - viewfinderRepository.updateLike(id.toInt()) - _detailUiState.value = when (val currentState = _detailUiState.value) { - is StadiumDetailUiState.ReviewsData -> { - val updatedReviews = currentState.topReviewImages.map { review -> - if (review.id == id) { - if (review.isLike) { - review.copy( - isLike = !review.isLike, - likesCount = review.likesCount - 1 - ) + viewfinderRepository.updateLike(id.toInt()).onSuccess { + _detailUiState.value = when (val currentState = _detailUiState.value) { + is StadiumDetailUiState.ReviewsData -> { + val updatedReviews = currentState.topReviewImages.map { review -> + if (review.id == id) { + if (review.isLike) { + review.copy( + isLike = !review.isLike, + likesCount = review.likesCount - 1 + ) + } else { + review.copy( + isLike = !review.isLike, + likesCount = review.likesCount + 1 + ) + } } else { - review.copy( - isLike = !review.isLike, - likesCount = review.likesCount + 1 - ) + review } - } else { - review } + currentState.copy(topReviewImages = updatedReviews) } - currentState.copy(topReviewImages = updatedReviews) - } - else -> currentState + else -> currentState + } + }.onFailure { + Timber.e("error : ${it.message}") } } } fun updateScrap(id: Long) { viewModelScope.launch { - viewfinderRepository.updateScrap(id.toInt()) - _detailUiState.value = when (val currentState = _detailUiState.value) { - is StadiumDetailUiState.ReviewsData -> { - val updatedReviews = currentState.reviews.map { review -> - if (review.id == id) { - if (review.isScrap) { - review.copy( - isScrap = !review.isScrap, - scrapsCount = review.scrapsCount - 1 - ) + viewfinderRepository.updateScrap(id.toInt()).onSuccess { + _detailUiState.value = when (val currentState = _detailUiState.value) { + is StadiumDetailUiState.ReviewsData -> { + val updatedReviews = currentState.reviews.map { review -> + if (review.id == id) { + if (review.isScrap) { + review.copy( + isScrap = !review.isScrap, + scrapsCount = review.scrapsCount - 1 + ) + } else { + review.copy( + isScrap = !review.isScrap, + scrapsCount = review.scrapsCount + 1 + ) + } } else { - review.copy( - isScrap = !review.isScrap, - scrapsCount = review.scrapsCount + 1 - ) + review } - } else { - review } + currentState.copy(reviews = updatedReviews) } - currentState.copy(reviews = updatedReviews) - } - else -> currentState + else -> currentState + } + }.onFailure { + Timber.e("error : ${it.message}") } } } fun updateTopReviewScrap(id: Long) { viewModelScope.launch { - viewfinderRepository.updateScrap(id.toInt()) - _detailUiState.value = when (val currentState = _detailUiState.value) { - is StadiumDetailUiState.ReviewsData -> { - val updatedReviews = currentState.topReviewImages.map { review -> - if (review.id == id) { - if (review.isScrap) { - review.copy( - isScrap = !review.isScrap, - scrapsCount = review.scrapsCount - 1 - ) + viewfinderRepository.updateScrap(id.toInt()).onSuccess { + _detailUiState.value = when (val currentState = _detailUiState.value) { + is StadiumDetailUiState.ReviewsData -> { + val updatedReviews = currentState.topReviewImages.map { review -> + if (review.id == id) { + if (review.isScrap) { + review.copy( + isScrap = !review.isScrap, + scrapsCount = review.scrapsCount - 1 + ) + } else { + review.copy( + isScrap = !review.isScrap, + scrapsCount = review.scrapsCount + 1 + ) + } } else { - review.copy( - isScrap = !review.isScrap, - scrapsCount = review.scrapsCount + 1 - ) + review } - } else { - review } + currentState.copy(topReviewImages = updatedReviews) } - currentState.copy(topReviewImages = updatedReviews) - } - else -> currentState + else -> currentState + } + }.onFailure { + Timber.e("error : ${it.message}") } } }