diff --git a/app/src/main/java/com/hyeeyoung/wishboard/presentation/splash/SplashActivity.kt b/app/src/main/java/com/hyeeyoung/wishboard/presentation/splash/SplashActivity.kt index 28e0b529..5badd00e 100644 --- a/app/src/main/java/com/hyeeyoung/wishboard/presentation/splash/SplashActivity.kt +++ b/app/src/main/java/com/hyeeyoung/wishboard/presentation/splash/SplashActivity.kt @@ -1,6 +1,7 @@ package com.hyeeyoung.wishboard.presentation.splash import android.content.Intent +import android.net.Uri import android.os.Bundle import android.util.Log import androidx.appcompat.app.AppCompatActivity @@ -9,8 +10,11 @@ import androidx.lifecycle.lifecycleScope import com.hyeeyoung.wishboard.R import com.hyeeyoung.wishboard.WishBoardApp import com.hyeeyoung.wishboard.databinding.ActivitySplashBinding +import com.hyeeyoung.wishboard.presentation.common.screens.TwoButtonDialogFragment +import com.hyeeyoung.wishboard.presentation.common.types.DialogButtonReplyType import com.hyeeyoung.wishboard.presentation.main.MainActivity import com.hyeeyoung.wishboard.presentation.sign.screens.SignActivity +import com.hyeeyoung.wishboard.util.DialogListener import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Job import kotlinx.coroutines.delay @@ -27,12 +31,37 @@ class SplashActivity : AppCompatActivity() { lifecycleScope.launch(Dispatchers.Main) { job = launch { delay(2000) - moveToNext() - finish() + showServiceInterruptionDialog() +// moveToNext() +// finish() } } } + private fun showServiceInterruptionDialog() { + TwoButtonDialogFragment( + "서비스 일시 중단 안내", + "서버 이전으로 서비스가 \n" + + "일시 중단되오니 양해 부탁드립니다. \n" + + "보다 안정적인 위시보드로 곧 돌아올게요!\n" + + "자세한 사항은 공지사항을 확인해 주세요 \uD83D\uDE09", + "앱 종료", + "공지사항 확인" + ).apply { + isCancelable = false + setListener(object : DialogListener { + override fun onButtonClicked(clicked: String) { + if (clicked == DialogButtonReplyType.YES.name) { + dismiss() + finish() + } else { + startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://www.instagram.com/p/CtN6KfUPqbI/?igshid=NTc4MTIwNjQ2YQ=="))) + } + } + }) + }.show(supportFragmentManager, "ServiceInterruptionDialog") + } + private fun moveToNext() { // TODO 유저 정보 가져오기 val token = WishBoardApp.prefs.getUserToken()