* BaseMarker.kt: removed unneeded cast
* TransformImageImpl.kt: removed unreachable code
* ZoomableActivity.kt: removed Unnecessary safe call on a non-null receiver of type ZoomableDraweeView
* ZoomableActivity.kt: removed Unnecessary safe call on a non-null receiver of type ZoomableDraweeView
* DescriptionEditActivity.kt: removed unnecessary non-null assertion (!!) on a non-null receiver of type DescriptionEditHelper
* Media.kt: Property would not be serialized into a 'Parcel'. Added '@IgnoredOnParcel' annotation to remove the warning
* ZoomableActivity.kt: removed Unnecessary non-null assertion (!!) on a non-null receiver of type ZoomableDraweeView
* CategoryClient.kt: removed condition 'page.categoryInfo() == null' as it's always 'false'
* DescriptionEditActivity.kt: removed unnecessary safe call on a non-null receiver of type SessionManager
* DescriptionEditActivity.kt: removed unnecessary safe call on a non-null receiver of type DescriptionEditHelper
* WikidataFeedback.kt: removed unneeded cast
* FailedUploadsFragment.kt: removed unneeded non-null assertion (!!)
* PendingUploadsFragment.kt: removed unneeded non-null assertion (!!)
* AchievementsFragment.java: Changed toUpperCase to toUpperCase(Locale.getDefault())
* ExploreFragment.java: Changed toUpperCase to toUpperCase(Locale.getDefault())
* FileUtils.java: Changed toUpperCase to toUpperCase(Locale.getDefault())
* AchievementsFragment.java: Changed toUpperCase to toUpperCase(Locale.ROOT)
* ExploreFragment.java: Changed toUpperCase to toUpperCase(Locale.ROOT)
* LocationPickerActivity.java: Changed toUpperCase to toUpperCase(Locale.ROOT)
* MediaDetailFragment.java: Changed toUpperCase to toUpperCase(Locale.ROOT)
* NearbyFilterSearchRecyclerViewAdapter.java: Changed toUpperCase to toUpperCase(Locale.ROOT)
* ProfileActivity.java: Changed toUpperCase to toUpperCase(Locale.ROOT)
* RecentSearchesFragment.java: Changed toUpperCase to toUpperCase(Locale.ROOT)
* ReviewActivity.java: Changed toUpperCase to toUpperCase(Locale.ROOT)
* SearchActivity.java: Changed toUpperCase to toUpperCase(Locale.ROOT)
* UploadMediaPresenter.java: Changed toUpperCase to toLowerCase(Locale.ROOT)
* CategoriesMediaFragment.kt: Changed arguments!! to requireArguments()
* ChildDepictionsFragment.kt: Changed arguments!! to requireArguments()
* DepictedImagesFragment.kt: Changed arguments!! to requireArguments()
* DepictsFragment: Changed Objects.requireNonNull(getView()) to requireViews(), Objects.requireNonNull(getActivity())) to requireActivity()
* ParentCategoriesFragment.kt: Changed arguments!! to requireArguments()
* ParentCategoriesFragment.kt: Changed arguments!! to requireArguments()
* SubCategoriesFragment.kt: Changed arguments!! to requireArguments()
* SubCategoriesFragment.kt: Changed Objects.requireNonNull(getView()) to requireViews(), Objects.requireNonNull(getActivity()) to requireActivity()
* UploadMediaDetailFragment.java: Changed arguments!! to requireArguments()
* WikipediaInstructionsDialogFragment.kt: Changed arguments!! to requireArguments()
* BookmarkItemsDao.java: Added @SuppressLint("Range"), as -1 is expected behavior not index doesn't exist for getColumnIndex()
* BookmarkLocationsDao.java: Added @SuppressLint("Range"), as -1 is expected behavior not index doesn't exist for getColumnIndex()
* AndroidManifest.xml: Removed redundant label android:label="@string/app_name"
* bs\strings.xml: Added missing few quantity
* hr\strings.xml: Added missing few quantity
* hr\strings.xml: Added missing zero, two, few, many quantities for lines 23 - 63
* Revert "hr\strings.xml: Added missing zero, two, few, many quantities for lines 23 - 63"
This reverts commit 47232466ab.
* cy\strings.xml: Added missing zero, two, few, many quantities for lines 23 - 63
* sr\strings.xml: Added missing few quantities for lines 35 to 70
* ro\strings.xml: Added missing few quantity and removed not needed zero for <plurals name="contributions_subtitle" fuzzy="true">
* cs\strings.xml: Added missing few many missing quantities for lines 33 - 74
* lt\strings.xml: Added missing few, many missing quantities for lines 34 - 58
* lt\strings.xml: Replaced . . . with ...
* ca\strings.xml: Added missing many quantities for lines 21 - 51, replaced . . . with ...
* ser\strings.xml: Added missing few quantities, replaced . . . with ...
* br\strings.xml: Added missing two, few, many quantities
* pt\strings.xml: Added missing many quantity, changed . . . to ... and ignored typo as it is correct for European Portuguese
* it\strings.xml: changed . . . to ...
* pt\strings.xml: fixed many quantity
* ca\strings.xml: fixed many quantity
* sr\strings.xml: fixed many quantity
* cy\strings.xml: corrected quantities for "share_license_summary
* fr\strings.xml: changed . . . to ... and add many quantities using the other quantity
* fr\strings.xml: changed . . . to ... and add many quantities using the other quantity. Fixed some typos, added ignore for correct spellings but has warning
* getColumnIndex(): added @SuppressLint("Range") as -1 is expected result for column name doesn't exist
* values-b+sr+Latn\strings.xml: changed . . . to ...
* Revert "values-b+sr+Latn\strings.xml: changed . . . to ..."
This reverts commit 95b909c29f.
* values-b+roa+tara\strings.xml: changed . . . to ...
* Revert "values-b+roa+tara\strings.xml: changed . . . to ..."
This reverts commit b5db1a3e68.
* values-b+roa+tara\strings.xml: changed . . . to ...
* values-b+sr+Latn\strings.xml: changed . . . to ..., add few based on other quantity. Ignored one ImpliedQuantity warning as it is correct.
* it\strings.xml: changed . . . to ..., add many based on other quantity.
* pt-rBR\strings.xml: changed . . . to ..., add many based on other quantity. Fixed typos, ignored warning for "one" quantity as translation didn't use number
* si\strings.xml: Ignored ImpliedQuantity warning as it uses 1 not %d. Removed not needed zero quantity
* si\strings.xml: Ignored ImpliedQuantity warning as it uses 1 not %d. Removed not needed zero quantity. Fixed wrong %1$d. Changed . . . to ...
* mk\strings.xml: changed . . . to ... and ignored ImpliedQuantity as it doesn't use 1
* sl\strings.xml: changed . . . to ... and ignored ImpliedQuantity as it doesn't use %1$d
* ru\strings.xml: changed . . . to ... and ignored ImpliedQuantity as it doesn't use %1$d
* uk\strings.xml: changed . . . to ... and ignored ImpliedQuantity as it doesn't use %1$d
* is\strings.xml: changed . . . to ... and ignored ImpliedQuantity as it doesn't use %1$d
* strings.xml: changed . . . to ...
* af\strings.xml: removed not needed zero quantity
* de\strings.xml: fixed duplicate word typo
* diq\strings.xml: changed - to dash (-)
* hi\strings.xml: removed not needed zero
* in\strings.xml: removed not needed one quantity
* iw\strings.xml: removed not needed many quantity
* ja\strings.xml: removed not needed one quantity
* ko\strings.xml: removed not needed one quantity
* ky\strings.xml: removed not needed one quantity
* mr\strings.xml: removed not needed zero quantity
* my\strings.xml: removed not needed one quantity
* su\strings.xml: removed not needed one quantity
* th\strings.xml: removed not needed one and zero quantity
* zh\strings.xml: removed not needed one quantity
* activity_description_edit.xml: changed android:tint to app:tint, changed layout_alignParentRight to layout_alignParentEnd
* bottom_sheet_details_explore.xml: changed android:tint to app:tint, added focusable, changed to margin layout
* bottom_sheet_item_layout.xml: changed android:tint to app:tint, added focusable
* bottom_sheet_details_explore.xml: changed android:tint to app:tint, added focusable, changed margin layout and removed not needed and invalid params
* item_place.xml.xml: changed android:tint to app:tint, added focusable, changed margin layout and removed not needed and invalid params
* layout_campagin.xml: changed android:tint to app:tint, added focusable, changed margin layout and removed not needed and invalid params
* layout_contribution.xml.xml: changed android:tint to app:tint
* nearby_card_view.xml: changed android:tint to app:tint, added focusable, changed margin layout and removed not needed and invalid params
* nearby_row_button.xml: changed android:tint to app:tint, added focusable, changed margin layout and removed not needed and invalid params
* toolbar_location_picker.xml: changed android:tint to app:tint
---------
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
* remove unused result expectancy for settings screen launch
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
* initial refactor to new result api, wip
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
* refactor camera launcher
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
* revert callback for video handling
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
* invoke callbacks when cancelled
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
* handle gallery picker result based on preference
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
* remove old method of refactoring for file picker
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
* remove legacy result handling callback
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
* request code used for handling result was never used for launching an activity, hence removed
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
* extract voice result handling into function
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
* refactor test
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
* remove unused tests
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
* cleanup
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
* fix-docs
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
* add space after ,
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
---------
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
>> 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
* NearbyParentFragment.java:
OnScroll - removed distance threshold, delay search by 800ms, discard multiple OnScroll within 800ms.
OnDestroy - destroy any queued OnScroll events
* NearbyParentFragment.java:
loadPlacesDataAsync - set batchSize from 50 back to original 3
* comment
---------
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
* *.kt: bulk correction of formatting using ktlint --format
* *.kt: replace wildcard imports and second stage auto format ktlint --format
* QuizQuestionTest.kt: modified property names to camel case to meet ktlint standard
* LevelControllerTest.kt: modified property names to camel case to meet ktlint standard
* QuizActivityUnitTest.kt: modified property names to camel case to meet ktlint standard
* MediaDetailFragmentUnitTests.kt: modified property names to camel case to meet ktlint standard
* UploadWorker.kt: modified property names to camel case to meet ktlint standard
* UploadClient.kt: modified property names to camel case to meet ktlint standard
* BasePagingPresenter.kt: modified property names to camel case to meet ktlint standard
* DescriptionEditActivity.kt: modified property names to camel case to meet ktlint standard
* OnSwipeTouchListener.kt: modified property names to camel case to meet ktlint standard
* MediaDetailFragmentUnitTests.kt: corrected excessive line length to meet ktlint standard
* DepictedItem.kt: corrected property name format and catch format to for ktlint standard
* UploadCategoryAdapter.kt: corrected class definition format to meet ktlint standard
* CustomSelectorActivity.kt: reformatted function names to first letter lowercase to meet ktlint standard
* MediaDetailFragmentUnitTests.kt: fix string literal indentation to meet ktlint standard
* NotForUploadDao.kt: file renamed to match class name, new file NotForUploadStatusDao.kt
* UploadedDao.kt: file renamed to match class name, new file UploadedStatusDao.kt
* Urls.kt: fixed excessive line length for ktLint standard
* Snak_partial.kt & Statement_partial.kt: refactored to remove underscores in class names to meet ktLint standard
* *.kt: fixed consecutive KDOC error for ktLint
* PageableBaseDataSourceTest.kt & UploadPresenterTest.kt: fixed excessive line lengths to meet ktLint standard
* CheckboxTriStatesTest.kt: renamed file to match class name to meet ktLint standard
* .kt: resolved backing-property-naming error in ktLint, made matching properties public, matched names and refactored
* TestConnectionFactory.kt: fixed property naming to adhere to ktLint standard
* LocationPickerActivity.java: fix "Show in Map App" bug
Once the "Show in Map App" button is pressed, the Map app will center on the current photo's EXIF location,
if that data is available. If not, the map app will center on where the location picker's map is centered.
Javadoc updated to reflect this small change.
* LocationPickerActivity.java: add methods to easily move the map center
Before this change, any time the map center had to move, several lines of code had to be written.
This change creates several methods which move the map center to a specified location. By using these new methods,
moving the map center only takes one simple method call.
* LocationPickerActivity.java: add null check to method
The original method did not include a null check for the input GeoPoint.
This change includes a null check. If the input Geopoint is null, the method will simply return.
* LocationPickerActivity.java: remove redundant method, renaming method
Before this change, there were two methods with the same behavior.
This change removes the newer method and renames the old method to the descriptive name the newer one had.
Additionally, code which calls this method has been changed to reflect the new name.
* LocationPickerActivity.java: rearrange method calls.
Before this change, a method call to move the map to the device's GPS location was called at the very end of the map setup method.
This would move the map away from the media's EXIF location data (if it was available).
This change places the method call to move the map to the device's GPS location before the method call to move the map to the media's EXIF location (if the data is available).
In short, if no exif data is available, the map attempts to move to the device's GPS location. If the exif location data does exist, the map will move to that location.
* LocationPickerActivity.java: rewrite method scope, name, and documentation
Before this commit, the method name was unclear and the documentation did not fully explain the method's behavior. Additionally, it was a public method.
This commit renames the method (also changing calls to it), adds more documentation, and changes the method scope from public to private.
* LocationPickerActivity.java: create method to move location picker map to device GPS location
Before this method was created, several lines of code were required to move the location picker map to the device's GPS location.
After this method was created, the location picker map can be moved to the GPS location in a single method call.
* LocationPickerActivity.java: add code to move map to either EXIF or device GPS location
Before this change, there was no explicit if check on whether there was EXIF data available before moving the location picker map.
After this change, an explicit if check (which checks the activity name string) will move the location picker map to either
the EXIF location (if that data is available) or to the device's GPS location (if EXIF data is not available).
* LocationPickerActivity.java: refactor showInMapApp method
Before this change, the showInMapApp method had correct behavior, but could be rewritten to become more clear.
After this change, the showInMapApp code has been rewritten.
Specifically, common code in an if statement has been factored out.
* LocationPickerActivity.java: add null checks to showInMapApp
Before this change, there was no null checks when accessing data from an object,
which could create null pointer exceptions at runtime.
After this change, null checks are introduced to make sure null pointer exceptions will not occur.
* LocationPickerActivity.java: rewrite comments to clarify if statement
Before this change, a comment in showInMapApp did not properly describe an if statement's intended behavior.
After this change, the old comment was removed and 2 new comments were added in each part of the if statement
to properly describe the intended behavior.
* LocationPickerActivity.java: replace code with a method call
Before this change, there was several lines of code which moved the map center to the EXIF location.
After this change, the several lines of code have been replaced with a simpler method call which produces
the same result.
* LocationPickerActivity.java: remove redundant code
Before this change, there was two sections of code which moved the map center to the same location. Both of these code sections
occur very close to each other (one in onCreate(), the other in setupMapView())
After this change, the code section in onCreate() has been removed. With the map centering code only in the setupMapView() method.
This change eliminates redundancy, reduces the amount of code in onCreate(), and makes this java file easier to understand.
* content_location_picker.xml: adjust picker pin and shadow location
Before this commit, the location picker pin and shadow graphics were incorrectly located on the screen.
Specifically, the bottom of the pin was not located at the center of the view. Since pressing the
checkmark button saves the location at the center of the view, users would most likely save the wrong location.
After this commit, the location picker pin and shadow graphics have been moved upward. The shadow graphic is
now located at the exact center of the view, and the bottom of the location picker pin is directly over the
center as well. Users may now use the bottom of the pin as an accurate location picker.
* LocationPickerActivity.java: fix bug with permissions menu moving map
Prior to this change, if the menu asking for permissions to access the device's GPS was accepted, the map
would automatically move to the most recent or current GPS location, rather than staying at the uploaded
image's available EXIF location.
After this change, the map will stay centered at the image's available EXIF location, as intended.
The relevant method name and javadoc have been changed to more accurately describe the method's behavior.
* LocationPickerActivity.java: fix map centering bug when editing location on already uploaded media
Before this commit, when the user pressed the edit location icon on media which was already uploaded,
the map would center on the device's current GPS location.
After this commit, pressing the same edit location icon will now center the map on the location metadata.
This is done by checking the activity string to see if the media is already uploaded. If so, a method
is called to center the map on the media's location metadata.
* LocationPickerActivity.java: replace references to EXIF in documentation
Before this commit, there were several mentions of EXIF location data in the javadocs. It is not clear if
this is correct, since many images have location data that is chosen by the user rather than derived from EXIF.
After this commit, the more generic term "location metadata" is used in place of EXIF location data.
Hopefully this change will help avoid confusion in the future.
---------
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
* change the overridden method signature as per API 34
* add version check condition to compare with API 23 before adding flag
* refactor: add final keywords, fix typo, and remove redundant spaces
For optimized code only
* upgrade: migrate to SDK 34 and upgrade APG
Additionally, add Jetpack Compose to the project
* AndroidManifest: add new permission for API 34
DescriptionActivity should not be exposed
* refactor: permission should not be check on onCreate for some cases
* add method to get correct storage permission and check partial access
Additionally, add final keywords to reduce compiler warnings
* refactor: prevent app from crashing for SDKs >= 34
* add new UI component to allows user to manage partially access photos
Implement using composeView
* change the overridden method signature as per API 34
* add version check condition to compare with API 23 before adding flag
* refactor: add final keywords, fix typo, and remove redundant spaces
For optimized code only
* upgrade: migrate to SDK 34 and upgrade APG
Additionally, add Jetpack Compose to the project
* AndroidManifest: add new permission for API 34
DescriptionActivity should not be exposed
* refactor: permission should not be check on onCreate for some cases
* add method to get correct storage permission and check partial access
Additionally, add final keywords to reduce compiler warnings
* refactor: prevent app from crashing for SDKs >= 34
* add new UI component to allows user to manage partially access photos
Implement using composeView
* replace deprecated circular progress bar with material progress bar
* remove redundant appcompat dependency
* add condition to check for partial access on API >= 34
It prevents invoking photo picker on UploadActivity.
* UploadWorker: add foreground service type
* fix typos in UploadWorker.kt
* add permission to access media location
* Add Date and Time in UTC format to Feedback
* Add UTC date to the Subject instead of adding it to the body
* Change the UTC Date format to yyyy/MM/dd HH:mm:ss
* Minor changes
---------
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
* tests: fix failing testUpdateDepictsProperty
* replace deprecated circular progress bar with material progress bar
* refactor: update SettingsActivity to not use custom appCompatDeletegate
It is required because that delegate is automatically handled in new libraries.