Skip to content

Commit

Permalink
[fix]: hiding it for android 7
Browse files Browse the repository at this point in the history
  • Loading branch information
F0x1d committed Jul 5, 2024
1 parent 526c0a6 commit 791d800
Showing 1 changed file with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ class SettingsNotificationsFragment: BasePreferenceFragment() {
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
addPreferencesFromResource(R.xml.settings_notifications)

findPreference<Preference>("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<Preference>("pref_logging_notification")?.apply {
isVisible = notificationsChannelsAvailable

Expand All @@ -47,6 +37,20 @@ class SettingsNotificationsFragment: BasePreferenceFragment() {
return@setOnPreferenceClickListener true
}
}

findPreference<Preference>("pref_per_app_notifications_settings")?.apply {
isVisible = notificationsChannelsAvailable
}

findPreference<Preference>("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() {
Expand Down

0 comments on commit 791d800

Please sign in to comment.