From dec2c5b2121b0a58e9c371ad9e29c628fcbefcd8 Mon Sep 17 00:00:00 2001 From: youngjinc Date: Thu, 8 Jun 2023 16:43:23 +0900 Subject: [PATCH] =?UTF-8?q?[feat]=20=EC=84=9C=EB=B9=84=EC=8A=A4=20?= =?UTF-8?q?=EC=9D=BC=EC=8B=9C=20=EC=A4=91=EB=8B=A8=20=EB=8B=A4=EC=9D=B4?= =?UTF-8?q?=EC=96=BC=EB=A1=9C=EA=B7=B8=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/splash/SplashActivity.kt | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) 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()