diff --git a/build-logic/src/main/java/com/teamdontbe/dontbe/plugin/CommonConfigs.kt b/build-logic/src/main/java/com/teamdontbe/dontbe/plugin/CommonConfigs.kt index ae60172a..cb1049dd 100644 --- a/build-logic/src/main/java/com/teamdontbe/dontbe/plugin/CommonConfigs.kt +++ b/build-logic/src/main/java/com/teamdontbe/dontbe/plugin/CommonConfigs.kt @@ -22,17 +22,28 @@ internal fun Project.configureAndroidCommonPlugin() { extensions.getByType().apply { defaultConfig { - val dontbeBaseUrl = properties["dontbe.base.url"] as? String ?: "" val kakaoApiKey = properties["kakao.api.key"] as? String ?: "" val amplitudeApiKey = properties["amplitude.api.key"] as? String ?: "" - manifestPlaceholders["dontbeBaseUrl"] = properties["dontbe.base.url"] as String manifestPlaceholders["kakaoApiKey"] = properties["kakao.api.key"] as String - buildConfigField("String", "DONTBE_BASE_URL", "\"${dontbeBaseUrl}\"") buildConfigField("String", "KAKAO_APP_KEY", "\"${kakaoApiKey}\"") buildConfigField("String", "AMPLITUDE_API_KEY", "\"${amplitudeApiKey}\"") } + + buildTypes { + getByName("debug") { + val dontbeDevBaseUrl = properties["dontbe.dev.base.url"] as? String ?: "" + buildConfigField("String", "DONTBE_BASE_URL", "\"${dontbeDevBaseUrl}\"") + manifestPlaceholders["dontbeBaseUrl"] = properties["dontbe.dev.base.url"] as String + } + getByName("release") { + val dontbeRelBaseUrl = properties["dontbe.rel.base.url"] as? String ?: "" + buildConfigField("String", "DONTBE_BASE_URL", "\"${dontbeRelBaseUrl}\"") + manifestPlaceholders["dontbeBaseUrl"] = properties["dontbe.rel.base.url"] as String + } + } + buildFeatures.apply { viewBinding = true buildConfig = true @@ -47,4 +58,4 @@ internal fun Project.configureAndroidCommonPlugin() { "implementation"(libs.findLibrary("material").get()) "implementation"(libs.findLibrary("timber").get()) } -} \ No newline at end of file +} diff --git a/feature/src/main/java/com/teamdontbe/feature/home/HomeViewModel.kt b/feature/src/main/java/com/teamdontbe/feature/home/HomeViewModel.kt index 4e4950b5..4c7b9e52 100644 --- a/feature/src/main/java/com/teamdontbe/feature/home/HomeViewModel.kt +++ b/feature/src/main/java/com/teamdontbe/feature/home/HomeViewModel.kt @@ -100,6 +100,7 @@ class HomeViewModel uriString: String? ) { viewModelScope.launch { + _postCommentPosting.emit(UiState.Loading) homeRepository.postCommentPosting(contentId, commentText, uriString) .onSuccess { if (it) _postCommentPosting.emit(UiState.Success(it)) diff --git a/feature/src/main/java/com/teamdontbe/feature/homedetail/HomeDetailFragment.kt b/feature/src/main/java/com/teamdontbe/feature/homedetail/HomeDetailFragment.kt index 2057702d..1803cd1f 100644 --- a/feature/src/main/java/com/teamdontbe/feature/homedetail/HomeDetailFragment.kt +++ b/feature/src/main/java/com/teamdontbe/feature/homedetail/HomeDetailFragment.kt @@ -301,7 +301,8 @@ class HomeDetailFragment : } } - else -> Unit + is UiState.Loading -> UploadingSnackBar.make(binding.root).show() + is UiState.Empty -> Unit } }.launchIn(viewLifeCycleScope) } @@ -314,7 +315,6 @@ class HomeDetailFragment : requireContext().hideKeyboard(binding.root) (requireActivity() as MainActivity).findViewById(R.id.bnv_main).visibility = View.VISIBLE - UploadingSnackBar.make(binding.root).show() } private fun observeDeleteComment() { diff --git a/feature/src/main/java/com/teamdontbe/feature/posting/PostingFragment.kt b/feature/src/main/java/com/teamdontbe/feature/posting/PostingFragment.kt index bb91919e..f8ee6b8e 100644 --- a/feature/src/main/java/com/teamdontbe/feature/posting/PostingFragment.kt +++ b/feature/src/main/java/com/teamdontbe/feature/posting/PostingFragment.kt @@ -160,15 +160,12 @@ class PostingFragment : BindingFragment(R.layout.fragmen private fun initObservePost() { postingViewModel.postPosting.flowWithLifecycle(viewLifeCycle).onEach { when (it) { - is UiState.Loading -> Unit - is UiState.Success -> { - navigateToMainActivity() - context?.let { it -> - UploadingSnackBar.make(binding.root) - .show(it.pxToDp(16), 0, it.pxToDp(16), it.pxToDp(80)) - } + is UiState.Loading -> context?.let { it -> + UploadingSnackBar.make(binding.root) + .show(it.pxToDp(16), 0, it.pxToDp(16), it.pxToDp(80)) } + is UiState.Success -> navigateToMainActivity() is UiState.Empty -> Unit is UiState.Failure -> { LinkCountErrorSnackBar.make(binding.root).apply { @@ -279,9 +276,9 @@ class PostingFragment : BindingFragment(R.layout.fragmen trackEvent(CLICK_POST_UPLOAD) postingViewModel.posting( binding.etPostingContent.text.toString() + ( - binding.etPostingLink.text.takeIf { it.isNotEmpty() } - ?.let { "\n$it" }.orEmpty() - ), + binding.etPostingLink.text.takeIf { it.isNotEmpty() } + ?.let { "\n$it" }.orEmpty() + ), postingViewModel.photoUri.value ) } @@ -413,7 +410,6 @@ class PostingFragment : BindingFragment(R.layout.fragmen } } - private fun observePhotoUri() { postingViewModel.photoUri.flowWithLifecycle(viewLifeCycle).onEach { getUri -> getUri?.let { uri -> diff --git a/feature/src/main/res/layout/item_home_comment.xml b/feature/src/main/res/layout/item_home_comment.xml index b88edbf3..fd8bc783 100644 --- a/feature/src/main/res/layout/item_home_comment.xml +++ b/feature/src/main/res/layout/item_home_comment.xml @@ -127,6 +127,22 @@ app:layout_constraintStart_toStartOf="@id/iv_comment_profile" app:layout_constraintTop_toBottomOf="@id/iv_comment_profile" /> + + - - diff --git a/feature/src/main/res/layout/item_home_feed.xml b/feature/src/main/res/layout/item_home_feed.xml index 073c86d4..591c7079 100644 --- a/feature/src/main/res/layout/item_home_feed.xml +++ b/feature/src/main/res/layout/item_home_feed.xml @@ -91,6 +91,22 @@ app:layout_constraintStart_toStartOf="@id/iv_home_profile" app:layout_constraintTop_toBottomOf="@id/iv_home_profile" /> + + - - diff --git a/feature/src/main/res/layout/item_my_page_comment.xml b/feature/src/main/res/layout/item_my_page_comment.xml index 6dfb078b..d3f9480b 100644 --- a/feature/src/main/res/layout/item_my_page_comment.xml +++ b/feature/src/main/res/layout/item_my_page_comment.xml @@ -81,6 +81,22 @@ tools:text="돈비를 사용하면 진짜 돈비를 맞을 수 있나요? 저 돈비 맞고 싶어요 돈벼락이 최고입니다. 그나저나 돈비 정말 흥미로운 서비스인 것 같아요 어떻게 이런 기획을 ? 대박 ㄷ ㄷ ㄷ돈비를 사용하면 진짜 돈비를 맞을 수 있나요?" /> + + - - diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6f83a1ac..8fd3ae88 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,8 +2,8 @@ compileSdk = "34" minSdk = "28" targetSdk = "34" -appVersion = "1.1.0" -versionCode = "7" +appVersion = "1.2.0" +versionCode = "8" # kotlin kotlin = "1.9.10"