Fixes Issue#5853 Tapping a "... sent you an email" notification has no effect #5865
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change improves the user experience by ensuring email notifications are properly categorized and provides useful feedback when they are clicked.
Description (required)
Fixes #5853
What changes did you make and why?
This Pull request adds logic to classify notifications as "email" type when the notification text contains "sent you an email". This change ensures that email notifications are properly categorized, which was previously missing, leading to all email notifications being marked as UNKNOWN type.
Previously, email-related notifications from the backend were missing a URL. As a result, when users clicked on these notifications, there was no link to open, and the notifications were categorized as UNKNOWN. This led to a poor user experience since there was no feedback provided when the user clicked on an email notification.
Changes:
NotificationClient:
WikimediaNotification.toCommonsNotification()
to check if the notification text contains "sent you an email". If it does, the notification is classified asEMAIL
instead of the defaultUNKNOWN
.NotificationActivity:
NotificatinAdapter
click handler, added a check forEMAI
type. When an email-type notification is clicked, a "Check your mail box" prompt is shown usingSnackbar
, instead of attempting to open a URL (which is typically missing for such notifications).NotificationType:
EMAIL
type to categorize email-related notifications.Localization:
values-zh/strings.xml
,values-zh-rhk/strings.xml
,values-zh-rcn/strings.xml
,values-zh-rtw/strings.xml
, andvalues-ja/string.xml
to improve user experience for non-English speakers.Tests performed (required)
Tested {build variant} on {Galaxy s20 SM-G9810} with API level {33}.
Screenshots (for UI changes only)