mirror of
https://github.com/rebelonion/Dantotsu.git
synced 2026-01-19 04:23:57 +00:00
update SettingsDialogFragment.kt
This commit is contained in:
@@ -3,6 +3,7 @@ package ani.dantotsu.settings
|
||||
import android.app.DownloadManager
|
||||
import android.content.ActivityNotFoundException
|
||||
import android.content.Intent
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
@@ -139,6 +140,25 @@ class SettingsDialogFragment() : BottomSheetDialogFragment() {
|
||||
_binding = null
|
||||
}
|
||||
|
||||
private fun restartApp() {
|
||||
Snackbar.make(
|
||||
binding.root,
|
||||
R.string.restart_app, Snackbar.LENGTH_SHORT
|
||||
).apply {
|
||||
val mainIntent =
|
||||
Intent.makeRestartActivityTask(
|
||||
context.packageManager.getLaunchIntentForPackage(
|
||||
context.packageName
|
||||
)!!.component
|
||||
)
|
||||
setAction("Do it!") {
|
||||
context.startActivity(mainIntent)
|
||||
Runtime.getRuntime().exit(0)
|
||||
}
|
||||
show()
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
enum class PageType {
|
||||
MANGA, ANIME, HOME
|
||||
|
||||
Reference in New Issue
Block a user