dh I'll jx

This commit is contained in:
sadmansaif017@gmail.com
2024-01-04 21:28:41 +06:00
parent 9d378ee58c
commit 8a1aacb4f2
2 changed files with 15 additions and 25 deletions

View File

@@ -29,7 +29,7 @@ android {
debug {
applicationIdSuffix ".sad"
manifestPlaceholders = [icon_placeholder: "@mipmap/ic_launcher_beta", icon_placeholder_round: "@mipmap/ic_launcher_beta_round"]
debuggable true
debuggable false
}
release {
manifestPlaceholders = [icon_placeholder: "@mipmap/ic_launcher", icon_placeholder_round: "@mipmap/ic_launcher_round"]

View File

@@ -28,6 +28,7 @@ import ani.dantotsu.others.imagesearch.ImageSearchActivity
import ani.dantotsu.setSafeOnClickListener
import ani.dantotsu.startMainActivity
import ani.dantotsu.toast
import com.google.android.material.snackbar.Snackbar
class SettingsDialogFragment() : BottomSheetDialogFragment() {
@@ -75,17 +76,25 @@ class SettingsDialogFragment() : BottomSheetDialogFragment() {
Anilist.loginIntent(requireActivity())
}
}
binding.settingsIncognito.isChecked =
getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).getBoolean(
context?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
?.getBoolean(
"incognito",
false
)
binding.settingsIncognito.setOnCheckedChangeListener { _, isChecked ->
getSharedPreferences("Dantotsu", Context.MODE_PRIVATE).edit()
.putBoolean("incognito", isChecked).apply()
restartApp()
}
context?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)?.edit()
?.putBoolean("incognito", isChecked).apply()
}
incognito = context?.getSharedPreferences("Dantotsu", Context.MODE_PRIVATE)
?.getBoolean(
"incognito",
false
)
binding.settingsExtensionSettings.setSafeOnClickListener {
startActivity(Intent(activity, ExtensionsActivity::class.java))
@@ -143,25 +152,6 @@ 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