From ab36cc11c2c646287d9eec1c6af1701b92b7e5ff Mon Sep 17 00:00:00 2001 From: jihyunniiii Date: Wed, 13 Mar 2024 14:07:04 +0900 Subject: [PATCH 1/8] =?UTF-8?q?[chore]=20#251=20Manifest=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20(NewGroupInfoActivity=20=EC=B6=94=EA=B0=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/AndroidManifest.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 5f541aa1..88f6d7e6 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -82,7 +82,6 @@ android:exported="false" android:screenOrientation="portrait" tools:ignore="LockedOrientationActivity" /> - + Date: Wed, 13 Mar 2024 14:57:41 +0900 Subject: [PATCH 2/8] =?UTF-8?q?[chore]=20#251=20=EB=84=A4=EC=9D=B4?= =?UTF-8?q?=EB=B0=8D=20=EC=88=98=EC=A0=95=20(isNewGroupBtnCheckName=20->?= =?UTF-8?q?=20isGroupNameDuplicatedCheck)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pingle/presentation/ui/newgroup/NewGroupViewModel.kt | 8 ++++---- .../ui/newgroup/newgroupinput/NewGroupInputFragment.kt | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/NewGroupViewModel.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/NewGroupViewModel.kt index f89ae2a3..04726532 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/NewGroupViewModel.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/NewGroupViewModel.kt @@ -47,7 +47,7 @@ class NewGroupViewModel @Inject constructor( val newGroupName = MutableStateFlow("") val newGroupEmail = MutableStateFlow("") - val isNewGroupBtnCheckName = MutableStateFlow(false) + val isGroupNameDuplicatedCheck = MutableStateFlow(false) val newGroupKeywordName = MutableStateFlow("") val newGroupKeywordValue = MutableStateFlow("") @@ -55,7 +55,7 @@ class NewGroupViewModel @Inject constructor( currentPage, newGroupName, newGroupEmail, - isNewGroupBtnCheckName, + isGroupNameDuplicatedCheck, newGroupKeywordValue ).combineAll().map { values -> val currentPage = values[0] as Int @@ -78,8 +78,8 @@ class NewGroupViewModel @Inject constructor( newGroupKeywordValue.value = keywordValue } - fun setIsNewGroupBtnCheckName(boolean: Boolean) { - isNewGroupBtnCheckName.value = boolean + fun setIsGroupNameDuplicatedCheck(boolean: Boolean) { + isGroupNameDuplicatedCheck.value = boolean } fun isEmailValid() = EMAIL_PATTERN.matches(newGroupEmail.value) diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt index 9a9fb21c..297d2db0 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt @@ -51,8 +51,8 @@ class NewGroupInputFragment : private fun collectNewGroupTeamNameIsEnabled() { newGroupViewModel.newGroupName.flowWithLifecycle(lifecycle).onEach { newGroupName -> binding.etNewGroupInputGroupName.btnEditTextCheck.isEnabled = newGroupName.isNotBlank() - newGroupViewModel.setIsNewGroupBtnCheckName(false) - }.launchIn(lifecycleScope) + newGroupViewModel.setIsGroupNameDuplicatedCheck(false) + }.launchIn(viewLifecycleOwner.lifecycleScope) } private fun collectNewGroupCheckNameState() { @@ -68,8 +68,7 @@ class NewGroupInputFragment : SNACKBAR_BOTTOM_MARGIN, SnackbarType.GUIDE ) - binding.etNewGroupInputGroupName.btnEditTextCheck.isEnabled = false - newGroupViewModel.setIsNewGroupBtnCheckName(true) + newGroupViewModel.setIsGroupNameDuplicatedCheck(true) } else { PingleSnackbar.makeSnackbar( binding.root, @@ -77,6 +76,7 @@ class NewGroupInputFragment : SNACKBAR_BOTTOM_MARGIN, SnackbarType.WARNING ) + newGroupViewModel.setIsGroupNameDuplicatedCheck(false) } AmplitudeUtils.trackEventWithProperty( COMPLETE_DOUBLECHECK, From ea5abd6c5a343b77f820d07de388fbae28bf73d4 Mon Sep 17 00:00:00 2001 From: jihyunniiii Date: Wed, 13 Mar 2024 14:58:58 +0900 Subject: [PATCH 3/8] =?UTF-8?q?[chore]=20#251=20lifecycleOwner=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/newgroup/newgroupinput/NewGroupInputFragment.kt | 7 ++++--- .../ui/newgroup/newgroupkeyword/NewGroupKeywordFragment.kt | 7 +++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt index 297d2db0..fd3d1b46 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt @@ -1,6 +1,7 @@ package org.sopt.pingle.presentation.ui.newgroup.newgroupinput import android.os.Bundle +import android.util.Log import android.view.View import androidx.fragment.app.activityViewModels import androidx.lifecycle.flowWithLifecycle @@ -49,14 +50,14 @@ class NewGroupInputFragment : } private fun collectNewGroupTeamNameIsEnabled() { - newGroupViewModel.newGroupName.flowWithLifecycle(lifecycle).onEach { newGroupName -> + newGroupViewModel.newGroupName.flowWithLifecycle(viewLifecycleOwner.lifecycle).onEach { newGroupName -> binding.etNewGroupInputGroupName.btnEditTextCheck.isEnabled = newGroupName.isNotBlank() newGroupViewModel.setIsGroupNameDuplicatedCheck(false) }.launchIn(viewLifecycleOwner.lifecycleScope) } private fun collectNewGroupCheckNameState() { - newGroupViewModel.newGroupCheckNameState.flowWithLifecycle(lifecycle) + newGroupViewModel.newGroupCheckNameState.flowWithLifecycle(viewLifecycleOwner.lifecycle) .distinctUntilChanged() .onEach { uiState -> when (uiState) { @@ -87,7 +88,7 @@ class NewGroupInputFragment : else -> {} } - }.launchIn(lifecycleScope) + }.launchIn(viewLifecycleOwner.lifecycleScope) } companion object { diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupkeyword/NewGroupKeywordFragment.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupkeyword/NewGroupKeywordFragment.kt index cf787485..2918bc8b 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupkeyword/NewGroupKeywordFragment.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupkeyword/NewGroupKeywordFragment.kt @@ -48,13 +48,12 @@ class NewGroupKeywordFragment : } private fun collectData() { - newGroupViewModel.newGroupKeywordsState.flowWithLifecycle(lifecycle).onEach { uiState -> + newGroupViewModel.newGroupKeywordsState.flowWithLifecycle(viewLifecycleOwner.lifecycle).onEach { uiState -> when (uiState) { is UiState.Success -> setChipKeyword(uiState.data) - - else -> {} + else -> Unit } - }.launchIn(lifecycleScope) + }.launchIn(viewLifecycleOwner.lifecycleScope) } private fun setChipKeyword(keywords: List) { From 136d29f15d7c96e70ae3f28de3ec325af1bf6aba Mon Sep 17 00:00:00 2001 From: jihyunniiii Date: Wed, 13 Mar 2024 15:07:31 +0900 Subject: [PATCH 4/8] =?UTF-8?q?[feat]=20#251=20=EC=A4=91=EB=B3=B5=ED=99=95?= =?UTF-8?q?=EC=9D=B8=20=EB=B2=84=ED=8A=BC=20=ED=81=B4=EB=A6=AD=20=EC=8B=9C?= =?UTF-8?q?=20=EB=8B=A8=EC=B2=B4=EB=AA=85=20=EC=95=9E=EB=92=A4=20=EA=B3=B5?= =?UTF-8?q?=EB=B0=B1=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/newgroup/newgroupinput/NewGroupInputFragment.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt index fd3d1b46..3693050f 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt @@ -41,7 +41,12 @@ class NewGroupInputFragment : } private fun addListeners() { - binding.etNewGroupInputGroupName.btnEditTextCheck.setOnClickListener { newGroupViewModel.getNewGroupCheckName() } + binding.etNewGroupInputGroupName.btnEditTextCheck.setOnClickListener { + with(newGroupViewModel) { + newGroupName.apply { value = value.trim() } + getNewGroupCheckName() + } + } } private fun collectData() { From 11f26bf1991107f7206e104feb41e613c37f3977 Mon Sep 17 00:00:00 2001 From: jihyunniiii Date: Wed, 13 Mar 2024 15:24:44 +0900 Subject: [PATCH 5/8] =?UTF-8?q?[feat]=20#251=20=EC=A4=91=EB=B3=B5=ED=99=95?= =?UTF-8?q?=EC=9D=B8=20=EB=B2=84=ED=8A=BC=20=ED=99=9C=EC=84=B1=ED=99=94/?= =?UTF-8?q?=EB=B9=84=ED=99=9C=EC=84=B1=ED=99=94=20=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newgroupinput/NewGroupInputFragment.kt | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt index 3693050f..3585a50f 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt @@ -33,13 +33,6 @@ class NewGroupInputFragment : collectData() } - override fun onResume() { - super.onResume() - - binding.etNewGroupInputGroupName.btnEditTextCheck.isEnabled = - newGroupViewModel.isNewGroupBtnCheckName.value - } - private fun addListeners() { binding.etNewGroupInputGroupName.btnEditTextCheck.setOnClickListener { with(newGroupViewModel) { @@ -50,12 +43,22 @@ class NewGroupInputFragment : } private fun collectData() { - collectNewGroupTeamNameIsEnabled() + collectIsGroupNameDuplicatedCheck() + collectNewGroupName() collectNewGroupCheckNameState() } - private fun collectNewGroupTeamNameIsEnabled() { - newGroupViewModel.newGroupName.flowWithLifecycle(viewLifecycleOwner.lifecycle).onEach { newGroupName -> + private fun collectIsGroupNameDuplicatedCheck() { + newGroupViewModel.isGroupNameDuplicatedCheck.flowWithLifecycle(viewLifecycleOwner.lifecycle) + .onEach { isGroupNameDuplicatedCheck -> + binding.etNewGroupInputGroupName.btnEditTextCheck.isEnabled = + !isGroupNameDuplicatedCheck && newGroupViewModel.newGroupName.value.isNotBlank() + }.launchIn(viewLifecycleOwner.lifecycleScope) + } + + private fun collectNewGroupName() { + newGroupViewModel.newGroupName.flowWithLifecycle(viewLifecycleOwner.lifecycle) + .distinctUntilChanged().onEach { newGroupName -> binding.etNewGroupInputGroupName.btnEditTextCheck.isEnabled = newGroupName.isNotBlank() newGroupViewModel.setIsGroupNameDuplicatedCheck(false) }.launchIn(viewLifecycleOwner.lifecycleScope) From ed138d40daf6b2546a4b69b9658688db936a550d Mon Sep 17 00:00:00 2001 From: jihyunniiii Date: Wed, 13 Mar 2024 15:25:04 +0900 Subject: [PATCH 6/8] [chore] #251 ktlintFormat --- .../ui/newgroup/newgroupinput/NewGroupInputFragment.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt index 3585a50f..02e2c6b1 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/newgroup/newgroupinput/NewGroupInputFragment.kt @@ -1,7 +1,6 @@ package org.sopt.pingle.presentation.ui.newgroup.newgroupinput import android.os.Bundle -import android.util.Log import android.view.View import androidx.fragment.app.activityViewModels import androidx.lifecycle.flowWithLifecycle @@ -59,9 +58,9 @@ class NewGroupInputFragment : private fun collectNewGroupName() { newGroupViewModel.newGroupName.flowWithLifecycle(viewLifecycleOwner.lifecycle) .distinctUntilChanged().onEach { newGroupName -> - binding.etNewGroupInputGroupName.btnEditTextCheck.isEnabled = newGroupName.isNotBlank() - newGroupViewModel.setIsGroupNameDuplicatedCheck(false) - }.launchIn(viewLifecycleOwner.lifecycleScope) + binding.etNewGroupInputGroupName.btnEditTextCheck.isEnabled = newGroupName.isNotBlank() + newGroupViewModel.setIsGroupNameDuplicatedCheck(false) + }.launchIn(viewLifecycleOwner.lifecycleScope) } private fun collectNewGroupCheckNameState() { From 793214dee2cb1cde158e4823e567083f14d381e2 Mon Sep 17 00:00:00 2001 From: jihyunniiii Date: Wed, 13 Mar 2024 15:31:03 +0900 Subject: [PATCH 7/8] =?UTF-8?q?[chore]=20#251=20versionCode=20=EC=97=85?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=8A=B8=20(16=20->=2017)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f01aa69a..a2175538 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -26,7 +26,7 @@ android { applicationId = "org.sopt.pingle" minSdk = 28 targetSdk = 34 - versionCode = 16 + versionCode = 17 versionName = "2.0.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" From a9551ddb41a2fd27b272d53961effe63b91bcc89 Mon Sep 17 00:00:00 2001 From: jihyunniiii Date: Wed, 13 Mar 2024 16:04:36 +0900 Subject: [PATCH 8/8] =?UTF-8?q?[chore]=20#251=20=EB=8B=A8=EC=B2=B4?= =?UTF-8?q?=EA=B0=9C=EC=84=A4=EC=99=84=EB=A3=8C=EB=B7=B0=20=EB=B7=B0=20?= =?UTF-8?q?=EA=B9=A8=EC=A7=80=EB=8A=94=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4?= =?UTF-8?q?=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/activity_new_group_announcement.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/layout/activity_new_group_announcement.xml b/app/src/main/res/layout/activity_new_group_announcement.xml index cc70873d..975da111 100644 --- a/app/src/main/res/layout/activity_new_group_announcement.xml +++ b/app/src/main/res/layout/activity_new_group_announcement.xml @@ -31,13 +31,13 @@