Skip to content

Commit

Permalink
Merge pull request #401 from hyeeyoung/hotfix-service-error-alert
Browse files Browse the repository at this point in the history
[feat] ์„œ๋น„์Šค ์ผ์‹œ ์ค‘๋‹จ ๋‹ค์ด์–ผ๋กœ๊ทธ ๊ตฌํ˜„
  • Loading branch information
youngjinc authored Jun 9, 2023
2 parents 6d17b1a + dec2c5b commit 50ad092
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 50ad092

Please sign in to comment.