Skip to content

Commit

Permalink
[#30] 로그인 기능 추가 - 로그인 및 회원가입 완료 시 MainActivity 이동
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-223 committed Sep 4, 2022
1 parent ae3212c commit b39916d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.google.android.gms.auth.api.identity.SignInClient
import com.google.android.gms.common.api.ApiException
import com.google.android.gms.common.api.CommonStatusCodes
import com.moyerun.moyeorun_android.BuildConfig
import com.moyerun.moyeorun_android.MainActivity
import com.moyerun.moyeorun_android.R
import com.moyerun.moyeorun_android.common.Lg
import com.moyerun.moyeorun_android.common.extension.observeEvent
Expand Down Expand Up @@ -68,8 +69,8 @@ class LoginActivity : AppCompatActivity() {
observeEvent(viewModel.loginEvent) { event ->
when (event) {
is LoginEvent.RegisteredUser -> {
// Todo: 메인 화면으로 이동
Lg.d("Login!")
startActivity(Intent(this, MainActivity::class.java))
finish()
}
is LoginEvent.NewUser -> {
ProfileEditActivity.startActivity(this, event.signUpMetaData)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import androidx.activity.result.contract.ActivityResultContracts
import androidx.activity.viewModels
import androidx.appcompat.app.AppCompatActivity
import androidx.core.widget.doAfterTextChanged
import com.moyerun.moyeorun_android.MainActivity
import com.moyerun.moyeorun_android.R
import com.moyerun.moyeorun_android.common.Lg
import com.moyerun.moyeorun_android.common.extension.*
Expand Down Expand Up @@ -122,8 +123,7 @@ class ProfileEditActivity : AppCompatActivity() {
observeEvent(viewModel.profileEvent) {
when (it) {
ProfileEvent.SUCCESS_SIGN_UP -> {
// Todo: 환영 액티비티로 이동
Lg.d("observeEvent : Go to welcome activity!")
startActivity(Intent(this, MainActivity::class.java))
}
}
}
Expand Down

0 comments on commit b39916d

Please sign in to comment.