mirror of
https://github.com/etesync/android
synced 2025-03-04 17:26:29 +00:00
Settings: add a link to the notification settings.
This commit is contained in:
parent
07292a1422
commit
75020c1841
@ -10,10 +10,12 @@ package com.etesync.syncadapter.ui
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.AsyncTask
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import androidx.preference.*
|
||||
import com.etesync.syncadapter.App
|
||||
import com.etesync.syncadapter.BuildConfig
|
||||
import com.etesync.syncadapter.R
|
||||
import com.etesync.syncadapter.model.ServiceDB
|
||||
import com.etesync.syncadapter.model.Settings
|
||||
@ -63,6 +65,18 @@ class AppSettingsActivity : BaseActivity() {
|
||||
override fun onCreatePreferences(bundle: Bundle?, s: String?) {
|
||||
addPreferencesFromResource(R.xml.settings_app)
|
||||
|
||||
findPreference("notification_settings").apply {
|
||||
if (Build.VERSION.SDK_INT >= 26)
|
||||
onPreferenceClickListener = Preference.OnPreferenceClickListener {
|
||||
startActivity(Intent(android.provider.Settings.ACTION_APP_NOTIFICATION_SETTINGS).apply {
|
||||
putExtra(android.provider.Settings.EXTRA_APP_PACKAGE, BuildConfig.APPLICATION_ID)
|
||||
})
|
||||
false
|
||||
}
|
||||
else
|
||||
isVisible = false
|
||||
}
|
||||
|
||||
prefResetHints = findPreference("reset_hints")
|
||||
|
||||
prefOverrideProxy = findPreference("override_proxy") as SwitchPreferenceCompat
|
||||
|
@ -86,6 +86,8 @@
|
||||
<!-- AppSettingsActivity -->
|
||||
<string name="app_settings">Settings</string>
|
||||
<string name="app_settings_user_interface">User interface</string>
|
||||
<string name="app_settings_notification_settings">Notification settings</string>
|
||||
<string name="app_settings_notification_settings_summary">Manage notification channels and their settings</string>
|
||||
<string name="app_settings_reset_hints">Reset hints</string>
|
||||
<string name="app_settings_reset_hints_summary">Re-enables hints which have been dismissed previously</string>
|
||||
<string name="app_settings_reset_hints_success">All hints will be shown again</string>
|
||||
|
@ -10,6 +10,10 @@
|
||||
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<PreferenceCategory android:title="@string/app_settings_user_interface">
|
||||
<Preference
|
||||
android:key="notification_settings"
|
||||
android:title="@string/app_settings_notification_settings"
|
||||
android:summary="@string/app_settings_notification_settings_summary"/>
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
android:key="show_change_notification"
|
||||
|
Loading…
Reference in New Issue
Block a user