From 791d800b0bc7d7ececfd8a54ddfd01fe42eeddce Mon Sep 17 00:00:00 2001 From: F0x1d Date: Fri, 5 Jul 2024 20:19:12 +0300 Subject: [PATCH] [fix]: hiding it for android 7 --- .../fragment/SettingsNotificationsFragment.kt | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) 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() {