Add shortcut to manage app notifications

This commit is contained in:
arkon 2020-02-25 18:32:49 -05:00
parent a7bb059096
commit 8776a45ee9
2 changed files with 14 additions and 0 deletions

View File

@ -1,6 +1,8 @@
package eu.kanade.tachiyomi.ui.setting
import android.content.Intent
import android.os.Build
import android.provider.Settings
import androidx.biometric.BiometricManager
import androidx.preference.PreferenceScreen
import eu.kanade.tachiyomi.R
@ -116,6 +118,17 @@ class SettingsGeneralController : SettingsController() {
defaultValue = "1"
summary = "%s"
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
preference {
titleRes = R.string.pref_manage_notifications
onClick {
val intent = Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS).apply {
putExtra(Settings.EXTRA_APP_PACKAGE, context.packageName)
}
startActivity(intent)
}
}
}
preferenceCategory {
titleRes = R.string.pref_category_security

View File

@ -131,6 +131,7 @@
<string name="pref_language">Language</string>
<string name="system_default">System default</string>
<string name="pref_date_format">Date format</string>
<string name="pref_manage_notifications">Manage notifications</string>
<string name="pref_category_security">Security</string>
<string name="lock_with_biometrics">Lock with biometrics</string>