Show persistent notification toggle is disabled from Android O and up
This patch aims to enable the toggle with link to Notifications Settings, so that user can itself disable the persistent notification if desired
Details
- Reviewers
albertvaka - Group Reviewers
KDE Connect - Commits
- R225:a6ae97afb127: Allow disabling persistent notification in Android 8.0 and up
Apply patch, use on Android O or up device and use Show persistent notification toggle. It should take you to Notifications settings page of KDE Connect
Diff Detail
- Repository
- R225 KDE Connect - Android application
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
src/org/kde/kdeconnect/UserInterface/SettingsFragment.java | ||
---|---|---|
77 | Build.VERSION.SDK_INT >= Build.VERSION_CODES.O should be enough |
The "Show persistent notifications" switch should represent reality. If it's on the notification should be displayed and if it's off the notification should not be visible.
src/org/kde/kdeconnect/UserInterface/SettingsFragment.java | ||
---|---|---|
79 | Why this if/else? You already tested for O above |
src/org/kde/kdeconnect/UserInterface/SettingsFragment.java | ||
---|---|---|
79 | you're right, I shall remove it |
Single touch preference if Android >=Oreo
twoStatepref with previous functionality otherwise
My phone is using UK locales from strings.xml, so I haven't touched the UK locales.
I think changing the title to "Persistent Notification" and summary to "Click to enable/disable in Notification settings" would be better for Oreo and newer
src/org/kde/kdeconnect/UserInterface/SettingsFragment.java | ||
---|---|---|
82 | indentation | |
84 | indentation | |
86 | Can be replaced by a lambda (hover on Preference.OnPreferenceClickListener() and press Alt+enter) |
- Removed custom description for Oreo in Persistent Notification preference.
- Removed excess code according to above change.
- Added custom title for Persistent Notification preference if Android >= Oreo
- Renamed custom description for Pie in Persistent Notification preference to reflect new value , for Android >= Oreo