diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/auth/AuthActivity.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/auth/AuthActivity.kt index b038f0fc..d0fe5724 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/auth/AuthActivity.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/auth/AuthActivity.kt @@ -13,8 +13,11 @@ import org.sopt.pingle.R import org.sopt.pingle.data.service.KakaoAuthService import org.sopt.pingle.databinding.ActivityAuthBinding import org.sopt.pingle.presentation.ui.main.MainActivity +import org.sopt.pingle.presentation.ui.main.more.MoreFragment.Companion.MORE_FRAGMENT import org.sopt.pingle.presentation.ui.onboarding.onboarding.OnboardingActivity +import org.sopt.pingle.presentation.ui.onboarding.onboarding.OnboardingActivity.Companion.FROM_ACTIVITY import org.sopt.pingle.util.AmplitudeUtils +import org.sopt.pingle.util.activity.setDoubleBackPressToExit import org.sopt.pingle.util.base.BindingActivity import org.sopt.pingle.util.view.UiState import timber.log.Timber @@ -28,10 +31,18 @@ class AuthActivity : BindingActivity(R.layout.activity_auth override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + initLayout() addListeners() collectData() } + private fun initLayout() { + when (intent.getStringExtra(FROM_ACTIVITY)) { + MORE_FRAGMENT -> setDoubleBackPressToExit(binding.root) + else -> Unit + } + } + private fun addListeners() { binding.btnAuthKakao.setOnClickListener { kakaoAuthService.loginKakao(viewModel::login, viewModel::saveAccount) diff --git a/app/src/main/java/org/sopt/pingle/presentation/ui/main/more/MoreFragment.kt b/app/src/main/java/org/sopt/pingle/presentation/ui/main/more/MoreFragment.kt index 1e5e1441..ac333c66 100644 --- a/app/src/main/java/org/sopt/pingle/presentation/ui/main/more/MoreFragment.kt +++ b/app/src/main/java/org/sopt/pingle/presentation/ui/main/more/MoreFragment.kt @@ -17,6 +17,7 @@ import org.sopt.pingle.databinding.FragmentMoreBinding import org.sopt.pingle.presentation.type.SnackbarType import org.sopt.pingle.presentation.ui.auth.AuthActivity import org.sopt.pingle.presentation.ui.mygroup.MyGroupActivity +import org.sopt.pingle.presentation.ui.onboarding.onboarding.OnboardingActivity.Companion.FROM_ACTIVITY import org.sopt.pingle.util.AmplitudeUtils import org.sopt.pingle.util.base.BindingFragment import org.sopt.pingle.util.component.AllModalDialogFragment @@ -135,6 +136,7 @@ class MoreFragment : BindingFragment(R.layout.fragment_more private fun navigateToAuth() { Intent(requireContext(), AuthActivity::class.java).apply { flags = Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK + putExtra(FROM_ACTIVITY, MORE_FRAGMENT) startActivity(this) } } @@ -186,5 +188,7 @@ class MoreFragment : BindingFragment(R.layout.fragment_more private const val WITHDRAW_APP = "withdraw_app" private const val START_MYGROUP = "start_mygroup" + + const val MORE_FRAGMENT = "MoreFragment" } }