From 09fed54e779dc0e502bda98cddd74c66302a1c55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=9A=B0?= Date: Sun, 10 Mar 2024 19:28:56 +0900 Subject: [PATCH 01/11] =?UTF-8?q?[fix]=20#242=20=EA=B8=B0=EC=A1=B4?= =?UTF-8?q?=EB=8B=A8=EC=B2=B4=EC=9E=85=EC=9E=A5=20=EB=8B=A8=EC=B2=B4=20?= =?UTF-8?q?=ED=82=A4=EC=9B=8C=EB=93=9C=20=EC=A0=95=EB=A0=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../res/layout/item_join_group_search.xml | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/app/src/main/res/layout/item_join_group_search.xml b/app/src/main/res/layout/item_join_group_search.xml index 19d053b04..f6a044664 100644 --- a/app/src/main/res/layout/item_join_group_search.xml +++ b/app/src/main/res/layout/item_join_group_search.xml @@ -22,39 +22,49 @@ android:orientation="vertical" app:layout_constraintGuide_begin="@dimen/spacing18" /> + + + app:layout_constraintGuide_end="@dimen/spacing10" /> - + + + app:layout_constraintTop_toBottomOf="@id/gl_top" /> @@ -63,7 +73,7 @@ android:id="@+id/iv_join_group_search_check" android:layout_width="0dp" android:layout_height="wrap_content" - android:layout_marginEnd="@dimen/spacing10" + android:layout_marginEnd="10dp" android:src="@{joinGroupSearch.isSelected ? @drawable/ic_all_check_selected_24 : @drawable/ic_all_check_default_24}" app:layout_constraintBottom_toBottomOf="@id/tv_join_group_search_tag" app:layout_constraintEnd_toStartOf="@id/gl_end" From ad1214019bf73f08475573c58e2173c715e80f92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=9A=B0?= Date: Sun, 10 Mar 2024 19:53:47 +0900 Subject: [PATCH 02/11] =?UTF-8?q?[fix]=20#242=20=EC=86=8C=EC=85=9C?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=ED=9B=84=20=EC=95=B1=20=EC=9E=AC?= =?UTF-8?q?=EC=8B=A4=ED=96=89=EC=8B=9C=20=EC=9E=85=EC=9E=A5=EB=B0=A9?= =?UTF-8?q?=EC=8B=9D=EC=84=A0=ED=83=9D=ED=99=94=EB=A9=B4=EC=9C=BC=EB=A1=9C?= =?UTF-8?q?=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/ui/splash/SplashActivity.kt | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/splash/SplashActivity.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/splash/SplashActivity.kt index 2983156d2..16fd3fe65 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/splash/SplashActivity.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/splash/SplashActivity.kt @@ -2,17 +2,19 @@ package org.sopt.pingle.presentation.ui.splash import android.content.Intent import android.os.Bundle +import android.util.Log import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen import androidx.lifecycle.lifecycleScope import dagger.hilt.android.AndroidEntryPoint -import javax.inject.Inject import kotlinx.coroutines.delay import kotlinx.coroutines.launch import org.sopt.pingle.R import org.sopt.pingle.data.datasource.local.PingleLocalDataSource import org.sopt.pingle.databinding.ActivitySplashBinding +import org.sopt.pingle.presentation.ui.onboarding.onboarding.OnboardingActivity import org.sopt.pingle.presentation.ui.onboarding.onboardingexplanation.OnboardingExplanationActivity import org.sopt.pingle.util.base.BindingActivity +import javax.inject.Inject @AndroidEntryPoint class SplashActivity : BindingActivity(R.layout.activity_splash) { @@ -27,17 +29,28 @@ class SplashActivity : BindingActivity(R.layout.activity_ private fun loadSplashScreen() { lifecycleScope.launch { delay(SPLASH_SCREEN_DELAY_TIME) - navigateToAuth() + if (localStorage.accessToken != "") { + navigateToOnboarding() + } else { + navigateToOnboardingExplanation() + } } } - private fun navigateToAuth() { + private fun navigateToOnboardingExplanation() { Intent(this, OnboardingExplanationActivity::class.java).apply { startActivity(this) } finish() } + private fun navigateToOnboarding() { + Intent(this, OnboardingActivity::class.java).apply { + startActivity(this) + } + finish() + } + companion object { const val SPLASH_SCREEN_DELAY_TIME = 1500L } From 36da6415ab6868a2cf817f6adce3cf41281467d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=9A=B0?= Date: Sun, 10 Mar 2024 20:29:11 +0900 Subject: [PATCH 03/11] =?UTF-8?q?[fix]=20#242=20=EC=86=8C=EC=85=9C?= =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=ED=9B=84=20=EC=95=B1=20=EC=9E=AC?= =?UTF-8?q?=EC=8B=A4=ED=96=89=EC=8B=9C=20=EC=9E=85=EC=9E=A5=EB=B0=A9?= =?UTF-8?q?=EC=8B=9D=EC=84=A0=ED=83=9D=ED=99=94=EB=A9=B4=EC=9C=BC=EB=A1=9C?= =?UTF-8?q?=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/ui/splash/SplashActivity.kt | 43 +++++++++++++------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/splash/SplashActivity.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/splash/SplashActivity.kt index 16fd3fe65..11ead4b11 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/splash/SplashActivity.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/splash/SplashActivity.kt @@ -2,43 +2,55 @@ package org.sopt.pingle.presentation.ui.splash import android.content.Intent import android.os.Bundle -import android.util.Log +import androidx.activity.viewModels import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen +import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.delay +import kotlinx.coroutines.flow.launchIn +import kotlinx.coroutines.flow.onEach import kotlinx.coroutines.launch import org.sopt.pingle.R -import org.sopt.pingle.data.datasource.local.PingleLocalDataSource import org.sopt.pingle.databinding.ActivitySplashBinding +import org.sopt.pingle.presentation.ui.auth.AuthViewModel +import org.sopt.pingle.presentation.ui.main.MainActivity import org.sopt.pingle.presentation.ui.onboarding.onboarding.OnboardingActivity import org.sopt.pingle.presentation.ui.onboarding.onboardingexplanation.OnboardingExplanationActivity import org.sopt.pingle.util.base.BindingActivity -import javax.inject.Inject +import org.sopt.pingle.util.view.UiState @AndroidEntryPoint class SplashActivity : BindingActivity(R.layout.activity_splash) { - @Inject - lateinit var localStorage: PingleLocalDataSource + private val authViewModel by viewModels() + override fun onCreate(savedInstanceState: Bundle?) { installSplashScreen() super.onCreate(savedInstanceState) loadSplashScreen() + collectData() } private fun loadSplashScreen() { lifecycleScope.launch { delay(SPLASH_SCREEN_DELAY_TIME) - if (localStorage.accessToken != "") { - navigateToOnboarding() - } else { - navigateToOnboardingExplanation() - } + if (authViewModel.isLocalToken()) { + if (authViewModel.isLocalGroupId()) navigateToMain() else authViewModel.getUserInfo() + } else navigateToOnboardingExplanation() } } - private fun navigateToOnboardingExplanation() { - Intent(this, OnboardingExplanationActivity::class.java).apply { + private fun collectData() { + authViewModel.userInfoState.flowWithLifecycle(lifecycle).onEach { uiState -> + when (uiState) { + is UiState.Success -> if (uiState.data.groups.isEmpty()) navigateToOnboarding() else navigateToMain() + else -> Unit + } + }.launchIn(lifecycleScope) + } + + private fun navigateToMain() { + Intent(this, MainActivity::class.java).apply { startActivity(this) } finish() @@ -51,6 +63,13 @@ class SplashActivity : BindingActivity(R.layout.activity_ finish() } + private fun navigateToOnboardingExplanation() { + Intent(this, OnboardingExplanationActivity::class.java).apply { + startActivity(this) + } + finish() + } + companion object { const val SPLASH_SCREEN_DELAY_TIME = 1500L } From 6e522f3950ffea0485cf1f8eac862df271a0a520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=9A=B0?= Date: Sun, 10 Mar 2024 20:31:18 +0900 Subject: [PATCH 04/11] =?UTF-8?q?[fix]=20#242=20=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=84=B0=20=ED=85=8D=EC=86=8C=EB=85=B8=EB=AF=B8=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=A1=A4=20=EC=8B=9C=EC=A0=90=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pingle/presentation/ui/main/mypingle/MyPingleFragment.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/main/mypingle/MyPingleFragment.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/main/mypingle/MyPingleFragment.kt index 8afdf42c8..49cffa92c 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/main/mypingle/MyPingleFragment.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/main/mypingle/MyPingleFragment.kt @@ -58,7 +58,7 @@ class MyPingleFragment : BindingFragment(R.layout.fragm binding.rvMyPingle.addOnScrollListener(object : RecyclerView.OnScrollListener() { override fun onScrollStateChanged(recyclerView: RecyclerView, newState: Int) { super.onScrollStateChanged(recyclerView, newState) - if (newState == RecyclerView.SCROLL_STATE_IDLE) { + if (newState == RecyclerView.SCROLL_STATE_DRAGGING) { when (viewModel.myPingleType.value) { MyPingleType.SOON -> AmplitudeUtils.trackEvent(SCROLL_SOONPINGLE) MyPingleType.DONE -> AmplitudeUtils.trackEvent(SCROLL_DONEPINGLE) From 50ba71451ad043645880536f204bda8db7cd9030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=9A=B0?= Date: Sun, 10 Mar 2024 23:49:38 +0900 Subject: [PATCH 05/11] =?UTF-8?q?[fix]=20#242=20=EC=95=88=EB=82=B4?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EA=B0=94=EB=8B=A4=20=EB=8F=8C?= =?UTF-8?q?=EC=95=84=EC=98=A4=EB=A9=B4=20=EC=8A=A4=EB=82=B5=EB=B0=94=20?= =?UTF-8?q?=ED=98=B8=EC=B6=9C=EB=90=98=EB=8A=94=20=ED=98=84=EC=83=81=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/newgroup/newgroupinput/NewGroupInputFragment.kt | 5 ++++- 1 file changed, 4 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 05a4c9a40..094944fc1 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 @@ -6,6 +6,7 @@ import androidx.fragment.app.activityViewModels import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope import dagger.hilt.android.AndroidEntryPoint +import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import org.sopt.pingle.R @@ -48,7 +49,9 @@ class NewGroupInputFragment : } private fun collectNewGroupCheckNameState() { - newGroupViewModel.newGroupCheckNameState.flowWithLifecycle(lifecycle).onEach { uiState -> + newGroupViewModel.newGroupCheckNameState.flowWithLifecycle(lifecycle) + .distinctUntilChanged() + .onEach { uiState -> when (uiState) { is UiState.Success -> { if (uiState.data.result) { From 97e117a8d67d8c5b62334790c2066bc979d489b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=9A=B0?= Date: Mon, 11 Mar 2024 00:07:43 +0900 Subject: [PATCH 06/11] =?UTF-8?q?[fix]=20#242=20=EB=8B=A8=EC=B2=B4?= =?UTF-8?q?=EB=AA=85=202=EC=A4=84=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pingle/presentation/ui/joingroup/JoinGroupCodeActivity.kt | 4 ++-- .../sopt/pingle/presentation/ui/joingroup/JoinViewModel.kt | 2 +- app/src/main/res/layout/activity_join_group_code.xml | 4 +++- app/src/main/res/layout/activity_new_group_announcement.xml | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/joingroup/JoinGroupCodeActivity.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/joingroup/JoinGroupCodeActivity.kt index db81b8b8c..aef9cd322 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/joingroup/JoinGroupCodeActivity.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/joingroup/JoinGroupCodeActivity.kt @@ -61,9 +61,9 @@ class JoinGroupCodeActivity : } private fun addObservers() { - viewModel.joinGroupCodeEditText.observe(this) { editText -> + viewModel.joinGroupCodeEditText.flowWithLifecycle(lifecycle).onEach { editText -> binding.btnJoinGroupCodeNext.isEnabled = editText.isNotEmpty() - } + }.launchIn(lifecycleScope) } private fun collectData() { diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/joingroup/JoinViewModel.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/joingroup/JoinViewModel.kt index e8b6a613c..d0c94d1e7 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/joingroup/JoinViewModel.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/joingroup/JoinViewModel.kt @@ -45,7 +45,7 @@ class JoinViewModel @Inject constructor( MutableStateFlow>(UiState.Empty) val joinGroupCodeState get() = _joinGroupCodeState - val joinGroupCodeEditText = MutableLiveData() + val joinGroupCodeEditText = MutableStateFlow("") private var oldPosition = DEFAULT_OLD_POSITION diff --git a/app/src/main/res/layout/activity_join_group_code.xml b/app/src/main/res/layout/activity_join_group_code.xml index 30afa9b5f..2404b54e3 100644 --- a/app/src/main/res/layout/activity_join_group_code.xml +++ b/app/src/main/res/layout/activity_join_group_code.xml @@ -108,8 +108,10 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginTop="4dp" + android:maxLines="2" android:textAppearance="@style/TextAppearance.Pingle.Title.Semi.24" android:textColor="@color/black" + app:layout_constraintEnd_toStartOf="@id/gl_group_info_end" app:layout_constraintStart_toEndOf="@id/gl_group_info_start" app:layout_constraintTop_toBottomOf="@id/tv_join_group_code_tag" tools:text="SOPT" /> @@ -170,8 +172,8 @@ app:layout_constraintEnd_toStartOf="@id/gl_end" app:layout_constraintStart_toEndOf="@id/gl_start" app:layout_constraintTop_toBottomOf="@id/layout_join_group_code_group_info" - app:pingleEditTextMaxLength="12" app:pingleEditTextHint="@string/join_group_code_invitation_hint" + app:pingleEditTextMaxLength="12" app:pingleEditTextTitle="@string/join_group_code_invitation" /> From 026363e95e71f38c39c87cf76d8f5a30397a4059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=9A=B0?= Date: Tue, 12 Mar 2024 03:21:55 +0900 Subject: [PATCH 07/11] =?UTF-8?q?[fix]=20#242=20=EC=95=88=EB=82=B4?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80,=20=EB=92=A4=EB=A1=9C=EA=B0=80?= =?UTF-8?q?=EA=B8=B0=20=EC=8B=9C=20chip=20=EC=84=A0=ED=83=9D=20=ED=95=B4?= =?UTF-8?q?=EC=A0=9C=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../newgroupkeyword/NewGroupKeywordFragment.kt | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 79a7d677b..a2ff6604e 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 @@ -28,6 +28,18 @@ class NewGroupKeywordFragment : collectData() } + override fun onResume() { + super.onResume() + if (newGroupViewModel.newGroupKeywordValue.value.isNotEmpty()) { + for (i in 0 until binding.cgNewGroupKeyword.childCount) { + val childChip = binding.cgNewGroupKeyword.getChildAt(i) as Chip + if (childChip.text == newGroupViewModel.newGroupKeywordValue.value) { + childChip.isChecked = true + } + } + } + } + private fun initLayout() { newGroupViewModel.getNewGroupKeywords() } From 9de8b093b5ba8b72e78167bd2c7ca4d651c1ecca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=9A=B0?= Date: Tue, 12 Mar 2024 03:23:19 +0900 Subject: [PATCH 08/11] =?UTF-8?q?[chore]=20#242=20ktlint=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/joingroup/JoinViewModel.kt | 1 - .../newgroupinput/NewGroupInputFragment.kt | 48 ++++++++++--------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/joingroup/JoinViewModel.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/joingroup/JoinViewModel.kt index d0c94d1e7..a91bee370 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/joingroup/JoinViewModel.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/joingroup/JoinViewModel.kt @@ -1,6 +1,5 @@ package org.sopt.pingle.presentation.ui.joingroup -import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import dagger.hilt.android.lifecycle.HiltViewModel 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 094944fc1..237d8f1f1 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 @@ -52,31 +52,35 @@ class NewGroupInputFragment : newGroupViewModel.newGroupCheckNameState.flowWithLifecycle(lifecycle) .distinctUntilChanged() .onEach { uiState -> - when (uiState) { - is UiState.Success -> { - if (uiState.data.result) { - PingleSnackbar.makeSnackbar( - binding.root, - stringOf(R.string.new_group_input_snackbar_guide), - SNACKBAR_BOTTOM_MARGIN, - SnackbarType.GUIDE - ) - binding.etNewGroupInputGroupName.btnEditTextCheck.isEnabled = false - newGroupViewModel.setIsNewGroupBtnCheckName(true) - } else { - PingleSnackbar.makeSnackbar( - binding.root, - stringOf(R.string.new_group_input_snackbar_warning), - SNACKBAR_BOTTOM_MARGIN, - SnackbarType.WARNING + when (uiState) { + is UiState.Success -> { + if (uiState.data.result) { + PingleSnackbar.makeSnackbar( + binding.root, + stringOf(R.string.new_group_input_snackbar_guide), + SNACKBAR_BOTTOM_MARGIN, + SnackbarType.GUIDE + ) + binding.etNewGroupInputGroupName.btnEditTextCheck.isEnabled = false + newGroupViewModel.setIsNewGroupBtnCheckName(true) + } else { + PingleSnackbar.makeSnackbar( + binding.root, + stringOf(R.string.new_group_input_snackbar_warning), + SNACKBAR_BOTTOM_MARGIN, + SnackbarType.WARNING + ) + } + AmplitudeUtils.trackEventWithProperty( + COMPLETE_DOUBLECHECK, + GROUP_NAME, + binding.etNewGroupInputGroupName.editText.text ) } - AmplitudeUtils.trackEventWithProperty(COMPLETE_DOUBLECHECK, GROUP_NAME, binding.etNewGroupInputGroupName.editText.text) - } - else -> {} - } - }.launchIn(lifecycleScope) + else -> {} + } + }.launchIn(lifecycleScope) } companion object { From 0d7ce9315a2868c3730a92c48425e8d96893dfb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=9A=B0?= Date: Tue, 12 Mar 2024 03:29:06 +0900 Subject: [PATCH 09/11] =?UTF-8?q?[chore]=20#242=20ktlint=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/sopt/pingle/presentation/ui/splash/SplashActivity.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/splash/SplashActivity.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/splash/SplashActivity.kt index 11ead4b11..5162687c6 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/splash/SplashActivity.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/splash/SplashActivity.kt @@ -36,7 +36,9 @@ class SplashActivity : BindingActivity(R.layout.activity_ delay(SPLASH_SCREEN_DELAY_TIME) if (authViewModel.isLocalToken()) { if (authViewModel.isLocalGroupId()) navigateToMain() else authViewModel.getUserInfo() - } else navigateToOnboardingExplanation() + } else { + navigateToOnboardingExplanation() + } } } From 00f7cad96396ef5e4cc030dd099c64a946a9c94f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=9A=B0?= Date: Tue, 12 Mar 2024 20:45:08 +0900 Subject: [PATCH 10/11] =?UTF-8?q?[chore]=20#242=20=EC=BD=94=EB=93=9C?= =?UTF-8?q?=EB=A6=AC=EB=B7=B0=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/joingroup/JoinGroupCodeActivity.kt | 11 ++++------- .../newgroup/newgroupinput/NewGroupInputFragment.kt | 7 +++++++ .../newgroupkeyword/NewGroupKeywordFragment.kt | 13 ++++++++----- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/joingroup/JoinGroupCodeActivity.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/joingroup/JoinGroupCodeActivity.kt index aef9cd322..e6ca4682b 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/joingroup/JoinGroupCodeActivity.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/joingroup/JoinGroupCodeActivity.kt @@ -32,7 +32,6 @@ class JoinGroupCodeActivity : initLayout() addListeners() - addObservers() collectData() } @@ -60,12 +59,6 @@ class JoinGroupCodeActivity : } } - private fun addObservers() { - viewModel.joinGroupCodeEditText.flowWithLifecycle(lifecycle).onEach { editText -> - binding.btnJoinGroupCodeNext.isEnabled = editText.isNotEmpty() - }.launchIn(lifecycleScope) - } - private fun collectData() { viewModel.joinGroupInfoState.flowWithLifecycle(lifecycle).onEach { uiState -> when (uiState) { @@ -131,6 +124,10 @@ class JoinGroupCodeActivity : is UiState.Empty -> Timber.tag(JOIN_GROUP_CODE_ACTIVITY).d(EMPTY) } }.launchIn(lifecycleScope) + + viewModel.joinGroupCodeEditText.flowWithLifecycle(lifecycle).onEach { editText -> + binding.btnJoinGroupCodeNext.isEnabled = editText.isNotEmpty() + }.launchIn(lifecycleScope) } private fun navigateToJoinGroupSuccess() { 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 237d8f1f1..9a9fb21cc 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 @@ -32,6 +32,13 @@ class NewGroupInputFragment : collectData() } + override fun onResume() { + super.onResume() + + binding.etNewGroupInputGroupName.btnEditTextCheck.isEnabled = + newGroupViewModel.isNewGroupBtnCheckName.value + } + private fun addListeners() { binding.etNewGroupInputGroupName.btnEditTextCheck.setOnClickListener { newGroupViewModel.getNewGroupCheckName() } } 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 a2ff6604e..f25b1af02 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 @@ -2,6 +2,7 @@ package org.sopt.pingle.presentation.ui.newgroup.newgroupkeyword import android.os.Bundle import android.view.View +import androidx.core.view.forEach import androidx.fragment.app.activityViewModels import androidx.lifecycle.flowWithLifecycle import androidx.lifecycle.lifecycleScope @@ -30,11 +31,13 @@ class NewGroupKeywordFragment : override fun onResume() { super.onResume() - if (newGroupViewModel.newGroupKeywordValue.value.isNotEmpty()) { - for (i in 0 until binding.cgNewGroupKeyword.childCount) { - val childChip = binding.cgNewGroupKeyword.getChildAt(i) as Chip - if (childChip.text == newGroupViewModel.newGroupKeywordValue.value) { - childChip.isChecked = true + + with(newGroupViewModel.newGroupKeywordValue.value) { + if(isNotEmpty()) { + binding.cgNewGroupKeyword.forEach { childChip -> + (childChip as Chip).let { chip -> + if (chip.text == this) chip.isChecked = true + } } } } From a795777d6dec3c554330403be7df8fbb19b0db8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=9A=B0?= Date: Tue, 12 Mar 2024 20:46:14 +0900 Subject: [PATCH 11/11] =?UTF-8?q?[chore]=20#242=20ktlint=20=EC=A0=81?= =?UTF-8?q?=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/newgroup/newgroupkeyword/NewGroupKeywordFragment.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 f25b1af02..cf7874854 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 @@ -33,9 +33,9 @@ class NewGroupKeywordFragment : super.onResume() with(newGroupViewModel.newGroupKeywordValue.value) { - if(isNotEmpty()) { + if (isNotEmpty()) { binding.cgNewGroupKeyword.forEach { childChip -> - (childChip as Chip).let { chip -> + (childChip as Chip).let { chip -> if (chip.text == this) chip.isChecked = true } }