Skip to content

Commit

Permalink
[feat] 서비스 일시 중단 다이얼로그 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
youngjinc committed Jun 8, 2023
1 parent 6d17b1a commit dec2c5b
Showing 1 changed file with 31 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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()
Expand Down

0 comments on commit dec2c5b

Please sign in to comment.