-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to hide thumbnail on lock screen #4642
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
I'm not sure if Appearance is the correct place for this setting. I'd put it into Notification, since at the end of the day the lockscreen thumbnail is strictly related to the notification. Or maybe let's rename Notification to Media or something else (which would also solve the naming clash with #2335). What's your opinion on this? @opusforlife2 @TobiGr
@@ -34,4 +34,10 @@ | |||
android:title="@string/caption_setting_title" | |||
app:iconSpaceReserved="false" /> | |||
|
|||
<SwitchPreferenceCompat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This switch should be hidden on API <21, since the lockscreen thumbnail was not a feature until Android Lollipop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a preference for doing this with xml only or programmatically hiding it with java code.
Edit: preference as in which type is more liked. not as in a setting. I see how this could be misunderstood.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to do this programmatically by getting the preference object in the settings fragment for appearance and hiding it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
XML only is also possible, hence my question
You have values/bool.xml with a value being false and values-v22/bool.xml with the same value being true. In the preference xml you then add app:isPreferenceVisible="@bool/{key}"
Same could be done for app:visibility
, with the values being strings for gone, invisible and visible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like obfuscation: even though it works, it's more of a workaround than a real solution. I'd use normal code like it's done in all other PreferenceFragment
s
Let's do this for now, @Stypox. |
I'll adjust the PR when #4652 gets merged |
Reminder for future me: before merging this we should make sure it also fixes #4651 |
b45a029
to
232ca8c
Compare
I rebased it on top of my other PR to avoid merge conflicts, so ignore this for now until that one is merged. Edit: DHL sucks and im missing my pc case |
232ca8c
to
7805f8a
Compare
New Pc, the crash doesn't occur anymore. I didn't disable the setting in old android versions since the option now also hides the image inside the notification, whichs works on old version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested on Android 11 and 4.4 and everything works good. Thank you! :-D
What is it?
Description of the changes in your PR
Fixes the following issue(s)
APK testing
app-debug.zip
Due diligence