>> Made it so that selecting a language results in the hashmap storing the currently selected language(s) being cleared. Considered refactoring the hashmap storing this into a single pair storing the language positition index and its code, as only one language should ever be selected, however I am not confident that this would not introduce unintended side-effects
* UI design for legend to explain the colors of the nearby pins
* Add listener for the button to toggle the visibility of the legend (make it hideable)
* Change wording for legend and make text localizable
* Fixed typo
* Fixed typo
---------
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
Resolved an issue where RecyclerView would incorrectly scroll to the top after exiting fullscreen preview. Adjusted scroll behavior to maintain position unless actioned images are filtered. Implemented observer logic adjustments to handle dataset updates more efficiently.
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
* ImageFragment.kt: notifyDataSetChanged() added to update observers about init call in handleResult()
* ImageFragment.kt: unnecessary initialisation after exiting media preview was removed from passSelectedImages
* (fixes#5855) fetch item label in nearby based on user configured language.
* implement a method to delete Place entity from database
* clear the cache for a item when a wikiItem is updated.
* fix style issue
* Update placesRepository on successful WikiItemEdit
* Revert the delete operations added to the PlaceDAO
* Set name of the place to avoid race condition with NearbyParentFragment. Update Success Notification to show only after the pin has been updated.
* Clean-up
---------
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
This commit adds logic to classify notifications as "email" type when the notification text contains "sent you an email". It also updates the email notification prompt to support localization, ensuring a better user experience across different regions.
### Problem:
1. 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.
2. Additionally, the existing code used hardcoded English text for the email notification prompt, which did not provide a localized experience for users in different regions.
### Solution:
1. Added logic to categorize email-related notifications as `EMAIL` when the notification text contains "sent you an email".
2. Replaced the hardcoded "Check your email inbox" string with a localized string and added translations for multiple languages, including zh, zh-rhk, zh-rcn, zh-rtw, and ja.
### Changes:
- **NotificationClient**:
- Modified `WikimediaNotification.toCommonsNotification()` to check if the notification text contains "sent you an email". If it does, the notification is classified as `EMAIL_MESSAGE` instead of the default `UNKNOWN`.
- **NotificationActivity**:
- In the `NotificatinAdapter` click handler, added a check for `EMAIL_MESSAGE` type. When an email-type notification is clicked, a localized "Check your mail box" prompt is shown using `Snackbar`, instead of attempting to open a URL (which is typically missing for such notifications).
- Modified to fetch the string using `getString(R.string.check_your_mail_box)` to support localization.
- **NotificationType**:
- Added a new `EMAIL` type to categorize email-related notifications.
- **Localization**:
- Added localized translations for "Check your mail box" in zh, zh-rhk, zh-rcn, zh-rtw, and ja.
Co-authored-by: Qiutong Zeng <Qiutong.zeng@anu.edu.au>
* Updated instances of assert() in WelcomeActivityTest.kt to asserThat().
New imports:
- org.hamcrest.CoreMatchers.equalTo
- org.hamcrest.CoreMatchers.assertThat
* Updated instances of assert() in LatLngTest.kt to asserThat().
New imports:
- org.hamcrest.CoreMatchers.equalTo
- import org.hamcrest.CoreMatchers.not
- org.hamcrest.CoreMatchers.assertThat
* Updated instances of assert() in LabelTest.kt to asserThat().
New imports:
- org.hamcrest.CoreMatchers.equalTo
- org.hamcrest.CoreMatchers.assertThat
* Corrected sign error typo in LatLngTest.kt