diff --git a/feature/feature-settings/src/main/kotlin/com/f0x1d/logfox/feature/settings/ui/fragment/SettingsNotificationsFragment.kt b/feature/feature-settings/src/main/kotlin/com/f0x1d/logfox/feature/settings/ui/fragment/SettingsNotificationsFragment.kt index 338c3249..fa4113ac 100644 --- a/feature/feature-settings/src/main/kotlin/com/f0x1d/logfox/feature/settings/ui/fragment/SettingsNotificationsFragment.kt +++ b/feature/feature-settings/src/main/kotlin/com/f0x1d/logfox/feature/settings/ui/fragment/SettingsNotificationsFragment.kt @@ -23,16 +23,6 @@ class SettingsNotificationsFragment: BasePreferenceFragment() { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { addPreferencesFromResource(R.xml.settings_notifications) - findPreference("pref_notifications_permission")?.setOnPreferenceClickListener { - startActivity( - Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS).apply { - addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) - putExtra(Settings.EXTRA_APP_PACKAGE, requireContext().packageName) - } - ) - return@setOnPreferenceClickListener true - } - findPreference("pref_logging_notification")?.apply { isVisible = notificationsChannelsAvailable @@ -47,6 +37,20 @@ class SettingsNotificationsFragment: BasePreferenceFragment() { return@setOnPreferenceClickListener true } } + + findPreference("pref_per_app_notifications_settings")?.apply { + isVisible = notificationsChannelsAvailable + } + + findPreference("pref_notifications_permission")?.setOnPreferenceClickListener { + startActivity( + Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS).apply { + addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) + putExtra(Settings.EXTRA_APP_PACKAGE, requireContext().packageName) + } + ) + return@setOnPreferenceClickListener true + } } override fun onStart() {