* document regex due to #47
* also count 2020s as "recent years"
* clarify that not all years are ignored
* clarify "year" is current year
* original logic fix
from https://github.com/commons-app/apps-android-commons/pull/5761#pullrequestreview-2144120347
* better variale name for ".*0s.*"
as that regex will match e.g. `1920s` and `80s` too, so the original `is20xxsYear` would be confusing name for it
* consolidate duplicated code to spammyCategory
* clarify regexes via variables
* spammyCategory should always be skipped
* return is simple now, so we can get rid of extra val oldDecade
* fix curYearInString
* some clarification comments
* refactor: rename containsYear to isSpammyCategory
This is done as the name containsYear is ambiguous.
It not just checks for year to identify spammy categories.
* refactor: rename containsYear to isSpammyCategory (take 2)
A continuation of fe74c77ab (refactor: rename containsYear
to isSpammyCategory, 2024-07-17)
---------
Co-authored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
* Ensure to clear the cookies when logging out
It turns out that we failed to clear the cookies from the cookie JAR
when logging the user out. As a consequence, the cookie were retained
and it was possible to edit depictions as the previous user even without
logging in to the app (using the retained cookies).
Make sure we properly clear the cookies when we log the user out.
As an aside, the fact that the edit button shouldn't have been shown
is a different issue being tracked in #5726
* session: reuse removeAccount method for log out
The removeAccount method takes care of invoking the non-deprecated
API in applicable API levels. The logout method did not do such a
thing. Avoid redundancy, and reuse the removeAccount method for
logging out.
* feedback: add the feedback as a new section at end of the page
Addresses feedback on #5542. For auto-archiving of section
to work properly on our feedback page, the new sections need to
be created at the end of the page rather than at the top.
So, adjust the feedback addition logic to make it such that the
feedback is appended to the bottom of the page.
* Replace lambda with a method reference
* feedback: replace edit summary with something more relevant
The summary of the feedback page was unhelpful. Make it more helpful by
using a more helpful summary that at least mentions the version of the
app for which the feedback is posted.
* test: try to fix test case related to feedback change
This commit moves the center of the map to the image's location, if the image has
location EXIF data. If the image does not have location EXIF data, the map will
center on the device's current GPS location.
* feedback: add info about where the feedback gets posted
Fixes#5747
* feedback: avoid underscore in the link's alternative text
* wording
---------
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
I replaced uploadMediaDetail.get(position) with a direct reference to uploadMediaDetail in 3 locations to avoid out of bounds errors.
The usage of RecyclerView in this code is still a bit buggy, and maybe a RecyclerView is not necessary here since the number of items is limited. The fix also revealed problems in the logic of adding the "addButton" only to the last item, which couldn't be reproduced before because the app crashed first. I can submit a new bug for that if this fix goes live.
I did not feel very comfortable with the code so I restricted my commit to fixing the first reported crash, which was resolved in my tests.
* Add AlertDialog for categories and modularize receiveSharedItems
* Improve nearby-place search function for a multi-upload
Enhance the depiction consistency of a multi-upload by ensuring that it corresponds to a single place
* Add javadoc
* Update strings.xml
* Renamed setImageTobeUploaded to setImageToBeUploaded
* Make uploadIsOnPlace private & add a setter
* Rename uploadIsOnPlace to uploadIsOfAPlace
* Use singular when there is only one picture
* Add a 'Do not show again' checkbox on the dialog
* Update strings.xml
---------
Co-authored-by: Giannis Karyotakis <110292528+karyotakisg@users.noreply.github.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
With refactoring of the dataclient module, the model classes now live
within the app's source code itself. So, the existing R8 rules became
obsolete and resulted in the prodRelease version of the app not
working.
So, adjust the R8 rules so that R8 doesn't obsfuscate the model classes
that now live within the app.