diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index a63b2cb5..c182e214 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -22,6 +22,11 @@ android:screenOrientation="portrait" android:theme="@style/Theme.Winey.SplashScreen"> + + + + + @@ -34,15 +39,7 @@ android:name=".presentation.main.feed.upload.UploadActivity" android:exported="true" android:screenOrientation="portrait" - android:windowSoftInputMode="adjustResize" > - - - - - - - - + android:windowSoftInputMode="adjustResize" /> (R.layout.activity_loading) { override fun onCreate(savedInstanceState: Bundle?) { @@ -20,7 +21,6 @@ class LoadingActivity : BindingActivity(R.layout.activit private fun classifySaveItemCategory() { val amountString = intent.extras?.getString(EXTRA_AMOUNT_KEY, "") ?: return val amount = amountString.toLong() - val amountRange = resources.getIntArray(R.array.save_amount_range) val itemCategories = resources.getStringArray(R.array.save_item_categories) @@ -38,12 +38,13 @@ class LoadingActivity : BindingActivity(R.layout.activit } private fun delayMillis() { - Handler(Looper.getMainLooper()).postDelayed({ - navigateMainScreen() - }, DELAY_TIME) + lifecycleScope.launch { + delay(DELAY_TIME) + navigateToMainScreen() + } } - private fun navigateMainScreen() { + private fun navigateToMainScreen() { Intent(this, MainActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK) startActivity(this) diff --git a/app/src/main/java/com/android/go/sopt/winey/presentation/splash/SplashActivity.kt b/app/src/main/java/com/android/go/sopt/winey/presentation/splash/SplashActivity.kt index 735e0c16..ff85ca41 100644 --- a/app/src/main/java/com/android/go/sopt/winey/presentation/splash/SplashActivity.kt +++ b/app/src/main/java/com/android/go/sopt/winey/presentation/splash/SplashActivity.kt @@ -2,22 +2,24 @@ package com.android.go.sopt.winey.presentation.splash import android.content.Intent import android.os.Bundle -import android.os.Handler -import android.os.Looper -import androidx.appcompat.app.AppCompatActivity +import androidx.lifecycle.lifecycleScope import com.android.go.sopt.winey.R +import com.android.go.sopt.winey.databinding.ActivitySplashBinding import com.android.go.sopt.winey.presentation.main.MainActivity +import com.android.go.sopt.winey.util.binding.BindingActivity import dagger.hilt.android.AndroidEntryPoint +import kotlinx.coroutines.delay +import kotlinx.coroutines.launch @AndroidEntryPoint -class SplashActivity : AppCompatActivity() { +class SplashActivity : BindingActivity(R.layout.activity_splash) { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.activity_splash) - Handler(Looper.getMainLooper()).postDelayed({ + lifecycleScope.launch { + delay(DELAY_TIME) navigateToMainScreen() - }, DELAY_TIME) + } } private fun navigateToMainScreen() { diff --git a/app/src/main/res/layout/activity_splash.xml b/app/src/main/res/layout/activity_splash.xml index fcf98827..acf9ee8c 100644 --- a/app/src/main/res/layout/activity_splash.xml +++ b/app/src/main/res/layout/activity_splash.xml @@ -1,19 +1,26 @@ - + - + - \ No newline at end of file + + + + + + + + diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 5ed339f8..44c26eb7 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -31,8 +31,7 @@ @android:color/transparent @style/Theme.Winey - @color/black false - \ No newline at end of file +