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
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 6963 Build 6981: arc lint + arc unit
src/org/kde/kdeconnect/UserInterface/SettingsFragment.java | ||
---|---|---|
99–117 | 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 | ||
---|---|---|
101 | Why this if/else? You already tested for O above |
src/org/kde/kdeconnect/UserInterface/SettingsFragment.java | ||
---|---|---|
101 | 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 | ||
---|---|---|
104 | indentation | |
106 | indentation | |
108 | 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