Skip to content

Commit

Permalink
[fix] #243 로그아웃/탈퇴 후 온보딩, 최초 접속 시 온보딩 뒤로가기 버튼 로직 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
HAJIEUN02 committed Mar 12, 2024
1 parent 2cf81e5 commit b95ce26
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -28,10 +31,18 @@ class AuthActivity : BindingActivity<ActivityAuthBinding>(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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -135,6 +136,7 @@ class MoreFragment : BindingFragment<FragmentMoreBinding>(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)
}
}
Expand Down Expand Up @@ -186,5 +188,7 @@ class MoreFragment : BindingFragment<FragmentMoreBinding>(R.layout.fragment_more
private const val WITHDRAW_APP = "withdraw_app"

private const val START_MYGROUP = "start_mygroup"

const val MORE_FRAGMENT = "MoreFragment"
}
}

0 comments on commit b95ce26

Please sign in to comment.