-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix] 3차 스프린트 QA 수정사항 반영 #249
Changes from all commits
09fed54
ad12140
36da641
6e522f3
50ba714
97e117a
026363e
9de8b09
0d7ce93
00f7cad
a795777
f28c8bf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -31,6 +32,13 @@ class NewGroupInputFragment : | |
collectData() | ||
} | ||
|
||
override fun onResume() { | ||
super.onResume() | ||
|
||
binding.etNewGroupInputGroupName.btnEditTextCheck.isEnabled = | ||
newGroupViewModel.isNewGroupBtnCheckName.value | ||
} | ||
|
||
private fun addListeners() { | ||
Comment on lines
+35
to
42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 좋네요 ~ |
||
binding.etNewGroupInputGroupName.btnEditTextCheck.setOnClickListener { newGroupViewModel.getNewGroupCheckName() } | ||
} | ||
|
@@ -48,32 +56,38 @@ class NewGroupInputFragment : | |
} | ||
|
||
private fun collectNewGroupCheckNameState() { | ||
newGroupViewModel.newGroupCheckNameState.flowWithLifecycle(lifecycle).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 | ||
newGroupViewModel.newGroupCheckNameState.flowWithLifecycle(lifecycle) | ||
.distinctUntilChanged() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기서도 distinctUntilChange를 안 쓰면 안 되는 문제가 생겼었나 보네요,, 무슨 문제였나요?? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이거 지도뷰랑 같은 문제염 ㅜㅜ 위에 액티비티 떴다가 사라지면 값이 같은데도 방출쓰 |
||
.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 | ||
) | ||
} | ||
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 { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,36 +2,70 @@ package org.sopt.pingle.presentation.ui.splash | |
|
||
import android.content.Intent | ||
import android.os.Bundle | ||
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 javax.inject.Inject | ||
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 org.sopt.pingle.util.view.UiState | ||
|
||
@AndroidEntryPoint | ||
class SplashActivity : BindingActivity<ActivitySplashBinding>(R.layout.activity_splash) { | ||
@Inject | ||
lateinit var localStorage: PingleLocalDataSource | ||
private val authViewModel by viewModels<AuthViewModel>() | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
installSplashScreen() | ||
super.onCreate(savedInstanceState) | ||
loadSplashScreen() | ||
collectData() | ||
} | ||
|
||
private fun loadSplashScreen() { | ||
lifecycleScope.launch { | ||
delay(SPLASH_SCREEN_DELAY_TIME) | ||
navigateToAuth() | ||
if (authViewModel.isLocalToken()) { | ||
if (authViewModel.isLocalGroupId()) navigateToMain() else authViewModel.getUserInfo() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 저는 여기 authViewModel.getUserInfo() 다음에 navigateToOnboarding()을 넣어주는 방식으로 구현했었는데 |
||
} else { | ||
navigateToOnboardingExplanation() | ||
} | ||
} | ||
} | ||
|
||
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() | ||
} | ||
|
||
private fun navigateToOnboarding() { | ||
Intent(this, OnboardingActivity::class.java).apply { | ||
startActivity(this) | ||
} | ||
finish() | ||
} | ||
|
||
private fun navigateToAuth() { | ||
private fun navigateToOnboardingExplanation() { | ||
Intent(this, OnboardingExplanationActivity::class.java).apply { | ||
startActivity(this) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
중복확인 후 안내 페이지 띄웠을 때 중복확인 버튼이 비활성화 안 되어 있는 문제
-> onResume에 btnEditTextCheck.isEnabled 값 세팅해주기