Skip to content

Commit

Permalink
#146 / SplashActivity 삭제 및 IntroActivity 생성, 로직 이동
Browse files Browse the repository at this point in the history
  • Loading branch information
taeheeL committed Dec 10, 2023
1 parent 23ee603 commit 99e1d5e
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 43 deletions.
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
android:usesCleartextTraffic="true"
tools:targetApi="31">
<activity
android:name=".presentation.SplashActivity"
android:name=".presentation.IntroActivity"
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
Expand Down
41 changes: 41 additions & 0 deletions app/src/main/java/sopt/uni/presentation/IntroActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package sopt.uni.presentation

import android.content.Intent
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import dagger.hilt.android.AndroidEntryPoint
import sopt.uni.data.datasource.local.SparkleStorage
import sopt.uni.presentation.home.HomeActivity
import sopt.uni.presentation.invite.NickNameActivity
import sopt.uni.presentation.onboarding.OnBoardingActivity
import sopt.uni.util.extension.startActivity

@AndroidEntryPoint
class IntroActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

checkUserStatus()
}

private fun checkUserStatus() {
if (SparkleStorage.accessToken != null) {
if (SparkleStorage.partnerId != -1) {
startActivity<HomeActivity>()
Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK
} else {
startActivity<NickNameActivity>()
Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK
}
} else {
if (SparkleStorage.partnerId != -1) {
startActivity<HomeActivity>()
Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK
} else {
startActivity<OnBoardingActivity>()
Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK
}
}
overridePendingTransition(0, 0)
}
}
42 changes: 0 additions & 42 deletions app/src/main/java/sopt/uni/presentation/SplashActivity.kt

This file was deleted.

0 comments on commit 99e1d5e

Please sign in to comment.