Compare commits

...

1772 commits

Author SHA1 Message Date
Ritika Pahwa
63f621cb56
Update contributor list in README.md
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-10-26 14:10:08 +05:30
Eric Pan
e81f916626
Part of issue #5996: Fix IDE warnings in ContributionsListFragment (#6542)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* Part of issue #5996: Fix IDE warnings in ContributionsListFragment (naming, null-safety, deprecations)

* Part of issue #5996: Clean final IDE warnings (parameter name alignment, remove redundant toggle)

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-10-26 08:30:17 +09:00
Ted
28fa7b1a20
Display specific, user-friendly error message when upload categories search API call returns an error (#6540)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* Make OkHttpConnectionFactory raise MwIOException when a non-suppressed API call returns an error

* Add AlertDialog displaying specific error message when categories search API call returns an error

* Add test for error alert dialog to UploadCategoriesFragment unit tests

* Add error handling when API call fails to CategoriesPresenter.onAttachViewWithMedia
2025-10-25 23:24:39 +09:00
translatewiki.net
aae9d4a387
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-10-23 14:02:44 +02:00
Amir E. Aharoni
6873f63cf8
Remove an unused element from layout/fragment_media_detail.xml (#6536)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
I noticed this issue years ago because it used a hard-to-understand
string that needed better documentation (see #688). I forgot it,
but recently, I started to explore the app much more deeply and
came back to it.

It looks like this string is only used in this layout element,
but the element itself is not used anywhere. It usage appears to
have been removed in #634.
2025-10-23 09:41:32 +09:00
Ritika Pahwa
2d0255e5fb
Disable hardware acceleration and keyboard animation (#6535)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* Disable hardware acceleration and keyboard animation

This is a temporary commit to see if it fixes issue #3364

* Remove unused import

* Bump up version code and modify version name

* Modify handleKeyboardInsets to handle insets correctly

* Refactor handleKeyboardInsets()

* Refactor handleKeyboardInsets()

* Fix inset in login activity
2025-10-22 16:44:06 +05:30
translatewiki.net
32ae406cca
Localisation updates from https://translatewiki.net.
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-10-22 10:23:13 +02:00
translatewiki.net
3e04a1f036
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-10-20 14:02:26 +02:00
translatewiki.net
6487191394
Localisation updates from https://translatewiki.net.
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-10-20 06:29:31 +02:00
Amir E. Aharoni
beaf211f39
Fix three Java lint errors (#6531)
* Add braces to conditions.
* Remove an unnecessary semicolon.
* Remove an unnecessary constructor.

This fixes all the Java lint errors of these types.
2025-10-20 10:39:05 +09:00
Amir E. Aharoni
3549789cdf
Delete outdated localization files (#6533)
Strings files for he, id, yi were replaced with iw, in, and ji in 2016.
Those files cause build warnings, and they aren't used,
so it's OK to just remove them.
2025-10-20 10:18:13 +09:00
VoidRaven
def33552f9
Test/2819 add campaigns api tests (#6529)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* test:add mock JSON resource files for campaigns API responses

* feat:make campaign model fields mutable to allow for correct deserialization

* test:implement unit tests for fetching campaigns and fix DTO mocking logic

* test:implement unit tests for fetching campaigns and fix DTO mocking logic

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-10-19 22:58:14 +09:00
Amir E. Aharoni
3a55583460
Disable linting for icon hiding code in preferences (#6519)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-10-18 13:51:46 +09:00
Amir E. Aharoni
717a855149
Fix lint warning about Timber (#6521)
Change trivial string formatting and function calls
for Timber logging.

This resolves all the lint warnings in the
Android/Lint/Correctness/Messages group.
2025-10-18 13:45:35 +09:00
Amir E. Aharoni
29b6d0f8fe
Replace Switch with SwitchMaterial (#6522)
Lint recommended replacing Switch with SwitchMaterial.
This was a very simple replacement, and I tested it in
the custom selector, where it is used, and it works as
it worked previously.
2025-10-18 13:43:37 +09:00
Xinyu Yang
b5b5d8a8e4
I didn’t look at the code carefully before and directly modified the contents of strings.xml. After reviewing it, I found that the issue was actually in WikidataItemDetailsActivity.kt, where the wrong label was selected. After correcting this, there should no longer be any problems. (#6524)
Co-authored-by: frank <u7896083@anu.edu.au>
2025-10-18 11:31:49 +09:00
Aneesh Hebbar
714e5f8a4b
fix(i18n): Correct capitalization for 'Sending thanks' status messages (#6515) (#6518)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-10-17 11:40:48 +09:00
Dmitriy
7d96e94689
Fix crash for bookmarks without descriptions/thumbnails (#6488)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-10-16 19:56:41 +09:00
Xinyu Yang
7a865df909
fix the bug of map reset (#6509)
Co-authored-by: Chengxu Yang <u7954427@anu.edu.au>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-10-16 19:34:17 +09:00
Amir E. Aharoni
864884e7b2
Update alternative texts for the welcome screen (#6512)
* Update alternative texts for the welcome screen

I've also updated their documentation for translators (qq)
in transltaewiki itself.

Resolves #689.

* Fixed typo

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-10-16 19:22:02 +09:00
Amir E. Aharoni
1ecaf09f21
Remove wikimedia_licenses.xml and files that use it (#6513)
This file doesn't seem to be used.

Resolves #6504.
2025-10-16 19:20:18 +09:00
Amir E. Aharoni
1ff2a28326
Replace tab with space in an XML layout file (#6514)
I was working on this file recently, and Android Studio
showed a warning that it has tabs instead of spaces,
so here's it's fixed.

A minor thing, but prevents distractions.
2025-10-16 19:19:30 +09:00
Amir E. Aharoni
b48905a153
Change all parameters to numbered parameters (#6516)
This will solve these errors:
"Format string is not a valid format string so it should not be passed to String.format"
2025-10-16 19:19:02 +09:00
Amir E. Aharoni
09c8d987e1
Simplify android:gravity in two layouts (#6506)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
The "Inspect Code" linter complained that these two files
had Right-to-left text compatibility issues. I couldn't
really see any problems neither in English nor in Hebrew,
but the linter's suggestion still made sense, so I cleaned it up.

This fixes all the errors of the type
"Android Lint: Internationalization / Right-to-left text compatibility issues".
2025-10-15 13:52:05 +09:00
Amir E. Aharoni
2e52adbef8
Clean up empty tags in XML files (#6505)
This resolves all the "XML empty tags" lint errors.
2025-10-15 07:37:17 +09:00
Amir E. Aharoni
61c9de6fcc
Add a missing comma to a message (#6477)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
There should be a comma before "etc." in a list,
and there already is a comma before "etc."
in the string depicts_search_text_hint, so it should be
in this string to for consistency.
2025-10-14 21:42:09 +09:00
Amir E. Aharoni
41d95814c9
Remove the string SingleWebViewActivity (#6494)
Resolves issue #6492.

Remove the title of a web activity and the accompanying
string resource.

This was not a real translatable message, but something that
looks more like an identifier that shouldn't be translated.
As far as I can tell, it's not seen anywhere in the interface
because the actual title is set in the code that calls it.
2025-10-14 21:41:31 +09:00
Amir E. Aharoni
c4cb65fc3c
Improve the grammar of messages about GPX and KML files (#6497)
Add articles, fix capitalization, add ellipses.
2025-10-14 21:40:38 +09:00
Amir E. Aharoni
a1c5974e93
Fix depicts and categories pickers for RTL languages (#6503)
This fixes the layouts to work in both left to right (LTR)
and right to left (RTL) languages.

Also replace two hard-coded strings in the depicts picker
with proper string resources.

Fixes #6502.
2025-10-14 17:54:54 +09:00
Amir E. Aharoni
0c244f369c
Replace android.R.string.* with R.string (#6499)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
All these messages are not really necessary because
the app has its own localizations, and android.R.string
sometimes doesn't display the localized string.

Resolves #6470.
2025-10-13 21:54:32 +09:00
translatewiki.net
b6014b017c
Localisation updates from https://translatewiki.net. 2025-10-13 14:03:10 +02:00
Amir E. Aharoni
91ea4a6e7b
Rephrase images_featured_explanation (#6484)
Make the text of the panel consistent with its title.
The title is "Featured images", so the text should
use the same term.

Also move this resource next to the title, to make it easier
for the translators.
2025-10-13 18:43:59 +09:00
Amir E. Aharoni
1e51c4c5d0
Remove the arrow next to "Add location" (#6491)
This resolves #6489 using the "remove arrow" method.
2025-10-13 18:13:22 +09:00
Amir E. Aharoni
fbd28a0564
Change capitalization of "Add Location" (#6493)
This makes it consistent with "Edit Location" and
"Edit Image", which are used in the same screen.
2025-10-13 18:09:43 +09:00
Amir E. Aharoni
d0965206cd
Cleanup whitespace in the custom_selector_info_text2 string (#6496)
In the current state, it appears confusingly on translatewiki,
with a space in the beginning of a line.

This patch changes it to just two linebreaks.
2025-10-13 18:05:26 +09:00
Amir E. Aharoni
bb330c1771
Change "actioned" to "handled" in translatable strings (#6498)
"actioned" is not so standard in English as a verb.

"handled" sounds more appropriate.
2025-10-13 17:57:27 +09:00
Rohit Verma
14d6c80241
fix: remove location manager and update listener on pause (#6483)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-10-11 23:33:44 +09:00
VoidRaven
4c621364c9
Fix/6404 app crashes theme change multi upload (#6429)
* Prevent IndexOutOfBoundsException in setUploadMediaDetails by validating index and list size (#6404)

* fixed UninitializedPropertyAccessException by safely initializing and accessing imageAdapter (#6404)

* fixed indexOutOfBoundsException by safely handling saved state and index in onViewCreated (#6404)

* resolve Unresolved reference by replacing setImageToBeUploaded with direct field assignments (#6404)

* Fix test compilation by removing obsolete testSetImageToBeUploaded and adding tha testInitializeFragmentWithUploadItem (#6404)

* Fix test compilation by removing testInitializeFragmentWithUploadItem with unresolved onImageProcessed (#6404)

* fix: test failures in UploadMediaDetailFragmentUnitTest by removing obsolete tests and initializing defaultKvStore (#6404)

* Fixed all the typos

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-10-11 21:38:07 +09:00
Amir E. Aharoni
2a9d5db51e
Consistent spelling of "screenshots" in the issue template (#6481)
"Screenshot" is written as one word without a hyphen everywhere
else in this app's code, and generally in the English language.
2025-10-11 21:33:54 +09:00
Amir E. Aharoni
b8d340fbe8
Rephrase the string copy_image_caption_description (#6472)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
I was going over all the strings and documenting them (see #6457),
and I had a very hard time understand what this message does.
I read the code and finally figured it out. I added qq documentation
for it so now it's clearer, but I also think that the English
message can be clearer:
* "subsequent" changed to "the next" - shorter, easier word.
* "media" changed to "item" - "media" could mean a lot of things,
  and "item" is clearer in this context.
2025-10-11 14:54:40 +09:00
Amir E. Aharoni
dd1814c793
Change filename to username in toasts about sending thanks (#6467)
This fixes #6466.

Also fix the messages themselves a bit:
* Removed "successfully" from the success message. This word
  is usually redundant, because the message already says that it
  was done. (In MediaWiki, there's a specific convention about it:
  https://www.mediawiki.org/wiki/Help:System_message#Avoid_jargon_and_slanghttps://www.mediawiki.org/wiki/Help:System_message#Avoid_jargon_and_slang
)
* Added a missing preposition to the failure message.

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-10-11 14:53:57 +09:00
VoidRaven
adb6181e9f
fix: map crash (fixes #6432) (#6479)
* fix: map crash (fixes #6432)

* Fix typos in comments in ExploreMapFragment.kt

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-10-11 14:38:07 +09:00
Jason-Whitmore
0a4b179db5
Fixes Issue 6436: getString(...) must not be null (#6474)
* DatabaseUtils.kt: change getString() to allow null returns

Before this change, a call to getString() would assume that the specified column
name actually exists. A bad String input would cause a null value to be returned
to getString(), which would then throw a NPE because getString() can only return
non null Strings.

This change expands the getString() method to check if the column name exists.
If it does exist, the String is retrieved normally. Else, a null value is
returned. The method signature is changed to allow null return values.

* *Dao.kt: change some usages of getString()

Before this change, the getString() method in DatabaseUtils.kt was changed
to allow returning a null value upon method failure. All usages of getString()
were not changed.

This change updates all usages of getString() which require non null return
values. If null is returned, an empty string is used instead.

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-10-11 14:12:19 +09:00
Amir E. Aharoni
e78db7fa08
Remove the unused message "statistics" (#6478)
Its usage was removed from the file
app/src/main/res/layout/fragment_achievements.xml in a8387f0,
but the message remained in the strings file.

Resolves #6456.
2025-10-11 13:58:19 +09:00
Amir E. Aharoni
7be615bacb
Fix comma splice in a translatable string (#6465)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-10-10 23:46:17 +09:00
Amir E. Aharoni
95d58023c7
Fix punctuation in the string download_failed_we_cannot_download_the_file_without_storage_permission (#6473)
The double exclamation point is really unnecessary.
2025-10-10 23:26:30 +09:00
Amir E. Aharoni
7b8fbc239b
Remove commented out code and associated strings (#6475)
As I was documenting undocumented strings (see #6457), I noticed
that two messages are only used once in a few lines of code that
were commented out in 2023.

To clean up the messages, I am removing them from the strings
list and deleting the commented-out code.
2025-10-10 23:25:46 +09:00
Amir E. Aharoni
30d1107cef
Change "wikicode" to "wikitext" in a message (#6476)
The usual English term is "wikitext". "Wikicode" is used in French
and perhaps some other language, but English uses "wikitext".
2025-10-10 23:05:19 +09:00
Amir E. Aharoni
fe16c44caa
Change Android "OK" string to app's own localization (#6471)
Addressed one instance described in #6470.
2025-10-10 22:40:00 +10:00
translatewiki.net
4ed9ad5085
Localisation updates from https://translatewiki.net.
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-10-09 14:02:46 +02:00
Amir E. Aharoni
755d8311dc
Make some hardcoded strings translatable (#6459)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-10-09 10:07:19 +09:00
Amir E. Aharoni
b6457cc6b9
Rename an identifier with a non-ASCII character (#6460)
Android Studio reported that there's an identifier
with a non-ASCII letter. It was nearbyFılterStateInstance,
with a Turkish dotless i. I renamed to ASCII dotted i.

This brings the number of Internationalization
issues in Inspect Code to zero.
2025-10-09 10:06:23 +09:00
Rohit Verma
2d51a7ce9a
chore: upgrade native libraries for 16KB page size compatibility (#6445)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* chore: bump maplibre-native for 16KB page size compatibility

Also, bump AGP

* chore: bump freso for 16KB page size compatibility and fix build issues

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
Co-authored-by: Ritika Pahwa <83745993+RitikaPahwa4444@users.noreply.github.com>
2025-10-08 23:25:20 +09:00
Amir E. Aharoni
0ade0705e2
Remove leading space from English messages (#6449)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-10-06 08:23:00 +09:00
Ben
6bc25ccd9b
Fix kotling warnings for Image.kt and Folder.kt (part of Issue #5996) (#6441)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* added hash code to folder.kt and image.kt to pair with equals

* fixed deprecation in readParcelable function

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-10-05 22:15:39 +09:00
Amir E. Aharoni
ed7007fc8c
Change a hardcoded string to a translatable message (#6444)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
Follow-up to #6443. Noticed this one after that pull request
was already merged.
2025-10-04 14:10:00 +09:00
Amir E. Aharoni
71ad6a2ce5
Change hardcoded preferences strings to translatable messages (#6443) 2025-10-04 10:43:54 +09:00
Amir E. Aharoni
e9a1af0f52
Change hardcoded strings in the language search dialog to messages (#6440)
Another comment: While working on this, I also noticed that
"Recent Searches" is hardcoded in the XML file, and
I'm not sure where does it actually appear. I fixed it, too,
but perhaps it can be completely removed.

Fixes #6439.
2025-10-04 10:43:10 +09:00
translatewiki.net
10c384ffa7
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-10-02 14:02:46 +02:00
VoidRaven
4e51977fb6
Fix Location Permission Prompt on "Uploaded via Mobile" Tab (#6425)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* Added location prompt at Map screen

* Update menu visibility logic to reflect Map tab selection

* Fix location prompt by deferring permission request to Map tab visibility

* Fix: Restrict location permission prompt to Map tab in Explore section
2025-10-02 09:44:37 +09:00
translatewiki.net
d632c268ae
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-09-29 14:02:35 +02:00
translatewiki.net
be371e5236
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-09-25 14:03:06 +02:00
Rickey H.
25d3068faf
added padding inset for mapview (#6427)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-09-24 23:18:02 +09:00
translatewiki.net
179c7c1855
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-09-18 14:02:55 +02:00
translatewiki.net
8018000584
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-09-15 14:02:29 +02:00
VoidRaven
657af4fe04
Fix #6409: Add listener call in ImageAdapter to update UI and upload (#6420)
* Fix #6409: Add listener call in ImageAdapter to update UI and upload button on deselection

* Fix image deselection issue in ImageAdapter to update UI correctly (#6409)

* Prevent duplicate image selections on multiple taps in ImageAdapter when showAlreadyActionedImages is off (#6409)

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-09-15 18:14:59 +09:00
translatewiki.net
219fcd3dd8
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-09-11 14:02:52 +02:00
LeopoldoDelgadillo
2e9726b84f
Added VISIBLE flag to descriptionEdit inside onResume function at MediaDetailFragment.kt (#6421)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-09-10 22:56:26 +09:00
translatewiki.net
64c6b0c8d0
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-09-08 14:01:58 +02:00
Ritika Pahwa
fcc63b9f09 Add v6.0.2 to CHANGELOG.md
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-09-07 13:13:46 +05:30
Ritika Pahwa
a283ffe2bc Bump up version code and name for the patch release (v6.0.2) 2025-09-07 13:05:55 +05:30
Rohit Verma
2811b181b7
Fix: enable H/W acceleration for UploadActivity to resolve keyboard not showing on Upload Screen (#6418)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* fix: enable h/w acceleration for UploadActivity to resolve ime issue

* fix(upload): handle keyboard insets for bottom buttons at Depicts step

* fix(upload): handle keyboard insets for buttons at select category step

* fix(upload): hide keyboard before navigating to Media License screen

This solves keyboard opened at the License screen issue, if we proceed by pressing next at the Upload Categories screen when the keyboard is opened
2025-09-07 00:35:47 +05:30
Jason-Whitmore
730f314200
Fixes Issue #6384: java.lang.NullPointerException in ReviewActivity (#6394)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
* activity_review.xml: add new GUI elements to replace old ones

Before this commit, the info icon shared the same GUI element with the "Skip this image" text.
This made the Kotlin code to handle taps on the info icon difficult to write, and would crash
with a NPE when the user used a language that is read right to left and the info icon was pressed.

This commit creates new GUI elements. Notably, the info icon has it's own element. A LinearLayout
is used to place the skip button and the info icon button together. Kotlin code can now be
simplified and the NPE bug can be fixed.

* ReviewActivity.kt: simplify info icon code to work with some languages

Before this commit, if the language was set to a language that is read right to left,
pressing the info icon would crash the app with a NPE. This was because the Kotlin
code assumed that the icon would always be on the right of the skip button
(index 2 in the drawable array). When a right to left language was used, the icon
would be on the left and index 2 would be null.

This commit builds upon prior GUI changes. The info icon now has its own button.
Kotlin changes now remove the use of the drawable array to find the info icon and
instead directly references the new info icon button. The info icon button now works
properly for both left-to-right and right-to-left languages while maintaining correct
positioning.

* activity_review.xml: fix xml to be more readable

This commit moves around some lines in the XML to make it more readable.

* activity_review.xml: change button configuration

This change simplifies the button configuration XML and makes the info icon button slightly smaller

---------

Co-authored-by: Ritika Pahwa <83745993+RitikaPahwa4444@users.noreply.github.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-09-05 15:36:47 +09:00
translatewiki.net
81da5c9a1a
Localisation updates from https://translatewiki.net.
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-09-04 14:02:19 +02:00
VoidRaven
a59bf64677
Added the wiki prefix to titles in GlobalFileUsage for issue #6416 (#6417) 2025-09-04 19:47:53 +09:00
VoidRaven
e2c8f85a5b
Make "File usages" items clickable with correct URLs #6307 (#6405)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
* Fix: URL generation for GlobalFileUsage in FileUsagesUiModel.kt for issue #6307

* Add clickable functionality to 'Usages on Other Wikis' in FileUsagesContainer for issue #6307

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-09-02 17:03:28 +09:00
translatewiki.net
dd96c64182
Localisation updates from https://translatewiki.net.
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-09-01 14:02:53 +02:00
Ritika Pahwa
9ba702eaa9
Add v6.0.1 to CHANGELOG.md
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-08-30 12:41:52 +05:30
Ritika Pahwa
296b4c1f52 Bump up version code and name for the patch release (v6.0.1) 2025-08-30 12:34:47 +05:30
Chris Danis
48e7effd0a
fix: add User-Agent to NetworkingModule http client (#6415)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* fix: add User-Agent to NetworkingModule http client

* CommonHeaderRequestInterceptor: publicize

* fix import & style
2025-08-30 07:52:08 +09:00
translatewiki.net
b9f353bb5a
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-08-28 14:02:26 +02:00
translatewiki.net
c22e8447b3
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-08-25 14:03:00 +02:00
Ritika Pahwa
f810a2d49b Bump up version code to 1056 for v6.0.0 release
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-08-23 12:37:19 +05:30
Rohit Verma
4f3f7b97fd
fix: use context instead of requireContext() for backward compatibility (#6403)
It fixes crash when opening certain screens like Contribution Details, Bookmark, etc. on lower Android versions

Co-authored-by: Ritika Pahwa <83745993+RitikaPahwa4444@users.noreply.github.com>
2025-08-23 12:33:30 +05:30
Rohit Verma
718c466505
Bump target sdk to API 35 and make the app UI compatible with edge to edge (#6393)
* chore: upgrade target SDK and refactor function signatures to resolve build issues

* chore: bump android gradle plugin version

* chore(ui): add extension functions for applying edge to edge insets

* fix: apply system bar top and bottom insets for edge to edge

* fix: force edge to edge for backward compatibility and consistent UI

* fix: apply top bar insets as padding and make the status bar color white

Since the toolbars have primary color as bg, we should make the status bar white

* chore: bump robolectric version for API 35 compatibility

* fix: preserve existing margins when adding new insets

* feat(customselector): improve RecyclerView edge-to-edge inset handling

It allows the last item to sits above the navigation bar while preserving edge-to-edge appearance.

* feat(notification): improve RecyclerView edge-to-edge insets handling

Also, refactor LocationPicker and DescriptionEdit activities to use extension functions and reduce duplication

* fix(quiz): enable and handle edge-to-edge insets and status icon colors

* fix: bottom insets not dispatched on all API versions consistently

Upgraded core-ktx version installCompatInsetsDispatch wasn't available on current version

* fix: return fallback value when versionName is null

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fix: resolve compilation errors

* docs: add KDoc for edge-to-edge insets utility functions

* fix(SearchActivity): apply insets for system bars

* fix(util): add utility function to handle keyboard insets with animation

* fix(upload): handle keyboard insets for upload media detail card view

* fix(login): hadle IME insets and make edge-to-edge backward compatible

---------

Co-authored-by: Ritika Pahwa <83745993+RitikaPahwa4444@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-23 12:27:37 +05:30
translatewiki.net
b8a558303b
Localisation updates from https://translatewiki.net. 2025-08-21 14:02:13 +02:00
Ritika Pahwa
a892aa6dee
6357: Fix java.lang.SecurityException for multi-uploads (#6402)
* Fix java.lang.SecurityException for ACTION_OPEN_DOCUMENT

* Handle SecurityException in case of multi-upload

* Remove unused import

* Clean up code

* Clean up code

* Handle SecurityException for other upload methods

* Release persisted URI permissions for successful uploads

* Remove persistable permission for custom picker as it's not required

* Remove persistable permission for in-app camera as it's not required
2025-08-20 01:46:02 +10:00
translatewiki.net
5a6b3cbf09
Localisation updates from https://translatewiki.net. 2025-08-18 14:02:18 +02:00
Rohit Verma
5bdfbf5f6f
fix: NPE when changing theme while on profile screen (#6398) 2025-08-16 15:06:57 +05:30
translatewiki.net
1d7d2801e4
Localisation updates from https://translatewiki.net. 2025-08-14 14:01:59 +02:00
translatewiki.net
5201af70cd
Localisation updates from https://translatewiki.net. 2025-08-11 14:01:53 +02:00
translatewiki.net
d0e95bc3c2
Localisation updates from https://translatewiki.net. 2025-08-07 14:02:05 +02:00
Sonal Yadav
ffb9af1f1c
Support both "label" and "itemLabel" for NearbyResultItem mapping (#6386)
* Support both label and itemLabel for robust NearbyResultItem mapping.

* fix code style

* Add getOriginalLabel() for Wikidata edits to avoid fallback issues with itemLabel

* Fix Wikidata edit failure by resetting hasInvalidLocation flag on upload confirmation

---------

Co-authored-by: Sonal Yadav <sonalyadav@Sonals-MacBook-Air.local>
2025-08-05 13:13:40 +09:00
translatewiki.net
6dcce45c59
Localisation updates from https://translatewiki.net. 2025-08-04 14:02:18 +02:00
Paul Hawke
6f36cae767
Convert explore package to kotlin (#6389)
* Convert WikidataItemDetailsActivity to kotlin

* Convert RecentSearchesDao to kotlin

* Convert RecentSearchesFragment to kotlin

* Convert ExploreListRootFragment to kotlin

* Convert the ParentViewPager to kotlin

* Convert ExploreMapRootFragment to kotlin

* Convert SearchActivity to kotlin

* Convert ExploreFragment to kotlin

* Convert ExploreMapCalls and ExploreMapContract to kotlin

* Convert ExploreMapController to kotlin

* Convert the map presenter to kotlin

* Convert the ExploreMapFragment to kotlin

* Fix import issue
2025-08-04 11:44:00 +09:00
Ritika Pahwa
516039c91d
Add v5.6.1 to CHANGELOG.md 2025-08-02 12:34:34 +05:30
Paul Hawke
8de57304bf
Convert bookmarks package to kotlin (#6387)
* Convert BookmarkItemsController to kotlin

* Split BookmarkItemsDao apart and converted to Kotlin

* Convert and cleanup content providers

* Convert BookmarkItemsFragment to kotlin

* Convert BookmarkPicturesFragment to kotlin

* Convert BookmarkPicturesDao to kotlin and share some useful DB methods

* Convert BookmarkPicturesController to kotlin

* Convert BookmarkFragment to kotlin

* Convert BookmarksPagerAdapter to kotlin

* Convert BookmarkListRootFragment to kotlin
2025-08-01 08:26:16 +09:00
translatewiki.net
869371b485
Localisation updates from https://translatewiki.net. 2025-07-31 14:02:22 +02:00
translatewiki.net
929711da98
Localisation updates from https://translatewiki.net. 2025-07-28 14:01:44 +02:00
Ritika Pahwa
b2816e1459 Bump up version code to 1055 for v5.6.1 release
Revert SPARQL optimisation
2025-07-26 12:32:54 +05:30
Ritika Pahwa
532bd8baa6 Revert "Optimise SPARQL query for single entity metadata using wikibase:label (#6376)"
This reverts commit e5dbcfc2a1.
2025-07-26 12:32:48 +05:30
Sonal Yadav
90ab7a2766
Correct NearbyResultItem label mapping for place name display (#6382)
* Fix  Nearby place name missing in Nearby Place Found popup

* minor change

---------

Co-authored-by: Sonal Yadav <sonalyadav@Sonals-MacBook-Air.local>
2025-07-25 23:35:14 +09:00
translatewiki.net
ee33a9350f
Localisation updates from https://translatewiki.net. 2025-07-24 14:02:07 +02:00
translatewiki.net
f1e6f1ad31
Localisation updates from https://translatewiki.net. 2025-07-21 14:02:00 +02:00
Ritika Pahwa
11e3e37263 Bump up version code to 1054 for v5.6.0 release 2025-07-19 14:46:01 +05:30
translatewiki.net
da694022ac
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-07-17 14:02:00 +02:00
VoidRaven
29ade1e5b7
Fix email verification input (#6367)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* Set imeOptions to actionDone and enforce singleLine for xlarge

* Set imeOptions to actionDone and enforce singleLine for landscape

* Set imeOptions to actionDone and enforce singleLine

* Update askUserForTwoFactorAuth for IME_ACTION_DONE to trigger performLogin

* Fix email verification: Set imeOptions to actionDone and replace singleLine with maxLines=1

* Fix email verification: Set imeOptions to actionDone and replace singleLine with maxLines=1

* Fix email verification: Set imeOptions to actionDone and replace singleLine with maxLines=1

* feat: Set imeOptions to actionNext for login_password to improve focus transition

* feat: Enhance keyboard visibility for email verification code input
2025-07-17 09:41:28 +09:00
Shravya K Suresh
88565b70c5
updated the strange wording (#6378)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-07-16 23:11:21 +09:00
Sonal Yadav
e5dbcfc2a1
Optimise SPARQL query for single entity metadata using wikibase:label (#6376)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* Optimize SPARQL query for single entity metadata using wikibase:label service

- Use SERVICE wikibase:label for efficient retrieval of labels and descriptions in preferred language
- Remove redundant label/description fetching logic
- Prevent Cartesian product and improve query performance for

* appeded all possible Wikidata languages

* Remove duplicate 'en'

* Update query_for_item.rq

* formatting, comments

---------

Co-authored-by: Sonal Yadav <sonalyadav@Sonals-MacBook-Air.local>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-07-16 17:22:10 +09:00
Copilot
0cda8e4d70
Show author/uploader names in Media Details for Commons licensing compliance (#6375)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* Initial plan

* Implement author/uploader display in Media Details

Co-authored-by: nicolas-raoul <99590+nicolas-raoul@users.noreply.github.com>

* Enhanced implementation to use getAttributedAuthor() for better attribution coverage

Co-authored-by: nicolas-raoul <99590+nicolas-raoul@users.noreply.github.com>

* Move Author/Uploader fields to be positioned after License field

Co-authored-by: nicolas-raoul <99590+nicolas-raoul@users.noreply.github.com>

* Remove unnecessary comment lines as requested

Co-authored-by: nicolas-raoul <99590+nicolas-raoul@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: nicolas-raoul <99590+nicolas-raoul@users.noreply.github.com>
2025-07-15 23:42:55 +09:00
translatewiki.net
7500b6d374
Localisation updates from https://translatewiki.net.
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-07-14 14:01:46 +02:00
Ritika Pahwa
a4c7a9c4f7
Fix java.lang.SecurityException for ACTION_OPEN_DOCUMENT (#6370)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-07-14 08:56:35 +05:30
Paul Hawke
8fc7e1039b
Convert media package to kotlin (#6369)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* Convert Caption to kotlin

* Convert CaptionListViewAdapter to kotlin

* Convert CaptionListViewAdapter to kotlin

* Removed unused class

* Converted MwParseResult / MwParseResponse to kotlin

* Convert CustomOkHttpNetworkFetcher to kotlin

* Break up MediaDetailPagerFragment to make it easier to convert to kotlin

* Convert MediaDetailProvider to kotlin

* Convert the MediaDetailAdapter to kotlin

* Convert MediaDetailPagerFragment to kotlin
2025-07-12 11:11:20 +09:00
translatewiki.net
79f52db929
Localisation updates from https://translatewiki.net. 2025-07-10 14:02:16 +02:00
translatewiki.net
13048cc2fd
Localisation updates from https://translatewiki.net. 2025-07-07 14:01:56 +02:00
Paul Hawke
66395b9871
convert top level classes to kotlin (#6368)
* Converted welcome activity / pager to kotlin

* Removed unused interface

* Convert ViewPagerAdapter to kotlin and enforce that all tabs must have a title that comes from strings.xml

* Convert OkHttpConnectionFactory and remove an exception class nobody was using

* Convert MapController to kotlin along with fixing nullability in a few places
2025-07-07 09:50:16 +09:00
VoidRaven
65f41beed8
Update bug-report.yml to use Type:bug label as per issue #6356 (#6363)
* Update bug-report.yml to use Type:bug label as per issue #6356

* Update bug-report.yml to use type: bug and labels: ['Type: bug'] as per issue #6356

* Update bug-report.yml to use type: Bug and revert labels to ['bug'] as per mentor's feedback for issue #6356

* Remove labels field from bug-report.yml as per feedback for issue #6356

---------

Co-authored-by: Ritika Pahwa <83745993+RitikaPahwa4444@users.noreply.github.com>
2025-07-05 11:35:54 +05:30
Sonal Yadav
f98b49608e
fix popup from appearing in nearby (#6359)
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-07-05 13:15:57 +09:00
Paul Hawke
3bd0ec4466
Convert top level "Utils" class to kotlin (#6364)
* Unused class removed

* Convert BasePresenter to kotlin

* Removed redundent class

* Move the Utils class into the utils package

* Inline the creation of a page title object

* Move license utilities into their own file

* Inline app rating since its only ever used in 1 place

* Moved GeoCoordinates utilities into their own class

* Moved Monuments related utils into their own class

* Moved screen capture into its own util class

* Moved handleWebUrl to its own utility class

* Moved fixExtension to its own class

* Moved clipboard copy into its own utility class

* Renames class to match remaining utility method

* Convert UnderlineUtils to kotlin

* Converted the copy-to-clipboard utility to kotlin

* Converted license name and url lookup to kotlin

* Converted fixExtension to kotlin

* Convert handleGeoCoordinates to kotlin

* Monument utils converted to kotlin

* Convert then inline screeen capture in kotlin

* Convert handleWebUrl to kotlin
2025-07-04 20:18:52 +09:00
translatewiki.net
4befff8f42
Localisation updates from https://translatewiki.net. 2025-07-03 14:02:08 +02:00
Ritika Pahwa
89436b0a75
Add v5.5.0 to CHANGELOG.md 2025-07-01 11:52:08 +05:30
translatewiki.net
6de5a07e0d
Localisation updates from https://translatewiki.net. 2025-06-30 14:01:39 +02:00
translatewiki.net
27b9d70333
Localisation updates from https://translatewiki.net. 2025-06-29 20:27:27 +02:00
Jason-Whitmore
9a94dc2548
Fixes Issue 6312: GPS has huge error and does not update (in Nearby) (#6352)
* NearbyParentFragment.kt: add helper methods for user location overlays and accuracy data.

Before this commit, the code used to create the user location overlays was in multiple places.
Additionally, there was no easy way to access the location accuracy.

This commit places the user location overlay creation code into helper methods, as well as adding
a new location accuracy getter method. These methods can now be used to refactor other parts of the file.

* NearbyParentFragment.kt: create method to update user location overlays

Before this commit, there was no easy way to update the user location overlays.

This commit adds the updateUserLocationOverlays() method, which will properly replace
the old user location overlays with new ones. It will also add the overlays if they
do not already exist.

* NearbyParentFragment.kt: replace old code with calls to updateUserLocationOverlays()

This commit completes the refactor and fixes the issue of the user overlays not
updating. The new method updateUserLocationOverlays is called to refactor and simplify
old code.

* Removal of file is not related to the issue, but is needed for project to compile and run.

* NearbyParentFragment.kt: fix bug where multiple user location overlays would appear

Before this commit, the user could see multiple user location overlays if they paused the app and reopened it when
there are no Places/pins on the map. This was caused by a linear search failing to identify the target overlay
because it compared Drawables between two Overlays, which was unreliable.

This commit contains a better solution for replacing existing user location overlays by adding 2 instance variables
to keep track of the overlays. The position of these overlays in the overlay list can then be found by using indexOf()
with these instance variables rather than the linear search that was implemented before. Some refactoring was also done.

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-06-29 18:30:10 +09:00
translatewiki.net
b1a8308aaf
Localisation updates from https://translatewiki.net. 2025-06-26 14:02:13 +02:00
Rohit Verma
ad7dddaac4
Fix infinite loading circular progress bar after nominating for deletion (#6324)
* fix: infinite loading progress bar after nominating for deletion

* add logs for testing

* refactor: use globalFileUsage instead of achievement to append in reason

Fetching achievements is a time consuming operation and globalFileUsage gives the similar result in optimal time

* test(ReasonBuilder): fix tests according to new behavior

* refactor: remove logs added for testing

* test: await for async getReason method call

---------

Co-authored-by: Neel Doshi <neeldoshi147@gmail.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-06-25 12:24:03 +09:00
Rohit Verma
5d7f42d127
Fix/file usage not working (#6354)
* chore: add R8 rules to prevent obfuscating file usage classes

* chore: upgrade lifecycle-runtime dependency to resolve lint errors

* remove invalid resource directory
2025-06-24 21:56:00 +09:00
translatewiki.net
d9e8917418
Localisation updates from https://translatewiki.net. 2025-06-23 14:01:45 +02:00
Sonal Yadav
09da7b8d68
Skip image upload to Wikidata (nearby -> green pins) (#6349)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
* Skip image upload to Wikidata if item already has image

* Re-run CI

* no more Failed to update Wikidata for green pins
2025-06-22 22:40:15 +09:00
Ritika Pahwa
ca5c7ec966
Bump up version code to 1053
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-06-21 13:21:05 +05:30
translatewiki.net
9eff9e8e82
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-06-19 14:01:44 +02:00
Rohit Verma
5665bc7f93
fix: make userName private to prevent conflict when passing arguments (#6339)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-06-17 17:33:43 +09:00
translatewiki.net
20e5df7d49
Localisation updates from https://translatewiki.net.
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-06-16 14:01:42 +02:00
translatewiki.net
d3ae925567
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-06-12 14:01:42 +02:00
translatewiki.net
af82cb2123
Localisation updates from https://translatewiki.net.
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-06-12 06:17:24 +02:00
translatewiki.net
7df52e3f9c
Localisation updates from https://translatewiki.net. 2025-06-12 06:06:17 +02:00
translatewiki.net
6b40560dfc
Localisation updates from https://translatewiki.net. 2025-06-12 05:27:59 +02:00
translatewiki.net
54bb789461
Localisation updates from https://translatewiki.net. 2025-06-12 05:20:46 +02:00
translatewiki.net
7979be17c1
Localisation updates from https://translatewiki.net. 2025-06-12 05:05:50 +02:00
translatewiki.net
91564a1dff
Localisation updates from https://translatewiki.net. 2025-06-12 04:36:42 +02:00
Sonal Yadav
2b5f0e4ac9
drop down menu in the Upload Wizard now show the language in which the pin's label is shown (#6346)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-06-11 21:11:49 +09:00
translatewiki.net
9b04031c91
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-06-09 14:01:52 +02:00
Ritika Pahwa
8ff52e6815
Fix crash on app startup by bumping up room database version
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-06-08 19:16:01 +05:30
Ritika Pahwa
c41b5cc9da
Add v5.4.1 to CHANGELOG.md
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-06-08 12:38:14 +05:30
Ritika Pahwa
767b625289
Bump up version code to 1052 2025-06-08 12:35:24 +05:30
Sonal Yadav
f45f26e602
Implement single selection logic in custom image picker (#6341)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* build failure cause

* Fix image selector logic in custom picker
2025-06-07 23:09:47 +09:00
translatewiki.net
06a613e855
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-06-05 14:02:03 +02:00
Jason-Whitmore
62c5231dc9
ExploreMapFragment.java: modify Overlay onItemSingleTapUp code to place Overlay above other Overlays (#6334)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
Before these changes, when a user tapped on an icon in the Explore Map, the icon and label would often
appear underneath other icons, making it difficult or impossible to read the text on the label.

These changes add two methods that search for and move the icon/label Overlays above all other icons and overlays.
These two methods are called when the user taps on an icon.

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-06-05 17:06:55 +09:00
Saifuddin Adenwala
7a224a9120
Fix invalid resource directory causing test failure (#6337) 2025-06-05 16:47:09 +09:00
translatewiki.net
593335aea3
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-06-03 17:59:39 +02:00
Dev Jadiya
6edc6a22e4
Refactor long log line in SingleWebViewActivity to comply with code style (#6333)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-06-03 09:30:52 +09:00
translatewiki.net
230604f5ef
Localisation updates from https://translatewiki.net.
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-06-02 14:02:04 +02:00
Jason-Whitmore
73f5200c2d
ExploreMapFragment.java: fix removeMarker code to correctly find the specified marker (#6325)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
Before this change, removeMarker() would search for the correct Overlay by doing a linear
search and matching the BaseMarker's Place name with the Overlay's title.
This stopped working once the Overlay's title text was changed to be more user friendly.

This change implements a more robust solution. A map is used to directly associate
BaseMarkers with the matching Overlay. The overlay can now be removed from the
overlay list without using any of the information contained within the BaseMarker
or Overlay.

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-05-31 12:05:33 +09:00
translatewiki.net
95b8ac74b9
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-05-29 14:01:52 +02:00
rayane
cfc2cfcca1
Fix Kotlin warnings (related to issue #5996) (#6320)
* refactor: replace unused exception variable with underscore

* refactor: code style fix

* fix: remove unnecessary latLng variable and return null directly

* fix: use explicit true/false instead of isFABsExpanded

* refactor: simplify marker update logic by reducing redundant conditions

* refactor: use data object instead of object

* fix: check placeBindings for null instead of checking each destructured value

* fix: check placeBindings for null instead of checking each destructured value

* docs: fix KDoc for contentUri property by removing incorrect @param tag

* docs: correct @see link in KDoc for showBadgesWithCount

* docs: fix KDoc tag from @property to @param for context in BottomSheetAdapter

* docs: comment out KDoc for disabled method to avoid unresolved @param warning

* docs: fix KDoc for onLongPress by removing invalid @param imageUri

* docs: clean up invalid KDoc tags on property and add docs to isEmpty

* docs: remove invalid @param originalImageCoordinates from findOtherImages KDoc

* docs: fix incorrect @param tag in checkDuplicateImage KDoc

* docs: fix incorrect @param in onLongPress KDoc

* docs: fix invalid @param and @return tags on author property

* docs: fix incorrect @param in provideWikidataMediaInterface KDoc

* docs: fix incorrect @param name in getWikiText KDoc

* docs: escape wikilinks with [[ ]] to avoid KDoc resolution warnings

* docs: fix KDoc by adding missing param descriptions to startActivityWithFlags

* docs: fix KDoc by replacing @param with @property for contentUri

* docs: fix malformed KDoc in startYourself, remove invalid @param line

* docs: remove invalid @param tag in createDialogsAndHandleLocationPermissions

* docs: remove invalid @param tags to @property

* @docs: remove invalid @property tags

* docs: clean up KDoc by removing invalid @param and @return tags

* docs: fix incorrect @param name in removeBlocklisted KDoc

* docs: fix incorrect @param name in checkDuplicateImage KDoc

* docs: fix incorrect @param tag

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-05-29 20:25:00 +09:00
Rohit Verma
ed1485ca22
Migrated from Groovy to Kotlin DSL and upgrade AGP version (#6322)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* chore: migrate groovy build files to Kotlin DSL and upgrade AGP

chore: use version catalog to manage dependencies

chore: move plugins to version catalog

remove deprecated way of enabling build-config and redundant code

chore: setup triplet-play plugin configuration

refactor: move dependency block and tasks to the end of build file

refactor: move dependency block and mark redundant dependencies

* cleanup: remove redundant dependencies from build file

* cleanup: remove git utils file as the functions moved to build file

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-05-28 20:43:13 +09:00
Sonal Yadav
c49c85e68b
Fix : UninitializedPropertyAccessException (#6248)
* Fix crash when uploading a duplicate file

* Fix: app crash

* added Kdoc

* remove line b/w kdoc and function

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-05-28 17:53:28 +09:00
translatewiki.net
91ca2e6672
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-05-26 14:01:50 +02:00
Sonal Yadav
8849f8984b
Fix: Use concise Wikidata feedback message while keeping full UI text (#6318)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-05-25 23:17:04 +10:00
translatewiki.net
bb21e4bdcd
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-05-22 14:02:27 +02:00
Jason-Whitmore
eb617ae8ca
Fixes Issue 6308: Explore map shows image at my location rather than at shown location (#6315)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
* ExploreMapFragment.java: add helper methods and fields to enable proper Explore map behavior

Before this commit, there was no way to tell if the user had arrived from the Nearby and
before the Nearby map center location had been searched for markers.

This commit adds a boolean flag to indicate this situation. Access, modification, and
initialization methods were added for this boolean value. Additionally, a helper
method to retrieve the Nearby map center LatLng was added as a convienience.

* ExploreMapPresenter.java: fix map update code to search for Nearby LatLng when appropriate

Before this commit, when the user selected "Show in explore" in Nearby when no pins were
on the map, Explore would only search for markers at the user's current GPS location,
rather than those at the Nearby map center.

After this commit, code was added to check if the user recently came from the Nearby map.
If so, the stored coordinates of the Nearby map is searched rather than the user's current
GPS coordinates. Additionally, the boolean that indicates that the user recently came
from the Nearby map is set to false. This ensures that the stored Nearby map center
coordinates are not used when the user taps the icon to focus the map on their
current location.

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-05-21 16:54:45 +09:00
translatewiki.net
b3c1474b31
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-05-19 14:01:55 +02:00
Ritika Pahwa
21ffcb56fd Bump up version code to 1051
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-05-18 12:44:37 +05:30
translatewiki.net
f977e16774
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-05-12 14:01:59 +02:00
Jason-Whitmore
012020735f
Fixes Issue 6262: [Bug]: Error occurred while loading images (#6291)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
* ImageInfo.kt: remove call to updateThumbURL()

Before this commit, the updateThumbURL() method would attempt to derive a larger resolution thumbnail URL
from the current thumbnail's width and height. This derived thumbnail URL would sometimes not match
an actual URL. Even creating this thumbnail URL would sometimes fail when doing string manipulation.
Both errors can cause issues, with the second one crashing the thread and preventing images from being
loaded.

This commit simply removes the call to updateThumbURL(). Images with their thumbnails now load correctly,
especially with panoramic images.

* MediaInterface.kt: fix MediaWiki API call to retrieve thumbnail URLs properly

Before this change, the API calls to MediaWiki would request thumbnails with atleast a specific width,
rather than height. These thumbnails would often be extremely low resolution on very wide images,
such as panoramas.

This change instead requests thumbnails with atleast a specific height. Panorama thumbnails are now
at a higher resolution than before. Additionally, the height parameter is now represented as an
integer which can be changed more easily.

* ViewPagerAdapter.java: create new constructor with behavior parameter

Before this commit, ViewPagerAdapter only had one constructor which used the default
behavior where more than the current fragment would be in the Resume state.

This commit adds a constructor where the behavior parameter can be specified.

* ExploreFragment.java: modify onCreateView to use new ViewPagerAdapter constructor

Before this change, onCreateView would use the old ViewPagerAdapter constructor, which
had a default behavior where fragments not currently visible would be in the Resume
state.

After this change, the new ViewPagerAdapter constructor is used with a non-default
behavior where only the visible fragment would be in the Resume state. This has
performance benefits for most users since the Fragments will only be active
when they want to view them.

* ExploreMapFragment.java: remove redundant method call

Before this commit, performMapReadyActions() was called in both onViewCreated and onResume.
In effect, the method is called twice before the user can even see the map, leading to
performance issues.

After this commit, the call in onViewCreated is removed. The method is now called only once
when the user switches to the ExploreMapFragment.

* ExploreMapFragment.java: remove method call that causes recursive loop

Before this commit, there was a call loop that included onScroll and animateTo
on the map. These two method calls caused performance issues in
ExploreMapFragment.

This commit breaks the call loop by removing moveCameraToPosition from getMapCenter.
Also, the removed code did not fit the purpose of getMapCenter.

* ExploreMapFragment.java: fix performMapReadyActions to center to user's last known location

Before this commit, fixing a previous bug caused performMapReadyActions to center the map
on a default location rather than the available last known location.

This commit adds code which will attempt to get the last known user location. If it cannot
be retrieved, the default location is used. The map now centers properly.

* MediaInterface.kt: adjust thumbnail height parameter

Before this commit, the thumbnail height parameter was too small, causing low resolution thumbnails to render.

This commit more than doubles the parameter, increasing the thumbnail resolution.

---------

Co-authored-by: Ritika Pahwa <83745993+RitikaPahwa4444@users.noreply.github.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-05-10 20:04:57 +09:00
Rohit Verma
3f2077a6db
tests: move to androidTest source-set (#6302)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-05-09 23:36:34 +09:00
translatewiki.net
f06ae4ebfe
Localisation updates from https://translatewiki.net.
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-05-08 14:02:08 +02:00
translatewiki.net
865824a8e3
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-05-05 14:01:48 +02:00
Ifeoluwa Andrew Omole
4d2170257a
Nearby List: Only show place cards with loaded names (#6301)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-05-04 15:38:18 +05:30
translatewiki.net
0024e72a2e
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-05-01 14:01:50 +02:00
translatewiki.net
60aca9a5e3
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-04-28 14:01:51 +02:00
translatewiki.net
d0f6c16878
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-04-24 14:02:11 +02:00
Yusuke Matsubara
8fded5ef6e
Change back some variable names that were accidentally changed (#6297) 2025-04-24 20:16:03 +09:00
Yusuke Matsubara
329a68216e
Improve credit line in image list (#6295)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
- When author is not uploader, show both.
- When failing to parse author from HTML, use structured data.
2025-04-23 23:23:09 +09:00
translatewiki.net
30762971db
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-04-21 14:01:47 +02:00
Khushbu Khemchandani
7479d96675
Code Enhancement (Explore Map) (#6293)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
* Exclude past locations (P585) from Nearby query

* "Send" button text should be white

* Custom picker: logic

* Revert back changes

* Enhancement :- Explore Map information

* Enhancement :- Explore Map information

* Style

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-04-21 14:49:15 +09:00
translatewiki.net
ed42d85f67
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-04-17 14:01:53 +02:00
Sonal Yadav
78d29bcf20
FIX : Custom picker detect images that is already in commons (#6288)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
* Fix: Exclude specific text from being posted in WikidataFeedback

* Add detection logic for images already on Commons in custom picker
2025-04-15 13:53:26 +10:00
Ritika Pahwa
1a13cb3383
Add v5.3.0 to CHANGELOG.md
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-04-15 02:43:33 +05:30
Khushbu Khemchandani
9289dcc42c
UI enhancement Issue(#6285) (#6287)
* Exclude past locations (P585) from Nearby query

* "Send" button text should be white
2025-04-14 22:58:28 +09:00
translatewiki.net
efdc9c5548
Localisation updates from https://translatewiki.net.
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-04-14 14:01:44 +02:00
Khushbu Khemchandani
69b3544107
Exclude past locations (P585) from Nearby query (#6284)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-04-14 10:54:29 +09:00
Ritika Pahwa
5b5aeead88
Bump up version code to 1050
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-04-13 13:09:19 +05:30
Prinuel
4bacac1f8b
BookmarkLocationsFragment.kt:fix android studio warnings for this file, : Eliminated three unused imports, and changed calls to object: FilePicker.HandleActivityResult to use lamda (#6283)
Co-authored-by: bethel-m <bethelcletus87@gmail.com>
2025-04-13 14:39:14 +09:00
samimshoaib01
6aeb3c07cc
ui: make recenter FAB theme-aware using Material attributes (#6281)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-04-12 21:05:42 +05:30
Sonal Yadav
2c41176a6e
Mark for closed locations (P3999) in Nearby (#6273)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
* Exclude closed locations (P3999) from Nearby query

* feat: Show  for P3999 items (official closure)

* revert changes

* Add P3999 (date of closure) support for non-existent places

* Typo fixing

* fix-typo

* .

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-04-11 18:00:47 +09:00
translatewiki.net
e3dd00bcfa
Localisation updates from https://translatewiki.net.
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-04-10 14:01:48 +02:00
Jason-Whitmore
262efe4d8c
ExploreMapFragment.java: fix removeMarker() to remove the correct marker (#6279)
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
Before this change, the removeMarker() method would determine the correct overlay to remove
by comparing an overlay's Place coordinates with the target BaseMarker's Place coordinates.
If two different markers had the same Place coordinates, the incorrect marker would be removed,
leading to more than one green label appearing on the screen.

After this change, the removeMarker() method now compares an overlay's title with the BaseMarker's
Place name. removeMarker() will work properly as long as all BaseMarker's Place names are unique.
Also, null checks were added to removeMarker().
2025-04-10 14:19:31 +09:00
Dmitry Brant
2eed441462
Enable EmailAuth support. (#6277)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-04-08 20:59:28 +09:00
translatewiki.net
56fa8ceb5a
Localisation updates from https://translatewiki.net.
Some checks are pending
Android CI / Run tests and generate APK (push) Waiting to run
2025-04-07 14:01:50 +02:00
Rohit Verma
7bf9276d1a
fix: resolve IndexOutOfBounds error when removing images from top card (#6124)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
replace deprecated onBackPressed with onBackPressedCallback

remove unit test for deprecated onBackPressed method

remove if-check before deleting picture to prevent hiding top thumbnail card

hide the thumbnail card on fragments other than MediaDetailFragment

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-04-05 22:47:27 +09:00
Prinuel
51da9e4dd6
FooterAdapter.kt: changed enum access of FooterItem, from FooterItem.values to FooterItem.entries, this is the more efficient way of accessing Enum values as introduced in kotlin 1.9 (#6271)
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
Co-authored-by: bethel-m <bethelcletus87@gmail.com>
2025-04-03 21:10:41 +09:00
translatewiki.net
731ff62faf
Localisation updates from https://translatewiki.net. 2025-04-03 14:01:45 +02:00
translatewiki.net
fdfd7781e9
Localisation updates from https://translatewiki.net.
Some checks failed
Android CI / Run tests and generate APK (push) Has been cancelled
2025-03-31 14:01:52 +02:00
Jason-Whitmore
6e090c8d7a
ExploreMapFragment.java: fix marker labels in Explore map fragment to display the username (#6260)
Before this change, the labels that would appear on the marker when tapped did not include
the author or username. Instead, it displayed "Unknown".

After this change, the labels now display the author name. If the author name is not
available, the username will be displayed. If both are unavailable, the default value
of "Unknown" will be displayed. To improve the readability of the text, any HTML text
is removed from the username/author.
2025-03-31 17:49:06 +09:00
Ritika Pahwa
44966645ca
Add v5.2.0 to CHANGELOG.md 2025-03-29 13:21:03 +05:30
translatewiki.net
669f3043ae
Localisation updates from https://translatewiki.net. 2025-03-27 13:01:54 +01:00
translatewiki.net
5a5e660a43
Localisation updates from https://translatewiki.net. 2025-03-24 13:01:43 +01:00
Ritika Pahwa
2e05a58e8b
Bump up version code to 1049 2025-03-22 14:07:51 +05:30
translatewiki.net
f1f4e8baff
Localisation updates from https://translatewiki.net. 2025-03-20 13:01:41 +01:00
Sonal Yadav
828f69fc46
Update Privacy Policy Link to GitHub.io (#6255)
* "moved privacy policy"

* Update PRIVACY_POLICY_URL to https://commons-app.github.io/privacy-policy as suggested

* Use BuildConfig.PRIVACY_POLICY_URL in launchPrivacyPolicy function
2025-03-20 07:21:33 +09:00
Ritika Pahwa
954a7aee91
Bump up version code and name (#6250)
* Bump up version code and name

* Remove unintended change
2025-03-18 23:28:19 +09:00
translatewiki.net
fa0bdf5747
Localisation updates from https://translatewiki.net. 2025-03-17 13:01:37 +01:00
Sonal Yadav
67ac92ff57
Fix NullPointerException in onBackPressed() (#6249) 2025-03-17 07:53:58 +09:00
Sonal Yadav
e1466c866b
Fix NullPointerException in UploadCategoriesFragment (#6246) 2025-03-14 16:16:14 +10:00
translatewiki.net
ba89894dc4
Localisation updates from https://translatewiki.net. 2025-03-13 13:01:53 +01:00
translatewiki.net
c46c1d2353
Localisation updates from https://translatewiki.net. 2025-03-10 13:01:11 +01:00
Saifuddin Adenwala
30322707fc
Migrated media/zoomControllers package to kotlin (#6204)
* Rename .java to .kt

* Migrated media/zoomControllers package to kotlin

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-03-08 22:47:23 +09:00
Parneet Singh
972bf785f1
Fix empty username (#6209)
* revert changes from #5860

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* read author prop instead

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* Use user prop if author is empty or null

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* fix test

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

---------

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2025-03-08 22:26:41 +09:00
Rohit Verma
32d485cc51
fix: null context issue by removing context getter override (#6218)
Refactored related code to resolve build issues
2025-03-08 22:02:28 +09:00
Parneet Singh
d11439f85d
add cancel button listener (#6216)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2025-03-07 09:52:52 +09:00
Rohit Verma
681881f4f6
fix: crash when opening leader board tab (#6220) 2025-03-07 08:21:31 +09:00
Nicolas Raoul
939d01b267 Bumped to 5.1.3 to reflect feature parity but the real 5.1.3 release was performed in the google_play_safe branch 2025-03-06 23:00:45 +09:00
translatewiki.net
d233de6103
Localisation updates from https://translatewiki.net. 2025-03-06 13:01:40 +01:00
Parneet Singh
139a296bd3
Comment in PR with generated builds. (#6226)
* revert prior attempt

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* trigger workflows_run event after uploading artifacts

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

---------

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2025-03-03 21:44:08 +09:00
translatewiki.net
6b56075df8
Localisation updates from https://translatewiki.net. 2025-03-03 13:01:29 +01:00
Rohit Verma
218476acbc
fix: rename isDarkTheme property to prevent recursion (#6231) 2025-03-02 06:19:43 +10:00
translatewiki.net
fa24b93830
Localisation updates from https://translatewiki.net. 2025-02-27 13:01:51 +01:00
Parneet Singh
b2f655522e
bump to action's v4 (#6225)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2025-02-27 10:11:32 +09:00
Nicolas Raoul
88eedc3506 Revert previous commit, wrong branch
This reverts commit aa84dedd64.
2025-02-26 18:03:24 +09:00
Nicolas Raoul
aa84dedd64 Removed Explore, Peer review, because we are at risk of being removed from Google Play tomorrow 2025-02-26 18:00:48 +09:00
Saifuddin Adenwala
1c7dce9e12
Migrated bookmarks locations to Kotlin and adapt room database (#6148)
* Rename .java to .kt

* Refactor: Migrate bookmark location logic to Kotlin

This commit migrates the bookmark location logic to Kotlin, enhancing code maintainability and readability.

-   Removes the `BookmarkLocationsContentProvider`, `BookmarkLocationsController`, and `BookmarkLocationsDao` Java classes.
-   Creates `BookmarkLocationsDao.kt` and `BookmarkLocationsContentProvider.kt` in Kotlin.
-   Migrates the logic from `BookmarkLocationsFragment.java` to `BookmarkLocationsFragment.kt`.
-   Updates test files to reflect these changes.
-   Addresses associated code review comments.

* Refactor: Migrate to Room Database for Bookmark Locations

This commit migrates the bookmark locations functionality from a custom content provider to Room database.

Key changes:

*   **Removal of `BookmarkLocationsContentProvider`:** This class, which previously handled data storage, has been removed.
*   **Introduction of `BookmarksLocations`:** This data class now represents a bookmarked location, serving as the Room entity.
*   **Creation of `BookmarkLocationsDao`:** This Room DAO handles database interactions for bookmark locations, including:
    *   Adding, deleting, and querying bookmarked locations.
    *   Checking if a location is already bookmarked.
    *   Updating the bookmark status of a location.
    *   Retrieving all bookmarked locations as `Place` objects.
*   **`BookmarkLocationsViewModel`:** Added to manage the data layer for bookmark locations
*   **`NearbyUtil`:** Created a Util class for Nearby to manage the bookmark locations.
*   **Updates in `PlaceAdapter` and `PlaceAdapterDelegate`:** These classes have been modified to work with the new Room-based data layer.
*   **Updates in `AppDatabase`:** The database now includes `BookmarksLocations` as an entity and exposes the `bookmarkLocationsDao`.
*   **Updates in `FragmentBuilderModule` and `CommonsApplicationModule`**: for DI
*   **Removal of `DBOpenHelper` upgrade for locations**: as it is no longer needed
* **Updates in `NearbyParentFragmentPresenter`**: refactored the logic to use the dao functions
* **Updates in `NearbyParentFragment`**: refactored the logic to use the util and dao functions
* **Update in `BookmarkLocationsController`**: removed as its no longer needed
* **Add `toPlace` and `toBookmarksLocations`**: extension functions to map between data class and entities
* **Update in `CommonsApplication`**: to remove old db table.

* Refactor: Improve bookmark location handling and update database version

This commit includes the following changes:

-   Updates the database version to 20.
-   Refactors bookmark location handling within `NearbyParentFragment` to improve logic and efficiency.
-   Introduces `getBookmarkLocationExists` in `NearbyUtil` to directly update bookmark icons in the bottom sheet adapter.
-   Removes unused provider.
-   Adjusts `BookmarkLocationsFragment`'s `PlaceAdapter` to use `lifecycleScope` for better coroutine management.
-   Refactors `updateBookmarkLocation` in `NearbyParentFragmentPresenter`.

* Toggle bookmark icon in BottomSheetAdapter instead of finding the location each time in the bookmark

* Update bookmark button image in `BottomSheetAdapter`
* Add new toggle function to `BottomSheetAdapter`
* Call the toggle function in `NearbyParentFragment`

* Refactor: Load bookmarked locations using Flow

*   `BookmarkLocationsController`: Changed to use `Flow` to load bookmarked locations.
*   `BookmarkLocationsDao`: Changed to return `Flow` of bookmark location instead of a list.
*   `BookmarkLocationsFragment`: Used `LifecycleScope` to collect data from flow and display it.
*   Removed unused `getAllBookmarkLocations()` from `BookmarkLocationsViewModel`.
*   Used `map` in `BookmarkLocationsDao` to convert from `BookmarksLocations` to `Place` list.

* Loading locations data in fragment

*   BookmarkLocationsController: Changed `loadFavoritesLocations` to be a suspend function.
*   BookmarkLocationsFragment: Updated the `initList` function to call the controller's suspend function.
*   BookmarkLocationsDao: Changed `getAllBookmarksLocations` and `getAllBookmarksLocationsPlace` to be suspend functions.

* Refactor BookmarkLocationControllerTest and related files to use coroutines

*  Migrated `bookmarkDao!!.getAllBookmarksLocations()` to `bookmarkDao!!.getAllBookmarksLocationsPlace()` and added `runBlocking`
*  Added `runBlocking` for `loadBookmarkedLocations()` and `testInitNonEmpty()`
*  Added `runBlocking` for `getAllBookmarksLocations()` and update `updateMapMarkers`

These changes improve the test structure by ensuring the database functions are executed within a coroutine context.

* Refactor BookmarkLocationsFragment and add tests for BookmarkLocationsDao

*   Moved `initList` to `BookmarkLocationsFragment` for better lifecycle handling.
*   Added test case for `BookmarkLocationsFragment`'s onResume.
*   Added test cases for `BookmarkLocationsDao` operations like adding, retrieving, finding, deleting and updating bookmarks.

* Refactor BookmarkLocationsFragment to load favorites only when view is not null

* BookmarkLocationsFragment: load favorites locations only when view is not null.
* BookmarkLocationsFragmentTest: added spy and verify to test onResume() call initList() method.

* Refactor database and add migration

*   `AppDatabase`: Updated to use room migration.
*   `CommonsApplicationModule`: added migration from version 19 to 20 to `appDatabase`

* Rename .java to .kt

* Refactor: Migrate bookmark location logic to Kotlin

This commit migrates the bookmark location logic to Kotlin, enhancing code maintainability and readability.

-   Removes the `BookmarkLocationsContentProvider`, `BookmarkLocationsController`, and `BookmarkLocationsDao` Java classes.
-   Creates `BookmarkLocationsDao.kt` and `BookmarkLocationsContentProvider.kt` in Kotlin.
-   Migrates the logic from `BookmarkLocationsFragment.java` to `BookmarkLocationsFragment.kt`.
-   Updates test files to reflect these changes.
-   Addresses associated code review comments.

* Refactor: Migrate to Room Database for Bookmark Locations

This commit migrates the bookmark locations functionality from a custom content provider to Room database.

Key changes:

*   **Removal of `BookmarkLocationsContentProvider`:** This class, which previously handled data storage, has been removed.
*   **Introduction of `BookmarksLocations`:** This data class now represents a bookmarked location, serving as the Room entity.
*   **Creation of `BookmarkLocationsDao`:** This Room DAO handles database interactions for bookmark locations, including:
    *   Adding, deleting, and querying bookmarked locations.
    *   Checking if a location is already bookmarked.
    *   Updating the bookmark status of a location.
    *   Retrieving all bookmarked locations as `Place` objects.
*   **`BookmarkLocationsViewModel`:** Added to manage the data layer for bookmark locations
*   **`NearbyUtil`:** Created a Util class for Nearby to manage the bookmark locations.
*   **Updates in `PlaceAdapter` and `PlaceAdapterDelegate`:** These classes have been modified to work with the new Room-based data layer.
*   **Updates in `AppDatabase`:** The database now includes `BookmarksLocations` as an entity and exposes the `bookmarkLocationsDao`.
*   **Updates in `FragmentBuilderModule` and `CommonsApplicationModule`**: for DI
*   **Removal of `DBOpenHelper` upgrade for locations**: as it is no longer needed
* **Updates in `NearbyParentFragmentPresenter`**: refactored the logic to use the dao functions
* **Updates in `NearbyParentFragment`**: refactored the logic to use the util and dao functions
* **Update in `BookmarkLocationsController`**: removed as its no longer needed
* **Add `toPlace` and `toBookmarksLocations`**: extension functions to map between data class and entities
* **Update in `CommonsApplication`**: to remove old db table.

* Refactor: Improve bookmark location handling and update database version

This commit includes the following changes:

-   Updates the database version to 20.
-   Refactors bookmark location handling within `NearbyParentFragment` to improve logic and efficiency.
-   Introduces `getBookmarkLocationExists` in `NearbyUtil` to directly update bookmark icons in the bottom sheet adapter.
-   Removes unused provider.
-   Adjusts `BookmarkLocationsFragment`'s `PlaceAdapter` to use `lifecycleScope` for better coroutine management.
-   Refactors `updateBookmarkLocation` in `NearbyParentFragmentPresenter`.

* Toggle bookmark icon in BottomSheetAdapter instead of finding the location each time in the bookmark

* Update bookmark button image in `BottomSheetAdapter`
* Add new toggle function to `BottomSheetAdapter`
* Call the toggle function in `NearbyParentFragment`

* Refactor: Load bookmarked locations using Flow

*   `BookmarkLocationsController`: Changed to use `Flow` to load bookmarked locations.
*   `BookmarkLocationsDao`: Changed to return `Flow` of bookmark location instead of a list.
*   `BookmarkLocationsFragment`: Used `LifecycleScope` to collect data from flow and display it.
*   Removed unused `getAllBookmarkLocations()` from `BookmarkLocationsViewModel`.
*   Used `map` in `BookmarkLocationsDao` to convert from `BookmarksLocations` to `Place` list.

* Loading locations data in fragment

*   BookmarkLocationsController: Changed `loadFavoritesLocations` to be a suspend function.
*   BookmarkLocationsFragment: Updated the `initList` function to call the controller's suspend function.
*   BookmarkLocationsDao: Changed `getAllBookmarksLocations` and `getAllBookmarksLocationsPlace` to be suspend functions.

* Refactor BookmarkLocationControllerTest and related files to use coroutines

*  Migrated `bookmarkDao!!.getAllBookmarksLocations()` to `bookmarkDao!!.getAllBookmarksLocationsPlace()` and added `runBlocking`
*  Added `runBlocking` for `loadBookmarkedLocations()` and `testInitNonEmpty()`
*  Added `runBlocking` for `getAllBookmarksLocations()` and update `updateMapMarkers`

These changes improve the test structure by ensuring the database functions are executed within a coroutine context.

* Refactor BookmarkLocationsFragment and add tests for BookmarkLocationsDao

*   Moved `initList` to `BookmarkLocationsFragment` for better lifecycle handling.
*   Added test case for `BookmarkLocationsFragment`'s onResume.
*   Added test cases for `BookmarkLocationsDao` operations like adding, retrieving, finding, deleting and updating bookmarks.

* Refactor BookmarkLocationsFragment to load favorites only when view is not null

* BookmarkLocationsFragment: load favorites locations only when view is not null.
* BookmarkLocationsFragmentTest: added spy and verify to test onResume() call initList() method.

* Refactor database and add migration

*   `AppDatabase`: Updated to use room migration.
*   `CommonsApplicationModule`: added migration from version 19 to 20 to `appDatabase`

* Resolve conflicts and attach the `commons.db` with `common_room.db` during the migration to persist the data

* Refactor database migration to handle null values and use direct insertion

*   Modify the database migration from version 19 to 20 to properly handle null values and use direct data insertion.
*   Create a new table `bookmarks_locations` with `NOT NULL` constraints.
*   Directly insert data into the new table from old database, safely handling `NULL` values by using `DEFAULT` empty string value.
*   Close old database cursor and the database connection.
* Drop the old `bookmarksLocations` table.

* Refactor database schema to delete `bookmarksLocations` table and migrate data

*   Delete `bookmarksLocations` table from the database during schema upgrade
*   Migrate data from `bookmarksLocations` to `bookmarks_locations` in new schema
*   Add `INSERT OR REPLACE` to prevent duplication during migration
*   Delete `CONTRIBUTIONS_TABLE` and `BOOKMARKS_LOCATIONS` in the application start-up to have a fresh DB for first start-up after update

* Update sqlite-based database version to 22.

* Update sqlite-based database version to 22.

* Refactor CommonsApplicationModule to utilize application context

* Initialize and use application context directly

* Utilize lateinit for application context

* Added line breaks for improved readability.

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-02-24 22:58:26 +09:00
translatewiki.net
1c4797d3aa
Localisation updates from https://translatewiki.net. 2025-02-24 13:01:49 +01:00
Sujal
b2927483fa
Update android-ci-comment.yml (#6200) 2025-02-24 16:19:35 +09:00
Sujal
fda87b7823
Fixed Build Status Badge (#6203)
* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md
2025-02-24 15:52:35 +09:00
Nicolas Raoul
71d3d12020
limit to the best issues for newcomers 2025-02-24 10:56:41 +09:00
Parneet Singh
50eb13a850
delete file (#6205)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2025-02-23 22:36:52 +09:00
Sujal
a8e38f4329
Updated Icon & Added Animation for Nearby (#6201)
* Applied better animation in nearby

* Refactor: Reduce Duration of Rotate Animation

Decreased the duration of the rotate animation from 1000ms to 500ms in `rotate.xml`, resulting in a faster rotation speed.
2025-02-23 22:36:07 +09:00
Sujal
d32ab15d42
Optimize Image Handling and Open Wikidata Media within app (#6187)
* implementing

* implementing

* implementing

* implementing

* implementing

* make new changes

* done

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-02-22 13:18:12 +09:00
Sujal
8dd1091608
Separate Workflow for Commenting on PR with APK Links (#6199)
* Update android.yml

* Create android-ci-comment.yml

* Update android.yml
2025-02-22 13:11:57 +09:00
translatewiki.net
44f69fcabd
Localisation updates from https://translatewiki.net. 2025-02-20 13:01:50 +01:00
Sujal
8d0da86569
Automatically Link APKs in PR Discussion After Building (#6195)
* Update android.yml

* Update android.yml

* Update android.yml

* Update android.yml

* Update android.yml
2025-02-19 21:43:58 +09:00
Jason-Whitmore
98b25acab9
Fixes Issue 5933: Nearby: Display of all nearby pins makes the app sluggish, leads to crashes (#6181)
* Place.java: change getWikiDataEntityID() method to increase speed

Before this commit, this method would perform the String replace method on the Wikidata link every time
getWikiDataEntityID() was called. Also, getWikiDataLink() was called. This caused poor performance
since both method calls are slow.

This commit changes the method to only run the slow methods if the entityID field is empty or
null. Once the field is populated, the method simply returns the field. This change allows
getWikiDataEntityID() to run much faster.

* NearbyParentFragmentPresenter.kt: change async and place update parameters

Before this commit, the parameters that configure the async and place update code contributed to
the slow loading of the red and green map markers.

This commit changes the parameters such that the red and green map markers load much faster.

These parameters may need further tuning. This commit's changes are simply an educated
guess at a good parameter set.

* NearbyParentFragment.kt: rewrite Java Drawable caching code to Kotlin

Before this commit, the code which cached Drawables was written in Java.

This commit rewrites that code into the new Kotlin file, which replaces the Java file.

* NearbyParentFragmentPresenter.kt: change loadPlacesDataAsync to retry HTTP requests after failure

Before this commit, when an HTTP request failed, the entire batch of Places would not get updated,
even if it was only one Place in the batch that caused the failure.

This commit changes the code such that upon HTTP request failure, new HTTP requests are sent with
one Place per request. This allows more Places to be fetched from the server.
2025-02-19 15:42:24 +09:00
Sujal
40241b4142
Fix #6188 (Nearby upload not being linked from Wikidata), though it introduces issue #6191
* Make neccesary changes

* Make neccesary changes

* spacing

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-02-17 23:02:45 +09:00
translatewiki.net
7a685b1241
Localisation updates from https://translatewiki.net. 2025-02-17 13:01:49 +01:00
translatewiki.net
34943542bf
Localisation updates from https://translatewiki.net. 2025-02-13 13:01:47 +01:00
Sujal
6345fef6bf
Migrated nearby parent fragment file to kotlin (#6177)
* Rename .java to .kt

* Migrated

* Migrated

* Migrated
2025-02-12 16:51:22 +09:00
translatewiki.net
a529ba8032
Localisation updates from https://translatewiki.net. 2025-02-10 13:01:39 +01:00
Sonal Yadav
e9e2697369
Fix: Fix crash when adding location after removing a picture (#6175)
* Fix: Resolved the Crash in UploadMediaDetailFragment

* Fix uninitialized basicKvStoreFactory in UploadMediaPresenter

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-02-07 23:10:18 +09:00
Sujal
12cadd0186
Migrated contributions folder Files from java to kotlin (#6176)
* Rename .java to .kt

* Migrated ContributionController

* Rename .java to .kt

* Migrated ContributionDao

* Rename .java to .kt

* Migrated ContributionsContract,ContributionFragment,ContributionListAdapter,ContributionsListContract from java to Kotlin

* Rename .java to .kt

* converted/Migrated

* converted/Migrated

* Rename .java to .kt

* Migrated ContributionController

* Rename .java to .kt

* Migrated ContributionDao

* Rename .java to .kt

* Migrated ContributionsContract,ContributionFragment,ContributionListAdapter,ContributionsListContract from java to Kotlin

* Rename .java to .kt

* Show placeholder and display depiction section when no depictions are available (#6163) (#6165)

* corrected

* corrected

* Update MediaDetailFragment.kt

Spelling correction

* Migrated AboutActivity from Java to Kotlin (#6158)

* Rename Constants to Follow Kotlin Naming Conventions

>This PR refactors constant names in the project to adhere to Kotlin's UPPERCASE_SNAKE_CASE naming convention, improving code readability and maintaining consistency across the codebase.

>Renamed the following constants in LoginActivity:
>saveProgressDialog → SAVE_PROGRESS_DIALOG
>saveErrorMessage → SAVE_ERROR_MESSAGE
>saveUsername → SAVE_USERNAME
>savePassword → SAVE_PASSWORD

>Updated all references to these constants throughout the project.

* Update Project_Default.xml

* Refactor variable names to adhere to naming conventions

Renamed variables to use camel case:
-UPLOAD_COUNT_THRESHOLD → uploadCountThreshold
-REVERT_PERCENTAGE_FOR_MESSAGE → revertPercentageForMessage
-REVERT_SHARED_PREFERENCE → revertSharedPreference
-UPLOAD_SHARED_PREFERENCE → uploadSharedPreference

Renamed variables with uppercase initials to lowercase for alignment with Kotlin conventions:
-Latitude → latitude
-Longitude → longitude
-Accuracy → accuracy

Refactored the following variable names:
-NUMBER_OF_QUESTIONS → numberOfQuestions
-MULTIPLIER_TO_GET_PERCENTAGE → multiplierToGetPercentage

* Refactor Dialog View Initialization with Null-Safe Calls

This PR refactors the dialog setup code in CustomSelectorActivity to improve safety and readability by replacing explicit casts with null-safe generic calls for findViewById.

>Replaced explicit casting (as Button and as TextView) with the generic findViewById<T>() method for improved type safety.
>Added null-safety (?.) to avoid potential crashes if a view is not found in the dialog layout.

why changed:-
>Prevents runtime crashes caused by NullPointerException when a view is missing in the layout.

* Refactor Unit Test: Replace Unsafe Casting with Type-Safe Mocking for findViewById

>PR refactors the unit test for NearbyParentFragment by replacing unsafe casting in the findViewById mocking statements with type-safe

>Ensured all findViewById mocks now use a consistent, type-safe format (findViewById<View>(...)) to reduce verbosity and potential casting errors.

>Verified the functionality of prepareViewsForSheetPosition remains unchanged, ensuring no regression in test behavior.

* Update NearbyParentFragmentUnitTest.kt

* Refactor: Rename Constants to Follow CamelCase Naming Convention

>Updated all constant variable names to follow the camelCase naming convention, removing underscores in the middle or end.

>Ensured variable names remain descriptive and align with code readability best practices.

* Replace private val with const val for URL constants in QuizController

* Renaming the constant to use UPPER_SNAKE_CASE

* Renaming the constant to use UPPER_SNAKE_CASE

* Update Done

* **Refactor: Convert `minimumThresholdForSwipe` to a compile-time constant**

* Convert AboutActivity from Java to Kotlin

This PR converts the AboutActivity class from Java to Kotlin

>Testing:
>Verified all functionalities of the AboutActivity, including toolbar setup, intent launches, and dialog interactions, to ensure behavior remains consistent post-conversion.
>Successfully ran unit tests for AboutActivity to confirm the correctness of methods and logic.

* Thank you for the suggestion! Since these methods all take a single View parameter, replacing them with method references is a great way to simplify the code and improve readability. I'll updated the code accordingly. Added a TODO in the code as a reminder to refactor this in the future.

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>

* Localisation updates from https://translatewiki.net.

* Feat: Make it smoother to switch between nearby and explore maps (#6164)

* Nearby: Add 'Show in Explore' 3-dots menu item

* MainActivity: Add methods to pass extras between Nearby and Explore

* MainActivity: Extend loadFragment() to support passing fragment arguments

* Nearby: Add ability to navigate to Explore fragment on 'Show in Explore' click

* Explore: Read fragment arguments for Nearby map data and update Explore map if present

* Explore: Add 'Show in Nearby' 3-dots menu item. Only visible when Map tab is selected

* Explore: On 'Show in Nearby' click, navigate to Nearby fragment, passing map data as fragment args

* Nearby: Read fragment arguments for Explore map data and update Nearby map if present

* MainActivity: Fix memory leaks when navigating between bottom nav destinations

* Explore: Fix crashes caused by unattached map fragment

* Refactor code to pass unit tests

* Explore: Format javadocs

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>

* Localisation updates from https://translatewiki.net.

* enhance spammy category filter (#6167)

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* Localisation updates from https://translatewiki.net.

* correction

* correction

* correction

* GitHub workflow to build betaDebug (#6174)

* [Bug fix] Check if duplicate exist using both original and modified file's checksum (#6169)

* check original file's SHA too along with modified one

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* fix tests

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

---------

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* Add multiline input for caption and description (#6173)

* allow multiple lines for description/caption

* make caption multiline too

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>

* correction

---------

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
Co-authored-by: Akshay Komar <146421342+Akshaykomar890@users.noreply.github.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: Ifeoluwa Andrew Omole <iomole3@gmail.com>
Co-authored-by: Parneet Singh <111801812+parneet-guraya@users.noreply.github.com>
Co-authored-by: Matija Nalis <mnalis-git@voyager.hr>
2025-02-07 10:03:38 +09:00
Matija Nalis
1e77b1457a
Add multiline input for caption and description (#6173)
* allow multiple lines for description/caption

* make caption multiline too

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-02-05 15:56:57 +09:00
Parneet Singh
43dca1dd14
[Bug fix] Check if duplicate exist using both original and modified file's checksum (#6169)
* check original file's SHA too along with modified one

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* fix tests

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

---------

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2025-02-05 04:20:22 +10:00
Matija Nalis
30a7f702a1
GitHub workflow to build betaDebug (#6174) 2025-02-04 19:34:14 +09:00
translatewiki.net
0293b865b4
Localisation updates from https://translatewiki.net. 2025-02-03 13:01:34 +01:00
Parneet Singh
7566ddf529
enhance spammy category filter (#6167)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2025-02-01 09:13:17 +09:00
translatewiki.net
e653857437
Localisation updates from https://translatewiki.net. 2025-01-31 09:49:38 +01:00
Ifeoluwa Andrew Omole
7b291535e0
Feat: Make it smoother to switch between nearby and explore maps (#6164)
* Nearby: Add 'Show in Explore' 3-dots menu item

* MainActivity: Add methods to pass extras between Nearby and Explore

* MainActivity: Extend loadFragment() to support passing fragment arguments

* Nearby: Add ability to navigate to Explore fragment on 'Show in Explore' click

* Explore: Read fragment arguments for Nearby map data and update Explore map if present

* Explore: Add 'Show in Nearby' 3-dots menu item. Only visible when Map tab is selected

* Explore: On 'Show in Nearby' click, navigate to Nearby fragment, passing map data as fragment args

* Nearby: Read fragment arguments for Explore map data and update Nearby map if present

* MainActivity: Fix memory leaks when navigating between bottom nav destinations

* Explore: Fix crashes caused by unattached map fragment

* Refactor code to pass unit tests

* Explore: Format javadocs

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-30 21:58:00 +09:00
translatewiki.net
9dc9a3b8ab
Localisation updates from https://translatewiki.net. 2025-01-30 13:01:33 +01:00
Akshay Komar
5d4474ead6
Migrated AboutActivity from Java to Kotlin (#6158)
* Rename Constants to Follow Kotlin Naming Conventions

>This PR refactors constant names in the project to adhere to Kotlin's UPPERCASE_SNAKE_CASE naming convention, improving code readability and maintaining consistency across the codebase.

>Renamed the following constants in LoginActivity:
>saveProgressDialog → SAVE_PROGRESS_DIALOG
>saveErrorMessage → SAVE_ERROR_MESSAGE
>saveUsername → SAVE_USERNAME
>savePassword → SAVE_PASSWORD

>Updated all references to these constants throughout the project.

* Update Project_Default.xml

* Refactor variable names to adhere to naming conventions

Renamed variables to use camel case:
-UPLOAD_COUNT_THRESHOLD → uploadCountThreshold
-REVERT_PERCENTAGE_FOR_MESSAGE → revertPercentageForMessage
-REVERT_SHARED_PREFERENCE → revertSharedPreference
-UPLOAD_SHARED_PREFERENCE → uploadSharedPreference

Renamed variables with uppercase initials to lowercase for alignment with Kotlin conventions:
-Latitude → latitude
-Longitude → longitude
-Accuracy → accuracy

Refactored the following variable names:
-NUMBER_OF_QUESTIONS → numberOfQuestions
-MULTIPLIER_TO_GET_PERCENTAGE → multiplierToGetPercentage

* Refactor Dialog View Initialization with Null-Safe Calls

This PR refactors the dialog setup code in CustomSelectorActivity to improve safety and readability by replacing explicit casts with null-safe generic calls for findViewById.

>Replaced explicit casting (as Button and as TextView) with the generic findViewById<T>() method for improved type safety.
>Added null-safety (?.) to avoid potential crashes if a view is not found in the dialog layout.

why changed:-
>Prevents runtime crashes caused by NullPointerException when a view is missing in the layout.

* Refactor Unit Test: Replace Unsafe Casting with Type-Safe Mocking for findViewById

>PR refactors the unit test for NearbyParentFragment by replacing unsafe casting in the findViewById mocking statements with type-safe

>Ensured all findViewById mocks now use a consistent, type-safe format (findViewById<View>(...)) to reduce verbosity and potential casting errors.

>Verified the functionality of prepareViewsForSheetPosition remains unchanged, ensuring no regression in test behavior.

* Update NearbyParentFragmentUnitTest.kt

* Refactor: Rename Constants to Follow CamelCase Naming Convention

>Updated all constant variable names to follow the camelCase naming convention, removing underscores in the middle or end.

>Ensured variable names remain descriptive and align with code readability best practices.

* Replace private val with const val for URL constants in QuizController

* Renaming the constant to use UPPER_SNAKE_CASE

* Renaming the constant to use UPPER_SNAKE_CASE

* Update Done

* **Refactor: Convert `minimumThresholdForSwipe` to a compile-time constant**

* Convert AboutActivity from Java to Kotlin

This PR converts the AboutActivity class from Java to Kotlin

>Testing:
>Verified all functionalities of the AboutActivity, including toolbar setup, intent launches, and dialog interactions, to ensure behavior remains consistent post-conversion.
>Successfully ran unit tests for AboutActivity to confirm the correctness of methods and logic.

* Thank you for the suggestion! Since these methods all take a single View parameter, replacing them with method references is a great way to simplify the code and improve readability. I'll updated the code accordingly. Added a TODO in the code as a reminder to refactor this in the future.

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-30 16:41:27 +09:00
Sujal
36f844a709
Show placeholder and display depiction section when no depictions are available (#6163) (#6165)
* corrected

* corrected

* Update MediaDetailFragment.kt

Spelling correction
2025-01-29 22:50:29 +09:00
Tanmay Gupta
e01ecb20fa
maps intent: preserve zoom and show red pin (#6160)
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-28 11:36:35 +09:00
yuvraj-coder1
41170d81d9
fix: logout user after account deletion by navigating to login screen (#6159) 2025-01-27 22:39:32 +10:00
translatewiki.net
7400872f87
Localisation updates from https://translatewiki.net. 2025-01-27 13:01:31 +01:00
Tanmay Gupta
aedcd7f9b9
Review: Load thumbnail instead of original image (#6153)
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-24 16:02:33 +09:00
Tanmay Gupta
bb974f8935
Android CI: Update upload-artifact version (#6157) 2025-01-24 09:52:09 +09:00
translatewiki.net
77bad3380c
Localisation updates from https://translatewiki.net. 2025-01-23 13:01:40 +01:00
translatewiki.net
3570377678
Localisation updates from https://translatewiki.net. 2025-01-20 13:01:41 +01:00
Akshay Komar
d4ababc0a5
Refactor: Rename Constants to Follow CamelCase Naming Convention (#6126)
* Rename Constants to Follow Kotlin Naming Conventions

>This PR refactors constant names in the project to adhere to Kotlin's UPPERCASE_SNAKE_CASE naming convention, improving code readability and maintaining consistency across the codebase.

>Renamed the following constants in LoginActivity:
>saveProgressDialog → SAVE_PROGRESS_DIALOG
>saveErrorMessage → SAVE_ERROR_MESSAGE
>saveUsername → SAVE_USERNAME
>savePassword → SAVE_PASSWORD

>Updated all references to these constants throughout the project.

* Update Project_Default.xml

* Refactor variable names to adhere to naming conventions

Renamed variables to use camel case:
-UPLOAD_COUNT_THRESHOLD → uploadCountThreshold
-REVERT_PERCENTAGE_FOR_MESSAGE → revertPercentageForMessage
-REVERT_SHARED_PREFERENCE → revertSharedPreference
-UPLOAD_SHARED_PREFERENCE → uploadSharedPreference

Renamed variables with uppercase initials to lowercase for alignment with Kotlin conventions:
-Latitude → latitude
-Longitude → longitude
-Accuracy → accuracy

Refactored the following variable names:
-NUMBER_OF_QUESTIONS → numberOfQuestions
-MULTIPLIER_TO_GET_PERCENTAGE → multiplierToGetPercentage

* Refactor Dialog View Initialization with Null-Safe Calls

This PR refactors the dialog setup code in CustomSelectorActivity to improve safety and readability by replacing explicit casts with null-safe generic calls for findViewById.

>Replaced explicit casting (as Button and as TextView) with the generic findViewById<T>() method for improved type safety.
>Added null-safety (?.) to avoid potential crashes if a view is not found in the dialog layout.

why changed:-
>Prevents runtime crashes caused by NullPointerException when a view is missing in the layout.

* Refactor Unit Test: Replace Unsafe Casting with Type-Safe Mocking for findViewById

>PR refactors the unit test for NearbyParentFragment by replacing unsafe casting in the findViewById mocking statements with type-safe

>Ensured all findViewById mocks now use a consistent, type-safe format (findViewById<View>(...)) to reduce verbosity and potential casting errors.

>Verified the functionality of prepareViewsForSheetPosition remains unchanged, ensuring no regression in test behavior.

* Update NearbyParentFragmentUnitTest.kt

* Refactor: Rename Constants to Follow CamelCase Naming Convention

>Updated all constant variable names to follow the camelCase naming convention, removing underscores in the middle or end.

>Ensured variable names remain descriptive and align with code readability best practices.

* Replace private val with const val for URL constants in QuizController

* Renaming the constant to use UPPER_SNAKE_CASE

* Renaming the constant to use UPPER_SNAKE_CASE

* Update Done

* **Refactor: Convert `minimumThresholdForSwipe` to a compile-time constant**

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-18 23:06:52 +09:00
yuvraj-coder1
1c6ebafb29
feat: show the proper message in the custom picker when all images are either uploaded or marked. (#6095)
* feat: show the message "Congratulations, all pictures in this album have been either uploaded or marked as not for upload." in the custom picker when all images are either uploaded or marked.

* refactor: fix indentation in the code

* refactor: replace LiveData with StateFlow

* fix: fixed the bug that was causing one ImageFragment testcase to fail.

* fix: fixed the Congratulation message being shown for a brief moment while switching off the switch

* refactor: move hardcoded string to strings.xml.

* docs: add comment to clarify visibility logic in ImageFragment

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-18 23:04:28 +09:00
Sujal
23e1f01783
fix/handle-shared-files-and-error-handling (#6141) 2025-01-18 03:19:16 +10:00
Tanmay Gupta
ef032b0f93
Disable vanishing option when logged out (#6135) 2025-01-18 03:19:00 +10:00
Yusuke Matsubara
35a2fe87db
Use variant-dependent variable to make URLs for vanishing (#6117) 2025-01-17 17:33:50 +09:00
Rohit Verma
9f1fe8737f
Fix crash when opening in-app Camera for the very first time (#6139)
* fix: correctly handle permission callbacks on Main thread

The PermissionUtils was incorrectly executing permission callbacks on a background thread, leading to a Handler error. Now, it is using Main dispatcher.

* fix crash when opening camera while having partial storage access
2025-01-17 15:37:07 +09:00
translatewiki.net
2d6583fea6
Localisation updates from https://translatewiki.net. 2025-01-16 13:01:53 +01:00
Tanmay Gupta
1e64acdf1d
If depicted Wikidata item has no associated Commons category property, then suggest categories from its P18 (#6130)
* Fix NPE with UploadMediaDetails.captionText

* Store P18 instead of processed image url in DepictedItem

* Add routes for fetching category info from titles

* Consider depict's P18 when suggesting categories

* Add tests

* Corrected DepictedItem constructor arguments

* Add test for DepictedItem::primaryImage
2025-01-16 18:04:04 +09:00
Tanmay Gupta
1f33926ed5
Share login state with SingleWebViewActivity (#6136) 2025-01-16 17:49:09 +09:00
Ifeoluwa Andrew Omole
16ac08fe21
change status bar color to grey in dark mode (#6120)
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-16 17:41:37 +09:00
Sujal
70291a0cb2
Migrated Java profile package to kotlin (#6119)
* Rename .java to .kt

* Migrate Profile Package to Kotlin #6118 #5928

* Migrate Profile Package to Kotlin #6118 #5928

* Migrate Profile Package to Kotlin #6118 #5928
2025-01-16 16:36:02 +09:00
Tanmay Gupta
62136b5b09
Fix NPE with UploadMediaDetails.captionText (#6128)
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-15 22:52:35 +09:00
Kaartic Sivaraam
76078cf3b5 Merge remote-tracking branch 'origin/v5.1.0' 2025-01-15 12:52:36 +05:30
Kaartic Sivaraam
be0b1db193 Version v5.1.2 2025-01-15 12:50:53 +05:30
Kaartic Sivaraam
a796a8adcf category: fix category search in explore
This is a change that replicates the fix done via PR #6093.
This is based over v5.1.1 as the fix seems necessary for
the category search to work properly on the explore screen.
2025-01-15 12:32:50 +05:30
Kaartic Sivaraam
efc9ae8fb6 Merge remote-tracking branch 'origin/v5.1.0' 2025-01-15 11:53:59 +05:30
Jason-Whitmore
d4a9bacd91
Fixes Issue #5832: Navigation Banner Appears in Media Details Screen (#6121)
* MediaDetailFragment.kt: add helper method to retrieve ContributionFragment instance

Before this commit, there was no easy way to check for and retrieve the ContributionFragment instance that
was either the parent or grandparent (parent's parent) fragment. A complicated if check was required to
retrieve it.

After this commit, there is a simple helper method which will retrieve the ContributionFragment instance.
Existing code can now be replaced by calling this method.

* MediaDetailFragment.kt: replace code that is meant to hide nearby card

Before this commit, code would attempt to find and hide the nearby card that would appear
when the user was looking at media details. However, this code did not work.

After this commit, the old code has been replaced with code that correctly hides the
nearby card. Also, this new code uses a helper method call and is overall easier to read.

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-14 08:17:14 +09:00
Paul Hawke
0e735512bb
Convert upload to kotlin (part 3) (#6104)
* Convert UploadCategoriesFragment to kotlin

* Convert UploadBaseFragment to kotlin

* Convert UploadItem to kotlin

* Convert UploadModel to kotlin

* Convert UploadMediaDetailAdapter to kotlin

* Convert UploadActivity to kotlin

* Convert UploadMediaPresenter to kotlin

* Convert UploadMediaDetailFragment to kotlin

* Fix NPE that broke uploads
2025-01-13 23:04:09 +09:00
translatewiki.net
6d64357d45
Localisation updates from https://translatewiki.net. 2025-01-13 13:01:48 +01:00
Akshay Komar
78666ccbde
Refactor Dialog View Initialization with Null-Safe Calls (#6114)
* Rename Constants to Follow Kotlin Naming Conventions

>This PR refactors constant names in the project to adhere to Kotlin's UPPERCASE_SNAKE_CASE naming convention, improving code readability and maintaining consistency across the codebase.

>Renamed the following constants in LoginActivity:
>saveProgressDialog → SAVE_PROGRESS_DIALOG
>saveErrorMessage → SAVE_ERROR_MESSAGE
>saveUsername → SAVE_USERNAME
>savePassword → SAVE_PASSWORD

>Updated all references to these constants throughout the project.

* Update Project_Default.xml

* Refactor variable names to adhere to naming conventions

Renamed variables to use camel case:
-UPLOAD_COUNT_THRESHOLD → uploadCountThreshold
-REVERT_PERCENTAGE_FOR_MESSAGE → revertPercentageForMessage
-REVERT_SHARED_PREFERENCE → revertSharedPreference
-UPLOAD_SHARED_PREFERENCE → uploadSharedPreference

Renamed variables with uppercase initials to lowercase for alignment with Kotlin conventions:
-Latitude → latitude
-Longitude → longitude
-Accuracy → accuracy

Refactored the following variable names:
-NUMBER_OF_QUESTIONS → numberOfQuestions
-MULTIPLIER_TO_GET_PERCENTAGE → multiplierToGetPercentage

* Refactor Dialog View Initialization with Null-Safe Calls

This PR refactors the dialog setup code in CustomSelectorActivity to improve safety and readability by replacing explicit casts with null-safe generic calls for findViewById.

>Replaced explicit casting (as Button and as TextView) with the generic findViewById<T>() method for improved type safety.
>Added null-safety (?.) to avoid potential crashes if a view is not found in the dialog layout.

why changed:-
>Prevents runtime crashes caused by NullPointerException when a view is missing in the layout.
2025-01-11 08:46:19 +09:00
Neel Doshi
39b513da12
feat : Account Vanishing (#6098)
* feat : Account Vanishing

* Added Comment for SingleWebViewActivity

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-09 23:27:08 +09:00
translatewiki.net
18f599b554
Localisation updates from https://translatewiki.net. 2025-01-09 13:01:40 +01:00
Akshay Komar
3e7565c7e3
Refactor variable names to adhere to naming conventions (#6111)
* Rename Constants to Follow Kotlin Naming Conventions

>This PR refactors constant names in the project to adhere to Kotlin's UPPERCASE_SNAKE_CASE naming convention, improving code readability and maintaining consistency across the codebase.

>Renamed the following constants in LoginActivity:
>saveProgressDialog → SAVE_PROGRESS_DIALOG
>saveErrorMessage → SAVE_ERROR_MESSAGE
>saveUsername → SAVE_USERNAME
>savePassword → SAVE_PASSWORD

>Updated all references to these constants throughout the project.

* Update Project_Default.xml

* Refactor variable names to adhere to naming conventions

Renamed variables to use camel case:
-UPLOAD_COUNT_THRESHOLD → uploadCountThreshold
-REVERT_PERCENTAGE_FOR_MESSAGE → revertPercentageForMessage
-REVERT_SHARED_PREFERENCE → revertSharedPreference
-UPLOAD_SHARED_PREFERENCE → uploadSharedPreference

Renamed variables with uppercase initials to lowercase for alignment with Kotlin conventions:
-Latitude → latitude
-Longitude → longitude
-Accuracy → accuracy

Refactored the following variable names:
-NUMBER_OF_QUESTIONS → numberOfQuestions
-MULTIPLIER_TO_GET_PERCENTAGE → multiplierToGetPercentage
2025-01-09 17:22:42 +09:00
Saifuddin Adenwala
87a453cb72
Migrated concurrency module from Java to Kotiln (#6110)
* Rename .java to .kt

* Migrated concurrency module to Kotlin
2025-01-08 15:42:53 +09:00
Nachiket Jadhav
fdbe504ca9
fix: logo getting cropped in landscape mode of login page (#6106)
* Fixed logo getting cropped in landscape mode of login page

* Indentation added at line 12

* New Dimension created in dimens.xml which is used in land\activity_login.xml
2025-01-08 05:33:41 +10:00
yuvraj-coder1
b2159ed87f
feat: Long-pressing a row in "Uploads" copies the caption to clipboard, and displays a snack saying "Caption copied to clipboard" (#6105)
* feat: Long-pressing a row in "Uploads" copies the caption to clipboard, and displays a snack saying "Caption copied to clipboard

* refactor: using string resources for the text instead of hard coded values
2025-01-07 07:12:24 +10:00
Akshay Komar
ecb19d6984
Rename Constants to Follow Kotlin Naming Conventions (#6107)
* Rename Constants to Follow Kotlin Naming Conventions

>This PR refactors constant names in the project to adhere to Kotlin's UPPERCASE_SNAKE_CASE naming convention, improving code readability and maintaining consistency across the codebase.

>Renamed the following constants in LoginActivity:
>saveProgressDialog → SAVE_PROGRESS_DIALOG
>saveErrorMessage → SAVE_ERROR_MESSAGE
>saveUsername → SAVE_USERNAME
>savePassword → SAVE_PASSWORD

>Updated all references to these constants throughout the project.

* Update Project_Default.xml
2025-01-07 03:00:02 +10:00
translatewiki.net
940c0740b0
Localisation updates from https://translatewiki.net. 2025-01-06 13:01:38 +01:00
Neel Doshi
cebe1c2a1f
chore : lint fix (#6099)
- Removed unused constants which were there in `Pref`
- Removed unused parameter requireActivity from `Setting Fragment`

Revert "chore : lint fix"

This reverts commit 599203343f4c3c050b45e4ccf53fd23097818cc4.
2025-01-06 02:48:05 +10:00
Paul Hawke
1d8d1d6b03
Remove the extra byte buffer copying while creating file chunks (#6091)
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2025-01-05 20:44:30 +09:00
Akshay Komar
25e467b3a5
Refactor Nearby Location Tests to Improve Assertion Logic (#6103)
-Refactored testSearchCloseToCurrentLocationWhenFar: Simplified assertion by using assertFalse(!isClose) for better readability and logical clarity.

-Added testSearchCloseToCurrentLocationWhenClose: Created a new test case to validate behavior when the search is close to the current location, ensuring assertTrue(isClose) for correctness.

-Improved Coverage: These changes enhance the test coverage and reliability of the searchCloseToCurrentLocation function.
2025-01-05 17:21:17 +09:00
Parneet Singh
038ae9acd4
fix null pointer exception (#6093)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2025-01-03 22:32:06 +10:00
translatewiki.net
ea20a64b34
Localisation updates from https://translatewiki.net. 2025-01-02 13:01:43 +01:00
Tanmay Gupta
411184fde8
Nearby: Fixed recenter and legend FABs inconsistencies (#6092)
Using app:useCompatPadding=true on both the FABs caused padding issues, replaced that with android:layout_margin. As the minimumSdk version is >=lollipop, I believe useCompatPadding is not required.
2025-01-02 15:09:18 +09:00
translatewiki.net
bf89f11606
Localisation updates from https://translatewiki.net. 2024-12-30 13:01:44 +01:00
Kaartic Sivaraam
391408ed17 CHANGELOG: fix some typos 2024-12-29 22:43:21 +05:30
Kaartic Sivaraam
9bbb1a98db Version 5.1.1 2024-12-29 22:36:39 +05:30
Sujal
faa58a19de
Fixed bug #5876 (#6086) 2024-12-29 16:09:03 +09:00
Tanmay Gupta
d2751595cb
Nearby: Markers now show place via pin base (#6090) 2024-12-29 15:46:29 +09:00
Gautham Mohanraj
46cefa4899
Fix/feedback to map navigation (#6087)
* feat:Added try catch block for the Feedback

* fix:Added finish after the feedback submitted so that we navigate back to the map
2024-12-29 11:03:47 +09:00
Tanmay Gupta
5bc58284aa
Nearby: Avoid reloading entire map upon cache clear (#6089) 2024-12-29 10:44:47 +09:00
Parneet Singh
a6444968fa
add cancel button (#6078)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2024-12-29 08:20:32 +09:00
Parneet Singh
dec56a3342
rm file (#6079)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2024-12-29 07:53:04 +09:00
Parneet Singh
91e41c4c18 Always show upload icon (#6022)
* fix issue5847 as owner required: make the icon always visible and just adjust the count accordingly,comment the setVisibility method and make pending_upload_icon always visible

* set pending_upload_icon android visible level: visible and tool visible level: gone

* fix issue 5847, The upload icon is now set to always be visible, while the original code has been commented out and retained with a note for potential re-use in the future.

* refactor

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

---------

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
Co-authored-by: bxy379987 <bxy379987@gmail.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-28 23:55:27 +05:30
Neel Doshi
b714b45bfd Migrated exifInterface to androidx exif.interface (#6013) 2024-12-28 23:43:26 +05:30
Parneet Singh
22238f55cd
fix parsing (#6075)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2024-12-27 01:27:03 +10:00
Sonal Yadav
4244373a5d
Refactor focus change listener to improve readability and avoid crashes (#6080) 2024-12-27 01:26:08 +10:00
Tanmay Gupta
75ca96a526
Nearby: show cached pins even when internet is unavailable (fixes #6051) (#6081)
* Place: Made location @Embedded

* Nearby: Move handling map scroll to presenter

* PlacesRepository: Add methods for fetching places in geo bounds

* Nearby: add getScreenTopRight/BottomLeft and refactor old code

* PlacesRepository: Add methods for fetching places in map bounds

* Nearby: Complete offline pins implementation

* Nearby offline pins: Add snackbar message

* Nearby offline pins: Add javadoc

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-26 23:55:21 +09:00
translatewiki.net
0d71da106f
Localisation updates from https://translatewiki.net. 2024-12-26 13:01:25 +01:00
Parneet Singh
86cdf96f3d
make prop nullable (#6073)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2024-12-25 00:55:12 +09:00
Sonal Yadav
e7864ac1dd
Refactor usage of Html.fromHtml to handle deprecation (#6074) 2024-12-25 00:44:25 +09:00
Paul Hawke
a9058d129e
Convert upload to kotlin (part 2) (#6069)
* Convert UploadCategoriesFragment to kotlin

* Convert DepictsFragment to kotlin

* Convert MediaLicensePresenter to kotlin

* Convert MediaLicenseFragment to kotlin

* Converted SimilarImageDialogFragment to kotlin

* Convert ThumbnailsAdapter to kotlin

* Convert UploadPresenter to kotlin

* Convert UploadBaseFragment to kotlin

* Convert UploadMediaDetailInputFilter to kotlin

* Convert UploadItem to kotlin

* Convert UploadController to kotlin

* Fix nullability of the UploadItem
2024-12-24 16:11:46 +09:00
Tanmay Gupta
369e79be5e
Nearby: No longer keeps loading until timeout when map is zoomed out (#6070)
* Nearby: Search for actual map center

* Add query syntax and methods

* Nearby: Added binary search for loading pins

* Add NearbyQueryParams and refactor

* Add unit tests and complete implementation

* Nearby: Increase max radius from 100km to 300km

* Nearby: Centermost pins now appear on top

* getNearbyItemCount: Added javadoc

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-24 15:21:45 +09:00
translatewiki.net
c963cd9ea4
Localisation updates from https://translatewiki.net. 2024-12-23 13:02:14 +01:00
Sonal Yadav
7479767266
Fix: Allow back button functionality to dismiss language selection dialog (#6067)
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-23 20:38:45 +09:00
Sonal Yadav
b55c61ddb8
Fixed the migrations warning under Kotlin header #13282 (#6060)
* Fixed  Migration warnings under Kotlin header

* suppresses Lint

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-22 23:14:20 +09:00
Neel Doshi
f1e8e48769
Removed deneme8 Timber tag (#6065) 2024-12-22 22:05:25 +09:00
Neel Doshi
d0bde4a3fe
Replaces Log to Timber (#6062) 2024-12-22 14:44:57 +09:00
Tanmay Gupta
6a32454347
Nearby: Fix map moving by itself (#6061)
fixes #6046

the OnFocusChangeListener for nearby place list items sometimes gets invoked when new items aer set, even when the list is hidden, if an item had previously been clicked in it. This in turn causes the onItemClick to be called. This commit adds a check to make sure the list is not hidden when onItemClick is invoked this way.
2024-12-22 08:39:30 +09:00
Tanmay Gupta
4dd16054ca
Nearby: Fix disappearing of pins loaded from cache (#6052) (#6057)
* Nearby Fix disappearing of pins loaded from cache

Fixes #6052

* Remove outdated tests

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-21 20:10:33 +09:00
Mohit Kambli
4b152fc15f
Fix #6054: Rename SAVEPROGRESSDAILOG to SAVEPROGRESSDIALOG (#6058) 2024-12-21 19:55:51 +09:00
Tanmay Gupta
c891c2b0df
Nearby: Fix race condition and lag when loading pin details, faster overlay management (#6047)
* temporary fixes part one

* temporary fixes part two

* temporary fixes part three

* temporary fixes part four

* temporary fixes part five

* reformatting

* remove code no longer in use

* Migrate NearbyParentFragmentPresenter to Kotlin

* Partially replace temporary experimental fixes

* Replace temporary experimental fixes part 2

* Replace temporary experimental fixes part 3

* Replace temporary fixes completely

* Fix caching and loading places in Nearby list

* Add place bookmarking logic, Remove all old code

* Nearby Presenter: Close channel properly

* Nearby pins now load starting from the center

Fixes #6049

* Add comments and javadoc for Nearby Presenter

* Fix warnings, Fix formatting, Add javadoc

* Pass unit tests
2024-12-20 22:30:53 +10:00
Parneet Singh
70b4f78a5d
fix multi-line paste (#6050)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2024-12-20 22:29:08 +10:00
Parneet Singh
4c9637c821
Add pull down to refresh in Contributions screen (#6041)
* pull down to refresh

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* add kdoc

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* only enabled for self user

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* fix test

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

---------

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2024-12-20 10:06:07 +09:00
translatewiki.net
a4b74794cb
Localisation updates from https://translatewiki.net. 2024-12-19 13:01:57 +01:00
Parneet Singh
5500b03976
Feature: Bookmark Categories (#6035)
* database setup and insert/delete working

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* add new categories screen in bookmarks page

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* add theme

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* set tab layout scrollable

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* cleanup

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* fix tests

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* bump database version

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* add docs

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

---------

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2024-12-17 21:49:32 +09:00
translatewiki.net
0153cbe0ed
Localisation updates from https://translatewiki.net. 2024-12-16 13:01:57 +01:00
Tanmay Gupta
e8970ab7f2
FilePicker: Fix error when multiple images are returned from Documents based picker (#6033)
* FilePicker: Correctly handle Documents result

* Empty commit to re-trigger CI checks
2024-12-15 21:21:30 +09:00
Tanmay Gupta
a933b92efa
Fix caption lost on accepting 'Is this a pic of' (#6030)
Fixes issue 5842 by correcting the implementation of onUserConfirmedUploadIsOfPlace in UploadMediaDetailsContract's UserActionListener

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-14 19:12:44 +09:00
Haoyu Weng
f2d1f7dbbb
[Enhancement] Fix #5042 Add copy link button (#5080)
* Add a "copy link" button next to the share button. Add relative English and Simplified Chinese text in strings.xml.

* Change the icon from copy to link

* Fixed typo

* Fixed case

---------

Co-authored-by: Justweng <justweng19@gmail.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-14 18:45:44 +09:00
Tanmay Gupta
235e8cdba2
Fix edit button shown when image has no location (#6029)
Changed the commons.filepicker.UploadableFile's hasLocation method to use the existing ImageCoordinates class for detecting the presence of geolocation in an image's exif
2024-12-14 17:31:25 +09:00
Parneet Singh
c1acdbe31a
remove method (#6028)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2024-12-14 13:15:52 +09:00
Paul Hawke
2c8c441f25
Convert upload to kotlin (part 1) (#6024)
* Convert upload dagger module to kotlin

* Code cleanup and convert the upload contract to kotlin

* Code cleanup and convert CategoriesContract to kotlin

* Code cleanup and convert MediaLicenseContract to kotlin

* Code cleanup and convert UploadMediaDetailsContract to kotlin

* Code cleanup, fixed nullability and converted DepictsContract to kotlin

* Removed unused class

* Convert FileMetadataUtils to kotlin

* Convert EXIFReader to kotlin

* Convert FileUtils to kotlin

* Convert FileUtilsWrapper to kotlin

* Convert ImageProcessingService to kotlin

* Convert PageContentsCreator to kotlin

* Convert PendingUploadsPresenter and contract to Kotlin with some code-cleanup

* Convert ReadFBMD to kotlin

* Convert SimilarImageInterface to kotlin

* Removed unused classes

* Fix merge/rebase issue

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-13 23:15:13 +09:00
Tanmay Gupta
cb007608d9
Issue #5996 - Fix Android Studio warnings in LocationPickerActivity.kt (#6026)
* Replace deprecated zoomLevel with zoomLevelDouble

* Replace deprecated Html.fromHtml call

* LocationPickerActivity: Replace deprecated methods with androidx

* LocationPickerActivity: Reformatted overlong lines

* Renamed package LocationPicker to locationpicker

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-13 22:49:40 +09:00
Tanmay Gupta
8a55b5e613
FolderDeletionHelper: Fix unintentional deletion (#6027)
* fix issue6020: prevent unintentional deletion of subfolders and non-images by custom selector

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-13 22:41:47 +09:00
Gautham Mohanraj
b2810bcef1
Resolve crash when submitting feedback without internet access (#6018)
* fix: resolve crash when submitting feedback without internet access

* feat:Added check for wheather internet connection was available for a network

* feat:Added SnackBar for Retry and User Info

* feat:Made the feedback dialog not leave screen in case of error

* feat:Removed the network checking from the function

* feat:Added try catch block for the Feedback

* feat:Removed Unnecessary imports

* feat:Used Snackbar and timber instead of log and Toast

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-13 22:30:30 +09:00
translatewiki.net
f51b607312
Localisation updates from https://translatewiki.net. 2024-12-12 13:02:18 +01:00
Parneet Singh
3bfa3612c6
Always show upload icon (#6022)
* fix issue5847 as owner required: make the icon always visible and just adjust the count accordingly,comment the setVisibility method and make pending_upload_icon always visible

* set pending_upload_icon android visible level: visible and tool visible level: gone

* fix issue 5847, The upload icon is now set to always be visible, while the original code has been commented out and retained with a note for potential re-use in the future.

* refactor

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

---------

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
Co-authored-by: bxy379987 <bxy379987@gmail.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-11 23:29:50 +09:00
Parneet Singh
9a876fa5e2
make dialog modal (#6015)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2024-12-11 15:08:39 +09:00
Saifuddin Adenwala
c175a4ee03
Migrated category module from Java to Kotlin (#6016)
* Rename .java to .kt

* Rebased category PR

* Resolved conflicts

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-11 11:17:05 +09:00
Saifuddin Adenwala
3030a6fca7
Migrated helper modules to kotlin (#6007)
* Rename .java to .kt

* Migrated delete and description module to kotlin (WIP)

* Fix: Unit tests

* Fix: Unit tests

* Rename .java to .kt

* Migrated data, db, and converter module to kotlin

* Fix: Unit tests

* Fix: Unit tests

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-11 07:43:36 +09:00
Paul Hawke
73311970c5
Convert wikidata/mwapi to kotlin (part 4) (#6010)
* Convert ImageDetails to kotlin

* Convert MwException/MwServiceError to kotlin

* Convert ListUserResponse to kotlin

* Convert MwPostResponse to kotlin

* Convert MwQueryResponse to kotlin

* Convert MwQueryResult to kotlin

* Convert MwQueryPage to kotlin

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-10 12:18:42 +09:00
Neel Doshi
56ada36b83
Migrated exifInterface to androidx exif.interface (#6013) 2024-12-10 03:54:11 +10:00
Parneet Singh
85d9aef2f3
Feature: Show where file is being used on Commons & Other wikis (#6006)
* add url to build config

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* add network call functions

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* return response asynchronously

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* inject page size in the request

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* rename from Commons..Response.kt to ..Response.kt

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* convert to .kt

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* ui setup working

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* fix merge conflict

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* cleanup

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* fix CI

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* use suspend function for network calls

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* doc

* doc

* doc

* doc

* doc

---------

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-09 23:07:44 +09:00
translatewiki.net
04a07ed655
Localisation updates from https://translatewiki.net. 2024-12-09 13:02:13 +01:00
Parneet Singh
cc74707894
delete empty files (#6009)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2024-12-08 14:51:37 +09:00
Neel Doshi
64fd10d00e
Migrate Feedback module from Java to Kt (#5985)
* Rename `.java` to `.kt`

* Migrated FeedbackContentCreator to kotlin

* Rename FeedbackDialog from `java` to `kt`

* Migrated Feedback Dialog from `java` to `kt`

* Renamed OnFeedbackSubmitCallback to kotlij

* Migrated OnFeedbackSubmitCallback to kotlin

* Fixed: TestCase Failure

* Fixed Test : Changed Private Modifier to Public

* Suppressed deprecated and added TODO for lint

* Linked Deprecation with Github Issue

* Rename Feedback from java to kt

* Migrated Feedback Data Class to Kotlin

* Modified the data class to var for mutuability
2024-12-07 16:19:00 +09:00
Paul Hawke
015c5d5c63
Convert wikidata/mwapi to kotlin (part 3) (#6004)
* Convert Edit to kotlin along with deleting unused class

* Converted ExtMetadata to kotlin

* Convert ImageInfo to kotlin

* Removed unused class

* Convert Notification to kotlin

* Convert PageProperties to kotlin

* Convert PageTitle to kotlin

* Convert Namespace to kotlin
2024-12-07 12:20:06 +09:00
Neel Doshi
64354fb9e4
chore : Lint fix (#5995)
* Refactor : Fixed lint issues on EditActivity

- Using 'Log' instead of 'Timber'
- Line is longer than allowed by code style (> 100 columns)
- Use of getter method instead of property access syntax
- Should be replaced with Kotlin function
- Cascade 'if' should be replaced with 'when'

* Suppress Deprecation

* Linked Deprecated with Github Issue

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-07 02:24:22 +10:00
Neel Doshi
a8387f01c9
Bug Fixs & Enhancement of Achievement Screen (#5666)
* Rename AchievementFragment from `.java` to `.kt`

* Migrated AchievementFragment to kotlin

* Revamped Achievement Screen

* fixed AchievementFragment Unit Test

* fixed Level on MoreBottomSheetFragment

* Implemented Badge and Minor Code Refactor

* Fixed the badge issue & made the badge clickable

* Removed Redundant XML Code & Converted badges to green color and added values inside it

* Fixed : showSnackBarWithRetry Test

* Fixed : Theme issues on Light Mode

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-06 23:15:47 +09:00
Paul Hawke
ae52267a27
Convert wikidata/mwapi to kotlin (part 2) (#5999)
* Convert DepictSearchResponse to kotlin

* Convert Entities to kotlin

* Convert WikiSite to kotlin

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-06 17:50:29 +09:00
Saifuddin Adenwala
f8d519e8eb
Migrated filepicker from Java to Kotlin (#5997)
* Rename .java to .kt

* Migrated filepicker module from Java to Kotlin

* Rename .java to .kt

* Migrated filepicker module from Java to Kotlin

* fix: test cases
2024-12-06 17:31:40 +09:00
Paul Hawke
3777f18bf9
Convert mwapi/wikidata to kotlin (part 1) (#5991)
* Convert OkHttpJsonApiClient and CategoryApi to kotlin

* Convert GsonUtil to kotlin

* Convert WikidataConstants to kotlin

* Convert WikidataEditListener to kotlin

* Convert WikidataEditService to kotlin

* work in progress

* Convert RequiredFieldsCheckOnReadTypeAdapterFactory to kotlin

* Converted type adapters

* Convert WikiSiteTypeAdapter to kotlin

* Fixed nullability
2024-12-05 23:13:38 +09:00
translatewiki.net
9dd504e560
Localisation updates from https://translatewiki.net. 2024-12-05 13:01:47 +01:00
Paul Hawke
33548fa57d
Convert profile package to kotlin (#5979)
* Convert ViewModelFactory to kotlin

* Convert UpdateAvatarResponse and related test to Kotlin

* Convert LeaderboardResponse and related test to kotlin

* Convert LeaderboardListAdapter to kotlin

* Convert UserDetailAdapter to kotlin

* Convert LeaderboardListViewModel to kotlin

* Convert DataSourceClass to kotlin

* Convert the LeaderboardFragment to kotlin

* Converted AchievementsFragment to kotlin

* Revert "Converted AchievementsFragment to kotlin"

This reverts commit 4fcbb81e5d.

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-12-03 15:47:25 +09:00
Saifuddin Adenwala
8265cc6306
Migrate location and language module from Java to Kotlin (#5988)
* Rename .java to .kt

* Migrated location and language module from Java to Kotlin

* Changed lastLocation visibility
2024-12-03 15:27:11 +09:00
Saifuddin Adenwala
771f370f9a
Migration of locationpicker module from Java to Kotlin (#5981)
* Rename .java to .kt

* Migrated location picker module from Java to Kotlin
2024-12-02 16:54:26 +09:00
Neel Doshi
fb1ef3212d
Migrated Bookmark from Java to Kotlin (#5960)
* Rename Bookmark Pages from `.java` to `.kt`

* Migrated Bookmark Pages to kotlin
2024-11-30 10:51:53 +09:00
Paul Hawke
1e5521b434
Convert dependency inject ("di") package to kotlin (#5976)
* Convert a batch of easier modules

* Convert the NetworkingModule to kotlin

* Converted the ApplicationlessInjection to kotlin

* Convert CommonsDaggerAppCompatActivity to kotlin

* Convert CommonsDaggerContentProvider to kotlin

* Convert CommonsDaggerIntentService to kotlin

* Convert CommonsDaggerService to kotlin

* Convert CommonsDaggerSupportFragment to kotlin

* Convert CommonsDaggerBroadcastReceiver to kotlin

* Convert CommonsApplicationModule to kotlin

* Fix imports and make them consistent
2024-11-30 10:50:42 +09:00
Paul Hawke
dac3657536
Migrate kvstore to kotlin (#5973)
* Get good test around the basic KvStore before starting conversion

* Converted BasicKvStore to kotlin and removed dead code

* Converted JsonKvStore to kotlin

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-11-29 14:01:29 +09:00
Saifuddin Adenwala
d6c4cab207
Migrated logging module from Java to Kotlin (#5972)
* Migrated logging module from Java to Kotlin

* Rename .java to .kt

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-11-29 13:50:33 +09:00
Paul Hawke
1afff73c24
Migrate campaigns package to kotlin (#5969)
* Convert ICampaignsView to kotlin along with simple fix

* Convert CampaignView to Kotlin

* Convert CampaignsPresenter to Kotlin

* Convert CampaignsPresenter to kotlin

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-11-29 13:44:26 +09:00
translatewiki.net
a6152f937e
Localisation updates from https://translatewiki.net. 2024-11-28 13:01:55 +01:00
Rohit Verma
794dbb8f92
Fix modification on bottom sheet's data when coming from Nearby Banner and clicked on other pins (#5937)
* refactor getIconFor method and remove call to highlightNearestPlace()

It ensures single responsibility on getIconFor method

* refactor and fix icon issue when coming from nearby banner

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-11-28 17:37:56 +09:00
Paul Hawke
0c969c365b
Convert auth package to kotlin (#5966)
* Convert SessionManager to kotlin along with other small fixes

* Convert WikiAccountAuthenticator to kotlin

* Migrate WikiAccountAuthenticatorService to kotlin

* Converted AccountUtil to kotlin

* Convert SignupActivity to kotlin

* Convert LoginActivity to kotlin

* Merge from main
2024-11-28 17:09:25 +09:00
Saifuddin Adenwala
238023056f
Migrated navtab module from Java to Kotlin (#5965)
* Rename .java to .kt

* Migrated navtab module from Java to Kotlin

* Migrated navtab module from Java to Kotlin
2024-11-27 22:58:46 +09:00
Saifuddin Adenwala
381f9eca0c
Migrated notification module from Java to Kotlin (#5955)
* Rename .java to .kt

* Migration of notification module from Java to Kotlin
2024-11-26 21:29:31 +09:00
translatewiki.net
874773b881
Localisation updates from https://translatewiki.net. 2024-11-25 13:01:54 +01:00
Saifuddin Adenwala
00cfd83521
Migrated quiz module from Java to Kotlin (#5952)
* Rename .java to .kt

* Migrated quiz module to Kotlin

* unit test failing fixed

* unit test failing fixed
2024-11-24 19:17:05 +09:00
Saifuddin Adenwala
bafae821e2
Migration of review module from Java to Kotlin (#5950)
* Rename .java to .kt

* Migrated repository module to Kotlin

* Rename .java to .kt

* Migrated review module to Kotlin
2024-11-23 21:45:46 +09:00
Rohit Verma
e070c5dbe8
Fix unit tests (#5947)
* move createLocale() method to companion object and add test dependency

* use mockk() from Mockk library for mocking sealed classes

* change method parameter to null-able String type

* add null check for accessing property from unit tests

* change method signature to match old method's signature

It fixes the NullPointerException when running ImageProcessingUnitTest

* Fix unresolved references and make properties public for unit tests

* fix tests in UploadRepositoryUnitTest by making return type null-able
2024-11-23 08:35:34 +09:00
Saifuddin Adenwala
fe347c21fd
Migrated recentlanguages and repository module from Java to Kotlin (#5948)
* Rename .java to .kt

* Migrated recentlanguages module to Kotlin

* Rename .java to .kt

* Migrated repository module to Kotlin
2024-11-22 22:58:16 +09:00
u7479759
088dd2479e
Changed to data classes, and added immutability (#5905)
Co-authored-by: Jinniu Du <127721018+Donutcheese@users.noreply.github.com>
2024-11-21 21:42:54 +09:00
Saifuddin Adenwala
cf88f9b796
Migrated settings modules from Java to Kotlin (#5944)
* Rename .java to .kt

* Migrated settings module to Kotlin
2024-11-21 21:16:42 +09:00
translatewiki.net
5f1d284309
Localisation updates from https://translatewiki.net. 2024-11-21 13:01:41 +01:00
Saifuddin Adenwala
ed18a37577
Migrated ui and theme modules from Java to Kotlin (#5942)
* Rename .java to .kt

* Migrated ui and theme module to Kotlin
2024-11-20 22:55:13 +09:00
Saifuddin Adenwala
cb4ffd8ca8
Migrated widget module from Java to Kotlin (#5940)
* Rename .java to .kt

* Migrated widget module to Kotlin
2024-11-20 12:41:50 +09:00
Saifuddin Adenwala
0fdb0044b9
Migrated util module from Java to Kotlin (#5938)
* Rename .java to .kt

* Migrated the following files in util module to Kotlin
- AbstractTextWatcher
- ActivityUtils
- CommonsDateUtil
- DateUtil

* Rename .java to .kt

* Migrated the following files in util module to Kotlin
- DeviceInfoUtil
- ExecutorUtils
- FragmentUtils

* Rename .java to .kt

* Migrated the following files in util module to Kotlin
- ImageUtils
- ImageUtilsWrapper
- LangCodeUtils
- LayoutUtils
- LengthUtils
- LocationUtils
- MapUtils

* Rename .java to .kt

* Migrated all remaining files in util module
2024-11-18 22:40:35 +09:00
translatewiki.net
c439143dd3
Localisation updates from https://translatewiki.net. 2024-11-18 13:01:52 +01:00
Saifuddin Adenwala
5c8c4032e9
Migrated util module files from java to kotlin (#5935)
* Rename .java to .kt

* Migrated the following files in util module to Kotlin
- AbstractTextWatcher
- ActivityUtils
- CommonsDateUtil
- DateUtil

* Rename .java to .kt

* Migrated the following files in util module to Kotlin
- DeviceInfoUtil
- ExecutorUtils
- FragmentUtils
2024-11-17 22:35:25 +09:00
translatewiki.net
248c7b0ceb
Localisation updates from https://translatewiki.net. 2024-11-14 13:02:04 +01:00
Alex Gailis
183e84c098
Improve Unique File Name Search (#5877)
* Modified findUniqueFileName() in UploadWorker.kt to use a random 3-digit alphanumeric hash to append to a file name to make it unique. This improves speed over using an incrementing number to append as there are fewer collisions.

* Modified findUniqueFileName() in UploadWorker.kt to use a random 5-digit numeric hash rather than the previous 3-digit alphanumeric hash

* Removed unnecessary variable "chars"

---------

Co-authored-by: Jinniu Du <127721018+Donutcheese@users.noreply.github.com>
Co-authored-by: Zihan Pan <u7726755@anu.edu.au>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-11-14 11:35:05 +09:00
StrawberryShortcake
634bc3ede1
custom-selector: adds a button to delete the current folder in custom selector (#5925)
* Issue #5811: "Delete folder" menu in custom image selector

* Issue 5811: folder deletion for api < 29.

* Issue 5811: folder deletion for api < 29.

* Issue 5811: folder deletion for api 29.

* Issue 5811: folder deletion

* Issue 5811: fixes merge conflicts, replaces used function onActivityResult with an ActivityResultLauncher

* Update Constants.java

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-11-13 22:11:38 +09:00
translatewiki.net
17a8845dfd
Localisation updates from https://translatewiki.net. 2024-11-11 13:01:42 +01:00
Saifuddin Adenwala
a70d585df8
Hide edit options for logged-out users in Explore screen (#5920) 2024-11-07 22:59:32 +10:00
translatewiki.net
3bd7b533d4
Localisation updates from https://translatewiki.net. 2024-11-07 13:01:44 +01:00
translatewiki.net
e388f456dc
Localisation updates from https://translatewiki.net. 2024-11-05 15:18:29 +01:00
translatewiki.net
c46928252c
Localisation updates from https://translatewiki.net. 2024-11-04 13:01:44 +01:00
Rohit Verma
091ddb5db1
revert back to MainScope for database and ui updates (#5914)
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-11-04 18:40:54 +09:00
Kaartic Sivaraam
9ca285be53 Link to the elaborate changelog in GitHub release 2024-11-04 00:17:33 +05:30
Kaartic Sivaraam
707997bd1f Version v5.1.0 2024-11-04 00:10:15 +05:30
translatewiki.net
72a80f0616 Localisation updates from https://translatewiki.net. 2024-11-04 00:09:11 +05:30
Hisham Akmal
f011abef1d
Improve string formatting in OkHttpJsonApiClient.java (#5916) 2024-11-01 09:20:16 +09:00
translatewiki.net
7c826502b6
Localisation updates from https://translatewiki.net. 2024-10-31 13:01:42 +01:00
translatewiki.net
4a46488e4e Localisation updates from https://translatewiki.net. 2024-10-29 07:24:44 +05:30
translatewiki.net
197855af0e
Localisation updates from https://translatewiki.net. 2024-10-28 13:02:08 +01:00
u7119288
610919ec67 Partial fixes for errors and warnings reported by ./gradlew lint (#5885)
* 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>
2024-10-28 08:35:50 +05:30
Parneet Singh
d21c63f1db CommonsApplication migrate to kotlin & some lint fixes (#5879)
* convert to kotlin

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* use lateinit instead of nullable types

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* instance property access fix

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* refactor constants name with uppercased ones

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* remove unused

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* fix imports in test

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* use mockk for kotlin to fix tests

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

---------

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2024-10-28 08:35:50 +05:30
Parneet Singh
6adedd9789 fix test (#5893)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2024-10-28 08:35:50 +05:30
u7119288
522f1fe192
Partial fixes for errors and warnings reported by ./gradlew lint (#5885)
* 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>
2024-10-27 22:59:09 +09:00
Rohit Verma
cdc4f89da5
Database bug fix (#5902)
* make database function calls suspending and update room version

* replace MainScope with coroutineScope for database operations

* add suspend keyword and refactor code
2024-10-27 22:38:40 +09:00
Parneet Singh
bc065c8792
CommonsApplication migrate to kotlin & some lint fixes (#5879)
* convert to kotlin

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* use lateinit instead of nullable types

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* instance property access fix

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* refactor constants name with uppercased ones

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* remove unused

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* fix imports in test

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* use mockk for kotlin to fix tests

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

---------

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2024-10-26 23:19:34 +09:00
Parneet Singh
7c58891892
fix test (#5893)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2024-10-26 13:32:35 +09:00
Noah Vendrig
3e020ed973
Fixes #5806 Implemented "Refresh" button to clear the cache and reload the Nearby map (#5891)
* Changed files required to get the app to run correctly. Removed suspend from affected DAO files and funcs, and changed to (Kotlin v1.9.22) and (Kotlin compiler v1.5.8)

* Created refresh button icon, and added it to the nearby_fragment_menu.xml (header of the nearby page). Created function refresh() in NearbyParentFragment.java to handle refresh functionality.

* Replaced refresh() func with emptyCache() and reloadMap()

* Attempt at reloadMap(), no testing done yet.

* added changes for a possibly working emptyCache implementation (needs testing).

* Tested changes as working, edited emptyCache to correctly clear cache and then reload map

---------

Co-authored-by: MarcusBarta <marcusbarta@icloud.com>
2024-10-25 14:19:07 +09:00
translatewiki.net
becc07d26b
Localisation updates from https://translatewiki.net. 2024-10-24 14:02:18 +02:00
Parneet Singh
1659a4ce22
add dependency (#5887)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2024-10-24 19:07:16 +09:00
Parneet Singh
1e7aabad16
Use new result API (#5875)
* 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>
2024-10-23 21:58:39 +09:00
cambo14
f1205c19be
UploadMediaDetailAdapter: made selecting a language deselect all others (#5883)
>> 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
2024-10-23 03:50:37 +10:00
whe128
9c1c95f5cf
Fix for #5846: After uploading via Nearby, I am sent back to Nearby, where I am mislead into thinking that I must upload again #5846 (#5874)
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-10-23 02:56:02 +10:00
Hanna Truong
ba7348f83f
Fixes issue #5841: Nearby pins: Make it easier to understand what the colors mean (#5881)
* 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>
2024-10-22 21:27:40 +09:00
myyyy
7b0b604834
Fix: Prevent RecyclerView from resetting scroll position after returning from preview (#5873) (#5880)
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>
2024-10-21 22:41:32 +09:00
translatewiki.net
014feb54e5
Localisation updates from https://translatewiki.net. 2024-10-21 14:02:00 +02:00
LachlanMajor
56d0beb22a
Fixes #5840 Custom select folder display breaks after exiting media preview (#5866)
* ImageFragment.kt: notifyDataSetChanged() added to update observers about init call in handleResult()

* ImageFragment.kt: unnecessary initialisation after exiting media preview was removed from passSelectedImages
2024-10-20 21:36:15 +10:00
Christo Joby Antony
63f1ed8a2d
Fix for #5808: Update the cached Place Items on the successful association of Wiki Item (#5864)
* (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>
2024-10-19 22:20:35 +09:00
ErenratZeng
c77e5abba7
notification: classify email messages and add mail check prompt (#5865)
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>
2024-10-18 15:31:54 +09:00
Parneet Singh
817e07b921
set permission required only upto android 5.1 (#5863)
Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2024-10-18 10:15:56 +09:00
translatewiki.net
82c7dcfe18
Localisation updates from https://translatewiki.net. 2024-10-17 14:02:05 +02:00
Andrew Gardner
0a7fe662d4
(fixes #3464) Replace assert() usages with assertThat() (#5861)
* 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
2024-10-16 22:22:48 +09:00
Zhenhao Li
ef3f6b7977
solve the issue 5856 (#5860) 2024-10-16 22:01:14 +09:00
Christo Joby Antony
3ac608c82c
(fixes #5855) fetch item label in nearby based on user configured language. (#5858) 2024-10-16 12:49:38 +09:00
Parneet Singh
f889ed1821
Refactor FilePicker.java intent result handling (#5851)
* remove unnecessary video flag check

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* handle when custom selector operation cancelled

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* dispatch appropriate request code to handle using respective callbacks

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* remove wrong control statements

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

* refactor gallery picker test

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>

---------

Signed-off-by: parneet-guraya <gurayaparneet@gmail.com>
2024-10-16 11:20:00 +09:00
translatewiki.net
95e0a0d143
Localisation updates from https://translatewiki.net. 2024-10-14 14:02:11 +02:00
Nicolas Raoul
dadc4b6a11
Bumped coordinates2country, recognizes more countries 2024-10-13 22:56:53 +09:00
translatewiki.net
ba7a559714
Localisation updates from https://translatewiki.net. 2024-10-10 14:01:43 +02:00
translatewiki.net
c7065e103b
Localisation updates from https://translatewiki.net. 2024-10-07 14:01:46 +02:00
translatewiki.net
f47a0dd49c
Localisation updates from https://translatewiki.net. 2024-10-03 14:01:48 +02:00
tristan
d0e64d7886
Issue 5835 nearby (#5843)
* 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>
2024-10-02 13:03:25 +09:00
translatewiki.net
3d49b1f79a
Localisation updates from https://translatewiki.net. 2024-09-30 14:01:51 +02:00
translatewiki.net
16a1375800
Localisation updates from https://translatewiki.net. 2024-09-23 14:01:49 +02:00
translatewiki.net
249e284a93
Localisation updates from https://translatewiki.net. 2024-09-19 14:02:01 +02:00
tristan
2d82a430c4
Issue-5662-kotlinstyle (#5833)
* *.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
2024-09-19 13:56:45 +09:00
Jason-Whitmore
950539c55c
Fixes Issue #5713: "Edit location" is hard to use (and confusing) (#5767)
* 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>
2024-09-18 21:18:46 +09:00
Rajat Sarangal
f751ab4a75
Optimize the Layout ViewBinding (#5830) 2024-09-18 11:43:48 +09:00
Rohit Verma
3e915f9848
Upgrade to SDK 34 (#5790)
* 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
2024-09-17 23:58:44 +09:00
translatewiki.net
eb027b74ce
Localisation updates from https://translatewiki.net. 2024-09-16 14:01:51 +02:00
ujjwal2900
9393dda9a4
Added date and time to Feedback (#5797)
* 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>
2024-09-13 14:39:02 +09:00
translatewiki.net
c3cd30ce5c
Localisation updates from https://translatewiki.net. 2024-09-12 14:02:01 +02:00
Rohit Verma
9edde234ec
Localization: fix incorrect Unicode for space after bullet points in French language (#5824)
* localization: fix incorrect unicode for space

* Remove bullet string resource as it doesn't need translation
2024-09-10 17:41:45 +09:00
translatewiki.net
76e4c38299
Localisation updates from https://translatewiki.net. 2024-09-09 14:01:50 +02:00
translatewiki.net
65ae5060c5
Localisation updates from https://translatewiki.net. 2024-09-05 14:04:50 +02:00
translatewiki.net
b9bb9bcf34
Localisation updates from https://translatewiki.net. 2024-09-02 14:01:50 +02:00
Kanahia
93f1e1ec29
Added pending uploads screen (#5752)
* Added pending uploads screen

* Added failed uploads fragment

* Improved progress bars

* Implemented pause functionality

* Improved pause feature

* Fixed issue with sorting when adding more pictures during an upload

* Improved Tap to View notification

* Fixed issue with on going upload deletion

* Improved the deletion feature

* Fixed indentations and unit tests

* Fixed bugs

* Fixed failing test

* Added error message in Failed Uploads Fragment

* Improved error notification

* Moved auto-retry from the Main Activity to UploadProgressActivity

* Fixed large uploads issue

* Minor fixes

* Removed HashSet

* Fixed issue with progress bar

* Bug fixes

* Moved Auto Retry to MainActivity

* Fixed conflicts

* Fixed issue with upload icon

* Fixed null ptr issue on changing modes

* Improved recycler view

* Fixed irrelevant network call

* Fixed irrelevant network call

* Fixed constantly failing uploads

* Fixed constantly failing uploads

* Fixed constantly failing uploads

* Added error log

* Fixed refresh icon visibility in light mode

* Changed progress in progress activity

* Fixed progress bar issue

* Improved icons

* Improved deletion and removed cancelledUploads Hashset

* Fixed sorting, list size issue

* Improved current implementation

* Implemented flag for workers

* Implemented flag for workers

* Fixed sorting bug

* Fixed upload icon

* Improved pausing

* Made changes to visibility implementation

* Added image duplicity check on restart of failed image

* minor adjustments

* added javadoc/kdoc and fixed minor bug

* Fixed unit tests

* Added synchronized(lock)

* Added check to prevent multiple uploads starting at once

* Ignored failing test cases

* Temporary commit - Added jcenter

* Temporary commit - Removed library/commented

* Temporary commit - Removed library/commented

* Updated com.jraska.livedata:testing-ktx

* Ignored failing test - UploadControllerTest.kt

* Ignored failing test - UploadModelUnitTest

* Ignored failing test - UploadModelUnitTest

* Ignored failing test - UploadModelUnitTest

* Ignored failing test - UploadModelUnitTest

* Ignored failing test - UploadModelUnitTest

* Ignored failing test - UploadModelUnitTest

* Ignored failing test - UploadModelUnitTest

* Ignored failing test - UploadModelUnitTest

* Ignored failing test - UploadPresenterTest.kt

* Ignored failing test - UploadPresenterTest.kt

* Ignored failing test - UploadPresenterTest.kt

* Ignored failing test - UploadPresenterTest.kt

* Ignored failing test - UploadPresenterTest.kt

* Ignored failing test - UploadPresenterTest.kt

* Ignored failing test - UploadPresenterTest.kt

* Ignored failing test - UploadPresenterTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing tests - UploadRepositoryUnitTest.kt

* Ignored failing test - UploadRepositoryUnitTest.kt

* Ignored failing test - DepictedItemTest.kt

* Ignored failing test - DepictedItemTest.kt

* Ignored failing test - DepictedItemTest.kt

* Ignored failing test - DepictedItemTest.kt

* Ignored failing test - DepictedItemTest.kt

* Ignored failing test - DepictedItemTest.kt

* Ignored failing test - DepictedItemTest.kt

* Ignored failing test - DepictedItemTest.kt

* Ignored failing test - FilesUtilsTest.kt

* Ignored failing test - WikiBaseClientUnitTest.kt

* Ignored failing test - WikiBaseClientUnitTest.kt

* Ignored failing test - WikiBaseClientUnitTest.kt

* Ignored failing test - WikidataClientTest.kt

* Ignored failing test - WikidataClientTest.kt

* Fixed unit tests

* Updated kdoc

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-08-30 15:22:54 +09:00
translatewiki.net
62d6dea219
Localisation updates from https://translatewiki.net. 2024-08-29 14:01:37 +02:00
Rohit Verma
190135d36c
Fix failing tests for updateDepictsProperty method (#5795)
* 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.
2024-08-28 15:29:16 +09:00
Rohit Verma
ec4a6bc0c4
remove asynchronous call to fetch local depictedItems (#5792) 2024-08-27 23:07:12 +09:00
translatewiki.net
39a0b88e3a
Localisation updates from https://translatewiki.net. 2024-08-26 14:02:06 +02:00
Rohit Verma
46df64d208
Prevent deletion of other structured data when editing depicts (#5741)
* restructure :  minor changes to comments to improve readability

* api: remove clear flag to prevent deletion of structured data

* WikiBaseInterface: add new api methods

Get Method: to get claims for an entity
Post method: to delete claims

* WikiBaseClient: add methods to handle response for new APIs

* typo:  update call to method with updated typo

* DepictEditHelper: call update property method with entity id

* refactor: dismiss progress dialog on error

* DepictsDao: remove usage of runBlocking as it was blocking main thread

Refactor methods to perform well with coroutines

* refactor: update usage of method to match changes in DepictsDao

* refactor: use named parameters to improve readability

* claims: add new data classes to represent remove claims

* WikidataEditService: modify update depicts property method

Performs deletion of old claims and creation of new claims

* refactor: make methods more organized
2024-08-26 15:43:50 +09:00
djbloop
31bb1a73c0
First of two fixes for bug #5726: hide nominate for deletion when logged out (#5773) 2024-08-26 13:24:15 +09:00
ujjwal2900
096c075548
Removed duplicate code in addMarkersToMap method (#5783) 2024-08-25 13:01:55 +09:00
Nicolas Raoul
a81d48cc9d
Updating jraska/livedata-testing for GSoC (#5785) 2024-08-22 22:41:27 +09:00
translatewiki.net
a3a5980ebd
Localisation updates from https://translatewiki.net. 2024-08-19 14:02:05 +02:00
translatewiki.net
060d41f973
Localisation updates from https://translatewiki.net. 2024-08-15 14:01:56 +02:00
translatewiki.net
dc6cc82751
Localisation updates from https://translatewiki.net. 2024-08-12 14:01:56 +02:00
translatewiki.net
9a31d2318e
Localisation updates from https://translatewiki.net. 2024-08-08 14:01:40 +02:00
translatewiki.net
862f8f0b04
Localisation updates from https://translatewiki.net. 2024-08-05 14:01:44 +02:00
Kanahia
2d63f351ed
Made Split to Nearby Query into a fast query for coordinates + a details query for each pin (#5731)
* Splitted the query

* Made changes to the query

* Improvised query

* Improvised query by dividing in the batches

* Fixed failing tests

* Improved batches

* Improved sorting

* Fixes issue caused by search this area button

* Fixed failing tests

* Fixed unnecessary reloads on onResume

* Fixed few pins not loading on changing apps

* Improved zoom level and fixed the pins not loading from the center

* Removed toggle chips and changed pin's color

* Fixed wikidata url

* Fixed unit tests

* Implemented retry with delay of 5000ms

* Fixed exception issue and pins issue

* Added change color icon to pin

* Improved pin clicking

* Removed search this area button

* Implemented caching of places

* Fixed unit test

* Factorized methods

* Changed primary key from location to entity id

* Fixed tests

* Fixed conflicts

* Fixed unit test

* Fixed unit test

* Fixed the bug

* Fixed issue with pin loading on the first launch

* Updated javadocs

* Temporary commit - only for testing

* Replaced Temporary commit

* Temporary commit - Added jcenter

* Made minor changes

* Fixed unit tests

* Fixed unit tests

* Fixed minor bug
2024-08-04 09:35:09 +09:00
translatewiki.net
ba6c8fe8d0
Localisation updates from https://translatewiki.net. 2024-08-01 14:01:42 +02:00
translatewiki.net
dbfe3b50f9
Localisation updates from https://translatewiki.net. 2024-07-29 14:02:27 +02:00
translatewiki.net
59da70aca1
Localisation updates from https://translatewiki.net. 2024-07-25 14:01:45 +02:00
translatewiki.net
d2d8eb9153
Localisation updates from https://translatewiki.net. 2024-07-22 14:01:59 +02:00
Kaartic Sivaraam
7d9f8d27bc
menu: rename menu as "User profile" (#5771)
As suggested by @whym on #5754, the name "User page" is ambiguous with
the on-wiki user page. We actually show the leaderboard when the menu
is clicked on. So, rename the menu as "User profile" instead.

Ref: https://github.com/commons-app/apps-android-commons/issues/5754#issuecomment-2196796213
2024-07-20 23:19:16 +10:00
Matija Nalis
7f6b45aeb6
Update allowed recent years to include 2020s (#5761)
* 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>
2024-07-20 23:16:20 +10:00
Amir E. Aharoni
34addbe33a
Remove unnecessary double quotes from a message (#5777) 2024-07-18 11:47:03 +09:00
Kaartic Sivaraam
5be76044b1
wikidata-feedback: avoid sentence lego (#5775)
Fixes #5763
2024-07-17 16:22:41 +09:00
translatewiki.net
73e9ed8e26
Localisation updates from https://translatewiki.net. 2024-07-15 14:02:06 +02:00
translatewiki.net
4d8a7dc138
Localisation updates from https://translatewiki.net. 2024-07-11 14:02:14 +02:00
Amir E. Aharoni
5bcbaa1beb
Improve the messages about being in a different place (#5764)
Remove parentheses and comma splice,
and replace them with more straightforward grammar.
2024-07-08 23:16:26 +09:00
translatewiki.net
018a924c53
Localisation updates from https://translatewiki.net. 2024-07-08 14:02:00 +02:00
Kanahia
3779cfb6a5
Added Wikitalk Page (#5740)
* Added wikitalk page and improved bottomsheet for landscape mode

* Improved wikitalk page

* Fixed italics

* Fixed little bug

* Improved the wiki talk page

* .

* changed commons url to wikidata url

* changed commons url to wikidata url + 1

* fixed bookmark issue

* Added kdoc and javadoc

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-07-08 15:13:57 +09:00
Kaartic Sivaraam
36905711d0 Version v5.0.2 2024-07-07 01:05:55 +05:30
translatewiki.net
05ffd123e4
Localisation updates from https://translatewiki.net. 2024-07-04 14:01:57 +02:00
translatewiki.net
923acd802c
Localisation updates from https://translatewiki.net. 2024-07-01 14:01:39 +02:00
translatewiki.net
f8e1030164
Localisation updates from https://translatewiki.net. 2024-06-27 14:01:37 +02:00
translatewiki.net
63ec5c8433
Localisation updates from https://translatewiki.net. 2024-06-20 14:01:59 +02:00
Kaartic Sivaraam
69cd9c94d1
Make sure to clear cookies on logout (#5727)
* 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.
2024-06-18 22:31:34 +02:00
Kaartic Sivaraam
1808699e89
Make new feedback to be added as a new section to the end of the page (#5753)
* 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
2024-06-18 21:40:30 +02:00
translatewiki.net
0e39d93721
Localisation updates from https://translatewiki.net. 2024-06-17 14:02:06 +02:00
Adam English
c2ac0f659a
Add code on line 340. Replace the 'Add location' button with 'Edit location' button when user clicks yes in similar image dialog (#5756)
Co-authored-by: starrain <zxyadelaide@gmail.com>
2024-06-15 22:17:28 +02:00
translatewiki.net
68df749ad2
Localisation updates from https://translatewiki.net. 2024-06-13 14:02:35 +02:00
translatewiki.net
5cdfb85a9c
Localisation updates from https://translatewiki.net. 2024-06-11 11:28:25 +02:00
Evangelos Talos
48bd3c07b8
Add ProgressBar to MediaDetailPagerFragment for Image Loading Indicator (#5736)
* Add progress bar to fragment_media_detail_pager.xml

* Add progress bar to MediaDetailPagerFragment.java

* Add javadoc & comments

* Fix tests

---------

Co-authored-by: Giannis Karyotakis <110292528+karyotakisg@users.noreply.github.com>
2024-06-10 20:06:06 +09:00
Jason-Whitmore
3dc7180784
LocationPickerActivity.java: Fix location picker bug with incorrect map centering (#5716)
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.
2024-06-09 21:24:40 +02:00
Kaartic Sivaraam
bb4cfe421a
feedback: add info about where the feedback gets posted (#5748)
* 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>
2024-06-09 21:08:38 +02:00
Evangelos Talos
22dd69cabb
Improved Map Marker Visibility Based on App Theme (#5744)
* Update map markers

* Modify code to use different map marker for themes

* Update map markers for bookmarked

* Add 2 tests

---------

Co-authored-by: Giannis Karyotakis <110292528+karyotakisg@users.noreply.github.com>
2024-06-09 21:07:02 +02:00
Zack Chi
bde09072fb
Update Java version from Java 8 to Java 11 (#5732)
Co-authored-by: Zack Chi <zach.chi.email@gmail.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-06-09 20:56:38 +02:00
pacha0
8fdfb8e6dc
Fixes bug #5721 (Crash when adding and then removing media details) (#5750)
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.
2024-06-06 15:10:26 +02:00
translatewiki.net
06e25a074c Localisation updates from https://translatewiki.net. 2024-06-03 14:03:12 +02:00
Giannis Karyotakis
fe7a2f2a8c
Fix voice input bug (#5739)
* Fix voice input bug

* Add javadocs

---------

Co-authored-by: vtalos <v.talos23@gmail.com>
2024-06-02 23:06:43 +05:30
translatewiki.net
18e03ed038 Localisation updates from https://translatewiki.net. 2024-05-30 14:02:21 +02:00
pacha0
ff21e73928
Updated skip_login_title string to sound more natural (#5746) 2024-05-30 09:49:03 +09:00
translatewiki.net
cd045a2a2a Localisation updates from https://translatewiki.net. 2024-05-27 14:01:46 +02:00
translatewiki.net
9a2a56c1cf Localisation updates from https://translatewiki.net. 2024-05-23 14:03:04 +02:00
translatewiki.net
041c293808 Localisation updates from https://translatewiki.net. 2024-05-20 14:01:58 +02:00
translatewiki.net
4545059035 Localisation updates from https://translatewiki.net. 2024-05-16 14:03:00 +02:00
translatewiki.net
7e84a447d4 Localisation updates from https://translatewiki.net. 2024-05-09 14:02:10 +02:00
translatewiki.net
c67cf4b07e Localisation updates from https://translatewiki.net. 2024-05-06 14:02:07 +02:00
Kanahia
6b93c34f9e
Changed Unknown to Wikidata Description (#5697)
* Delete app/src/main/res/values-yue-hant directory

* Changed Unknown to description
2024-05-03 07:23:19 +09:00
translatewiki.net
d6ac307f63 Localisation updates from https://translatewiki.net. 2024-05-02 14:02:38 +02:00
Evangelos Talos
c178c5de41
Enhancing Multi-Upload Functionality for Consistent Depiction Categorization (#5700)
* 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>
2024-05-02 20:12:32 +09:00
translatewiki.net
6aa9303d0f Localisation updates from https://translatewiki.net. 2024-04-29 14:02:13 +02:00
Kaartic Sivaraam
af028cbddc Version v5.0.1 (fix release variant of v5.0.0)
The same as v5.0.0 except this fixes the release variants of the
app for v5.0.0.
2024-04-28 16:58:49 +05:30
Kaartic Sivaraam
da0b2c28e3 app: adjust R8 rules to ensure our model classes are not obfuscated
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.
2024-04-28 16:21:14 +05:30
Kaartic Sivaraam
4cc5224556 CHANGELOG: add link to the v5.0.0 GitHub release 2024-04-28 15:07:13 +05:30
Kaartic Sivaraam
c692766c41 CHANGELOG: fix diff link to appropriately use the v5.0.0 tag 2024-04-28 15:05:54 +05:30
Kaartic Sivaraam
12ac709aba Rebrand v4.3.0 as v5.0.0
We have a huge quantum of changes since v4.2.1. So, it makes sense
to bump the major release. So, rebrand v4.3.0 as v5.0.0.
2024-04-28 14:46:47 +05:30
Kaartic Sivaraam
9f904a9515 Version v4.3.0 2024-04-27 22:35:06 +05:30
rohit-satya
e7504b8344
rename method setImageTobeUploaded to setImageToBeUploaded (#5706) 2024-04-27 13:35:26 +05:30
translatewiki.net
2e0c57b3ce Localisation updates from https://translatewiki.net. 2024-04-25 14:02:33 +02:00
RedAuburn
e23d03b2db
remove yue-hant again (#5702) 2024-04-23 22:29:51 +09:00
translatewiki.net
feabb6bc20 Localisation updates from https://translatewiki.net. 2024-04-22 14:02:19 +02:00
Kaartic Sivaraam
4eb8a82191 Remove the value-yue-hant file
The file is not properly recognized by Android and we've actually
codemapped it to yue. The translatewiki configuration has been
done in the incorrect file. So, it is still being created.

The following Gerrit change would correct it for updates after that
change is merged.

  1022508

For the time being remove it for the sake of release.
2024-04-21 19:49:59 +05:30
translatewiki.net
4bd48aa432 Localisation updates from https://translatewiki.net. 2024-04-18 14:02:49 +02:00
Shashwat Kedia
04f9ef4819
Fixes Location related flow of the app #5256 , #5461, #5490 (#5494)
* Resolved merged conflicts

* Resolved merge conflicts and updated workflow

* Updated Location Flow and merged conflicts

* Update flow and merge conflicts

* Fixed LocationPicker's location flow

* Removed redundant code from  LocationPermissionsHelper

* Fixed Explore fragment crashing and incorrect behaviour

* Updated LocationPicker Flow

* Fixed Nearby not working as intended

* Final update to location flow of all maps

* Added the reqested changes and fixed bugs

* Resolved requested change in in-app camera location flow

* Fixed In-app camera location flow

* Resolved conflicts in ContributionsListFragment

* Updated java doc as requested

* Resolved nearby card dialog not being shown

* Optimised LocationPermissionsHelper javadoc

* Made requested changes for preference check

* Added javadoc and requested comment for later reference

* Implemented requested code changes

* Fixed failing test due to changes made during PR

* Added string resource for ExploreMapFragment

* Changed string resource for rationale dialog

* Added standard location flow information in LocationPermissionsHelper

* Added javadoc for doNotAskForLocationPermission

* Removed unused import

* Updated javadoc

* Removed values-yue-hant

* Fix some merge conflict errors

* Fix minor errors due to mergre conflicts

* Fix some refactor errors

* Fixed minor bug due to merging conflicts

* Delete app/src/main/res/values-yue-hant directory

* Final changes to NearbyParentFragment

* Fixes #5686 map coordinates set to image coords

* Removed some redundant code from recenterMap

* Removed one test whose method no longer exists

* Removed unused method from contract of nearby

* Removed redundant method from NearbyParentFragment

* nearby: add a FIXME about the possibly redudant code

---------

Co-authored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
2024-04-17 09:18:34 +05:30
RedAuburn
1f2e31d45b
Add Adaptive Icon (#5687)
* Add Adaptive Icon

allows for better theming on android O and above.

* remove values-yue-hant
2024-04-16 16:51:54 +09:00
translatewiki.net
de95c46627 Localisation updates from https://translatewiki.net. 2024-04-15 14:02:26 +02:00
translatewiki.net
8ce7485153 Localisation updates from https://translatewiki.net. 2024-04-11 14:02:37 +02:00
Shashank Kumar
2d29fbe885
Fix Failing Tests in DescriptionEditActivityUnitTest (#5685)
* initial commit

* Fix No Precise Message After Clicking Review Buttons

* Fix For ThanksClient

* Fix For Depictions

* Fix For Categories

* Fix For Description & Coordinates

* Fix For Description & Coordinates

* Fix For Description & Coordinates

* Fix For Mark as Read notifications

* resolve conflicts

* fix merge conflicts

* fix tests

* fix tests

* fix tests

* fix tests
2024-04-11 15:47:36 +09:00
Brooke Vibber
a595500921
Add a .mailmap file to update bvibber's name/email (#5684) 2024-04-09 07:14:11 +09:00
translatewiki.net
200894665b Localisation updates from https://translatewiki.net. 2024-04-08 14:02:11 +02:00
translatewiki.net
9aa1875bc4 Localisation updates from https://translatewiki.net. 2024-04-04 14:03:12 +02:00
Nicolas Raoul
aa39e509c3
Updated contributors gallery 2024-04-02 22:51:47 +09:00
translatewiki.net
6cbeec2119 Localisation updates from https://translatewiki.net. 2024-04-01 14:02:56 +02:00
Neel Doshi
54312fc2ac
Feat : Added a feature for users to add feadback on github (#5578)
* Feat : Added a place for users to add feadback on github

* Code Cleanup : Added Github Issue URL as Const

* Homogenized

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-04-01 17:36:21 +09:00
Shashank Kumar
3d1efecb55
Fix - No Precise Error Message After Error Due to Password Change (#5643)
* initial commit

* Fix No Precise Message After Clicking Review Buttons

* Fix For ThanksClient

* Fix For Depictions

* Fix For Categories

* Fix For Description & Coordinates

* Fix For Description & Coordinates

* Fix For Description & Coordinates

* Fix For Mark as Read notifications

* resolve conflicts

* fix merge conflicts
2024-04-01 17:23:00 +09:00
Rohit Verma
e56de2c343
Allow only 1 picture to be selected by System Picker through Nearby (#5680)
* SettingsFragment: add a method for creating locale

* SettingsFragmentUnitTests: fix failing tests for createLocale

* NearbyParentFragment: set WLM check to false
2024-04-01 11:54:30 +09:00
Shashank Kumar
82b97fc49f
Fix Crash EditDescriptionActivity when switched dark/light mode (#5503)
* Fix Crash EditDescriptionActivity when switched dark/light mode

* tests added

* fix

* code cleanup

* code cleanup

* Fix

* Fix
2024-03-31 15:36:41 +09:00
Rohit Verma
5a508ae417
Rename be-x-old language code to be-tarask in languages list (#5676)
* SettingsFragment: add a method for creating locale

* SettingsFragmentUnitTests: fix failing tests for createLocale

* languages_list: rename be-x-old to be-tarask
2024-03-31 00:10:59 +09:00
Shashwat Kedia
0a6257b27b
Adds a 'Remove Location' button to the UploadWizard #5247 (#5672)
* Implemented basic flow to remove location

* Fixed and added new tests and enhanced UX
2024-03-30 23:34:55 +09:00
Kanahia
7dd00efa64
Fixes App crashes on clicking Save (EditActivity) (#5670)
* Fixed Grey empty screen at Upload wizard caption step after denying files permission

* Empty commit

* Fixed loop issue

* Created docs for earlier commits

* Fixed javadoc

* Fixed spaces

* Added added basic features to OSM Maps

* Added search location feature

* Added filter to Open Street Maps

* Fixed chipGroup in Open Street Maps

* Removed mapBox code

* Removed mapBox's code

* Reformat code

* Reformatted code

* Removed rotation feature to map

* Removed rotation files and Fixed Marker click problem

* Ignored failing tests

* Added voice input feature

* Fixed test cases

* Changed caption and description text

* Replaced mapbox to osmdroid in upload activity

* Fixed Unit Tests

* Made selected marker to be fixed on map

* Changed color of map marker

* Fixes #5439 by capitalizing first letter of voice input

* Removed mapbox code1

* Removed mapbox code2

* Fixed failing tests

* Fixed failing due to merging

* Added feature to save nearby places as GPX and KML

* Fixed error caused by null

* Improved UX for Nearby Export

* Delete app/src/main/res/values-yue-hant directory

* Fixed internationalization issue

* Fixed crash
2024-03-30 10:29:59 +09:00
Shashank Kumar
5ca3b7834d
Remove Butterknife from Project (#5660) 2024-03-30 10:27:59 +09:00
Shashank Kumar
4c687b4335
Set Wallpaper in background (#5665)
* Worker added for setting up wallpaper

* Fix crash

* Fix test

* Fix test
2024-03-30 09:04:07 +09:00
Neel Doshi
a7a2125e1d
Fix : Dialog Scroll Issue for devices below Android 10 (#5663) 2024-03-29 20:37:43 +09:00
Kanahia
1f064e29fa
Fixes Nearby export: Pins not all around me (#5658)
* Fixed Grey empty screen at Upload wizard caption step after denying files permission

* Empty commit

* Fixed loop issue

* Created docs for earlier commits

* Fixed javadoc

* Fixed spaces

* Added added basic features to OSM Maps

* Added search location feature

* Added filter to Open Street Maps

* Fixed chipGroup in Open Street Maps

* Removed mapBox code

* Removed mapBox's code

* Reformat code

* Reformatted code

* Removed rotation feature to map

* Removed rotation files and Fixed Marker click problem

* Ignored failing tests

* Added voice input feature

* Fixed test cases

* Changed caption and description text

* Replaced mapbox to osmdroid in upload activity

* Fixed Unit Tests

* Made selected marker to be fixed on map

* Changed color of map marker

* Fixes #4345

* Delete app/src/main/res/values-yue-hant directory

* Added comment explaining the context

* Fixes #5651

* Deleted directory

* Changed query to 10 kilometers

* Fixed issue

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-03-29 19:44:49 +09:00
Kanahia
6d4ba12775
Improved UX for Nearby Export (#5654)
* Fixed Grey empty screen at Upload wizard caption step after denying files permission

* Empty commit

* Fixed loop issue

* Created docs for earlier commits

* Fixed javadoc

* Fixed spaces

* Added added basic features to OSM Maps

* Added search location feature

* Added filter to Open Street Maps

* Fixed chipGroup in Open Street Maps

* Removed mapBox code

* Removed mapBox's code

* Reformat code

* Reformatted code

* Removed rotation feature to map

* Removed rotation files and Fixed Marker click problem

* Ignored failing tests

* Added voice input feature

* Fixed test cases

* Changed caption and description text

* Replaced mapbox to osmdroid in upload activity

* Fixed Unit Tests

* Made selected marker to be fixed on map

* Changed color of map marker

* Fixes #5439 by capitalizing first letter of voice input

* Removed mapbox code1

* Removed mapbox code2

* Fixed failing tests

* Fixed failing due to merging

* Added feature to save nearby places as GPX and KML

* Fixed error caused by null

* Improved UX for Nearby Export

* Delete app/src/main/res/values-yue-hant directory

* Fixed internationalization issue
2024-03-28 23:12:54 +09:00
translatewiki.net
c5c5a52a09 Localisation updates from https://translatewiki.net. 2024-03-28 13:02:56 +01:00
Shashank Kumar
d408134b7e
Enhacement - Add Custom Image Selector FAB Option to Nearby (#5655)
* Fix

* Fix

* Migrate NearbyParentFragment to ViewBinding

* remove unused Imports

* fix crash
2024-03-28 19:34:52 +09:00
Shashank Kumar
4c43bf2bd4
Fix-Peer Review Buttons not get disabled after voting an Image for deletion (#5519)
* Fix-Peer Review Buttons not get disabled after voting an Image for deletion

* Fix
2024-03-27 22:24:44 +09:00
Shashwat Kedia
42641644cb
Fixes #4704: Remove 'Please Wait' dialog and do task in background (#5570)
* Initial changes to the flow, merged conflicts

* Major changes to flow and logic

* Final major changes to the flow and merged conflicts

* Minor changes to thumbnail flow and merge conflicts

* Fixed ImageProcessingServiceTest

* Removed unnecessary file

* Some code cleanup and fixed UploadRepositoryUnitTest

* Minor javadoc changes and null checks

* Fixed UMDFragmentUnitTest

* Fixed and added new tests in UploadMediaPresenterTest

* Optimised code for no connection cases and minor code cleanup

* Minor bug fix

* Fixed minor bug

* Fixed a failing unit test

* Removed values-yue-hant

* Update UploadRepository.java

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-03-27 16:33:28 +09:00
Shashank Kumar
16960a369a
Fix (#5648) 2024-03-27 16:28:16 +09:00
Neel Doshi
ce9dc33045
Refactor : String when achievements not loaded (#5653) 2024-03-27 16:01:28 +09:00
Neel Doshi
c9317d891e
Removed unused butterknife binding import (#5659) 2024-03-27 15:28:00 +09:00
Kanahia
30b8968199
Changed Created by in Neaby export (#5652)
* Fixed Grey empty screen at Upload wizard caption step after denying files permission

* Empty commit

* Fixed loop issue

* Created docs for earlier commits

* Fixed javadoc

* Fixed spaces

* Added added basic features to OSM Maps

* Added search location feature

* Added filter to Open Street Maps

* Fixed chipGroup in Open Street Maps

* Removed mapBox code

* Removed mapBox's code

* Reformat code

* Reformatted code

* Removed rotation feature to map

* Removed rotation files and Fixed Marker click problem

* Ignored failing tests

* Added voice input feature

* Fixed test cases

* Changed caption and description text

* Replaced mapbox to osmdroid in upload activity

* Fixed Unit Tests

* Made selected marker to be fixed on map

* Changed color of map marker

* Fixes #4345

* Delete app/src/main/res/values-yue-hant directory

* Added comment explaining the context

* Fixes #5651

* Deleted directory

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-03-26 16:28:34 +09:00
Neel Doshi
71a45c02e2
Refactor CampaignView to use ViewBinding. (#5607) 2024-03-25 22:11:24 -05:00
Neel Doshi
21fdd39d7c
Refactor : NotificationActivity uses ViewBinding. (#5606) 2024-03-25 21:39:32 -05:00
Kanahia
c41940241b
Added functionality to export location of nearby missing pictures to GPX file and KML file (#5645)
* Fixed Grey empty screen at Upload wizard caption step after denying files permission

* Empty commit

* Fixed loop issue

* Created docs for earlier commits

* Fixed javadoc

* Fixed spaces

* Added added basic features to OSM Maps

* Added search location feature

* Added filter to Open Street Maps

* Fixed chipGroup in Open Street Maps

* Removed mapBox code

* Removed mapBox's code

* Reformat code

* Reformatted code

* Removed rotation feature to map

* Removed rotation files and Fixed Marker click problem

* Ignored failing tests

* Added voice input feature

* Fixed test cases

* Changed caption and description text

* Replaced mapbox to osmdroid in upload activity

* Fixed Unit Tests

* Made selected marker to be fixed on map

* Changed color of map marker

* Fixes #5439 by capitalizing first letter of voice input

* Removed mapbox code1

* Removed mapbox code2

* Fixed failing tests

* Fixed failing due to merging

* Added feature to save nearby places as GPX and KML

* Fixed error caused by null
2024-03-25 23:22:17 +09:00
translatewiki.net
dae1f2557e Localisation updates from https://translatewiki.net. 2024-03-25 13:02:47 +01:00
Kaartic Sivaraam
01a3e14154
achievements: make sure thanks count is displayed properly (#5647)
We seem to be incorrectly setting the the thanks count in the achievement level
text. This was then being over-written by the actual achievement level value
in the code flow. In the end, the thanks count seems not to have been displayed at all.

Correct this by properly updating the thanks count.

Fixes #5641
2024-03-25 19:30:04 +09:00
Shashank Kumar
2a2780a4d2
Migrated Review Package to View Binding (#5604)
* Migrated Review Package to View Binding
* fix
2024-03-24 23:17:08 -05:00
bugfixer4646
a45ab9cf16
Refactor curlatLng to currentLatLng (#5646)
Co-authored-by: Aahlad <aahladkethineeedi@gmail.com>
2024-03-25 10:35:30 +09:00
Kanahia
cd337b000e
Fixed Blue square appears at end of description of image uploaded (#5616)
* Fixed Grey empty screen at Upload wizard caption step after denying files permission

* Empty commit

* Fixed loop issue

* Created docs for earlier commits

* Fixed javadoc

* Fixed spaces

* Added added basic features to OSM Maps

* Added search location feature

* Added filter to Open Street Maps

* Fixed chipGroup in Open Street Maps

* Removed mapBox code

* Removed mapBox's code

* Reformat code

* Reformatted code

* Removed rotation feature to map

* Removed rotation files and Fixed Marker click problem

* Ignored failing tests

* Added voice input feature

* Fixed test cases

* Changed caption and description text

* Replaced mapbox to osmdroid in upload activity

* Fixed Unit Tests

* Made selected marker to be fixed on map

* Changed color of map marker

* Fixes #4345

* Delete app/src/main/res/values-yue-hant directory

* Added comment explaining the context

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-03-25 08:29:30 +09:00
Kanahia
724e4db0fd
Made Nearby show all pins that could be presented on the screen, rather than a circle (#5553)
* Changed nearby from circle to rectangle

* Fixed bug

* Removed MAPBOX Token

* Fixed minor issues

* Fixed minor issues

* Changed query files

* Changed monuments query file

* Fixed Unit Tests

* Fixed failing tests

* Fixed errors due to merging
2024-03-24 23:24:39 +09:00
Shashank Kumar
f404ac9b47
Remove Image From Upload Wizard (#5636)
* Added Remove Icon to Image Thumnails

* fix

* fix

* fix tests
2024-03-24 17:32:56 +09:00
Shashank Kumar
78a53fd40d
fix (#5640) 2024-03-24 08:56:47 +09:00
Shashank Kumar
e5c4230f97
Fix - Custom picker sometimes crashing when marking many pictures as "not for upload" towards the bottom (#5639)
* fix crash

* fix crash
2024-03-24 08:39:39 +09:00
Rohit Verma
7e5789d539
Resolve switching languages problem in settings fragment (#5560)
* SettingsFragment: add a method for creating locale

* SettingsFragmentUnitTests: fix failing tests for createLocale
2024-03-22 23:12:45 +09:00
Lawal abiola
751bc6ce6b
fix: thumbnail of rotated image not visible during upload (#5552)
[The image path of rotated image is not save like nornal image.
so imageview cannot load rotated image

check whether the image path is file uri then add imagerequest to load the image]

[fixed: thumbnail not visible when upload rotated image]
2024-03-22 22:51:31 +09:00
Shashank Kumar
2d333a2af0
Custom picker: Show differently pictures that are currently being uploaded (#5618)
* Custom picker: Show differently pictures that are currently being uploaded

* fix tests

* fix test

* fix crash

* handle all cases

* handle all cases

* fix

* Hide Images When showAlreadyActioned is disabled

* Fix Tests

* cleanup
2024-03-22 22:13:19 +09:00
Amir E. Aharoni
72cdb5d0dd
Message spelling and punctuation improvement (#5638)
1. Remove comma splice.
2. Consistent spelling: "log-in" as noun, "log in" as verb.
2024-03-22 11:21:51 +09:00
Shashank Kumar
2a6ab66c11
Precise error message password change (#5544)
* Precise Error Message and Action When Password is Changed

* Make message persistent

* code cleanup and fixes

* removed unnecessary string resource

* removed unnecessary string resource

* fix

* fix

* Upload Client to kotlin

* Remove Redundant Code

* Remove Redundant Code

* code cleanup and Improvements

* Improved Java doc

* Improved Java doc

* Improved Javadoc
2024-03-21 23:21:53 +05:30
Kanahia
152e824aa6
Fixed reproducible crash when marking last pictures as "not for upload" (#5635)
* Fixes #5634

* Delete app/src/main/res/values-yue-hant directory
2024-03-21 22:51:33 +09:00
Kanahia
d112be04db
Removed MapBox related imports (#5631)
* Fixed Grey empty screen at Upload wizard caption step after denying files permission

* Empty commit

* Fixed loop issue

* Created docs for earlier commits

* Fixed javadoc

* Fixed spaces

* Added added basic features to OSM Maps

* Added search location feature

* Added filter to Open Street Maps

* Fixed chipGroup in Open Street Maps

* Removed mapBox code

* Removed mapBox's code

* Reformat code

* Reformatted code

* Removed rotation feature to map

* Removed rotation files and Fixed Marker click problem

* Ignored failing tests

* Added voice input feature

* Fixed test cases

* Changed caption and description text

* Replaced mapbox to osmdroid in upload activity

* Fixed Unit Tests

* Made selected marker to be fixed on map

* Changed color of map marker

* Fixes #5439 by capitalizing first letter of voice input

* Removed mapbox code1

* Removed mapbox code2

* Fixed failing tests

* Fixed failing due to merging
2024-03-21 22:43:22 +09:00
translatewiki.net
9041e1bc0c Localisation updates from https://translatewiki.net. 2024-03-21 13:03:00 +01:00
Shashank Kumar
7e9aa5b72a
Migrated Media Package to View Binding (#5601)
* Migrated Media Detail Fragment to View Binding
* Migrated ZoomableActivity and PagerFragment
* Improved Java doc
* Improved Java doc
2024-03-20 20:29:07 -05:00
Shashank Kumar
8df0055a5a
Migrated CategoryDetailsActivity , MainActivity to View Binding (#5595)
* Butterknife to ViewBinding
* code fix to pass all tests
2024-03-19 19:21:51 -05:00
Rajesh
23492ab11f
#5611 removed MapBox from CREDIS because it has already been replaced (#5617) 2024-03-18 22:41:51 +09:00
translatewiki.net
192a17156c Localisation updates from https://translatewiki.net. 2024-03-18 13:02:41 +01:00
Shashwat Kedia
bd06a74caa
#4664 Moved Settings Activity to ViewBinding (#5506)
* Moved Main Activity and Settings Activity to ViewBinding
* Moving only SettingsActivity for now
* Removed values-yue-hant directory
* Removing previously done changes to main.xml
2024-03-17 09:03:21 -05:00
Shashank Kumar
fec6dba341
Fix Crash in LocationPickerActivity when device configuration is changed (#5500)
* Fix Crash in LocationPickerActivity when device configuration is changed (UI Modes)

* clean up

* fix

* fix

* fix

* fix

* removed faulty test

* cleanup

* fix and tests added
2024-03-17 22:46:13 +09:00
Shashank Kumar
161e2edc31
Migrated Bookmarks Package From Butterknife to ViewBinding (#5594)
* Butterknife to ViewBinding
* code fix to pass all tests
* code cleanup & binding added to tests
2024-03-17 08:01:55 -05:00
Shashank Kumar
3e5424e18d
Fix Custom image selector (#5576)
* Custom Image Selector Fix

* Custom Image Selector Fix

* code cleanup

* fixes

* Renamed yue-hant

* added java docs

* fix
2024-03-16 22:15:21 +09:00
Shashank Kumar
f73c9dc4d3
Migrate Upload Package To View Binding from Butterknife (#5590)
* Butterknife to ViewBinding
* Butterknife to ViewBinding
* code cleanup and tests fixed
* code cleanup and optimised imports
2024-03-15 14:37:28 -05:00
translatewiki.net
1b5df47362 Localisation updates from https://translatewiki.net. 2024-03-14 13:03:25 +01:00
Shashank Kumar
c94f607107
Migrated Contributions Package From Butterknife to ViewBinding (#5593)
* Butterknife to ViewBinding
* code fix to pass all tests
* test fix
* test fix
* test fix
* test fix
* Update ContributionsFragmentUnitTests.kt
* code cleanup and tests improved
* tests fixed
* adjustments and code cleanup
* adjustments and code cleanup
2024-03-12 21:16:55 -05:00
Shashank Kumar
2076bf9b29
Migrated Explore Package From Butterknife to ViewBinding (#5592)
* Butterknife to ViewBinding
* code cleanup and tests migrated to binding
* tests fixed
* adjustments and code cleanup
2024-03-11 15:48:37 -05:00
translatewiki.net
7b63185d5a Localisation updates from https://translatewiki.net. 2024-03-11 13:02:23 +01:00
Shashank Kumar
6ed5deac65
Migrated Profile Package from Butterknife to View Binding (#5591)
* Butterknife to ViewBinding
* code fix to pass all tests
* code cleanup and tests migrated to binding
* fix LoD
2024-03-10 14:44:06 -05:00
Neel Doshi
dbe739e755
CodeCleanup : Removed Unused Import from packages. (#5609)
* CodeCleanup : Removed Unused Import from packages.

* Removed : value-yue-hant directory.
2024-03-08 23:21:27 +09:00
translatewiki.net
b5ce7c735d Localisation updates from https://translatewiki.net. 2024-03-07 13:02:16 +01:00
Neel Doshi
28ea11127c
Refactor : API calls moved out of the LoginActivity (#5599)
* Refactor :API calls separated from activity added to LoginClient
* getLoginToken() modifier set to private
* Code Cleanup : removed non-null from twofactor and Locale import
* Indentation fix
2024-03-06 08:35:50 -06:00
translatewiki.net
2c376da46e Localisation updates from https://translatewiki.net. 2024-03-04 13:02:19 +01:00
translatewiki.net
9e5854766e Localisation updates from https://translatewiki.net. 2024-02-29 13:02:11 +01:00
translatewiki.net
55346c125b Localisation updates from https://translatewiki.net. 2024-02-26 13:02:48 +01:00
Shashank Kumar
f5a5159f8c
Fix Crash Edit Categories Fragment (#5510)
* fix crash

* Tests Added

* Tests and Null Checks Added
2024-02-26 18:42:51 +09:00
Ivan C. Acha
535792390e
Changed line break behaviour. (#5562)
Added line breaks to PageContentsCreator.java, CategoryEditHelperUnitTests.kt, and MediaDetailFragmentUnitTests.kt following the example given on issue #5523.
2024-02-25 23:00:45 +09:00
translatewiki.net
0656c88fbe Localisation updates from https://translatewiki.net. 2024-02-22 13:02:22 +01:00
Paul Hawke
f0a1d036a5
Convert upload client to kotlin (#5568)
* Write unit tests for the UploadClient (with gentle refactoring to make it testable)

* Convert Upload client to kotlin
2024-02-21 15:55:35 +09:00
Paul Hawke
728712c4e1
Convert API clients to kotlin (#5567)
* Convert UserClient to kotlin

* Added tests for WikiBaseClient

* Removed superfluous dao tests in review helper and got the proper ReviewDaoTest running in the unit test suite

* Improved tests for ReviewHelper

* Convert the ReviewHelper to kotlin

* Convert the WikiBaseClient to kotlin

* Convert the WikidataClient to kotlin
2024-02-20 09:23:11 +09:00
translatewiki.net
c43405267a Localisation updates from https://translatewiki.net. 2024-02-19 13:02:18 +01:00
Rohit Verma
9a8b89c19a
nearby: Show 'no images in this area' message instead of generic error (#5541) 2024-02-18 15:02:19 +00:00
tamojitdas
74f2e9cd60
fix: unit tests for switching from MapBox to OpenStreetMap (#5536)
Fixes #5408
2024-02-18 14:06:40 +00:00
Kanahia
26658e91b3
Removed MAPBOX Access token (#5555)
* Update gradle.properties

* Update build.gradle

* Update CommonsApplication.java

* Update LocationServiceManager.java
2024-02-16 20:56:58 +09:00
Shashank Kumar
4c5d690a9e
Fix Crash When Explore Tab is Clicked (#5550) 2024-02-15 22:54:10 +09:00
Kwong Yu Zhou
013bc7db39
Replaced campaignPreference with CAMPAIGNS_DEFAULT_PREFERENCE (#5357)
Co-authored-by: Kwong Yu Zhou <https://github.com/kwong-yu-zhou>
Co-authored-by: Adam Jones <domdomegg+git@gmail.com>
2024-02-14 21:23:23 +00:00
Shashank Kumar
2d5b7cc579
Fix DNG/RAW Upload Error (#5543)
* Fix DNG/RAW Upload Error

* Fix DNG/RAW Upload Error

* supported formats added

* cleanup
2024-02-14 21:09:48 +09:00
Adam Jones
1cbce77d5f
Migrate from Kotlin synthetics to Jetpack view binding (#5546) 2024-02-14 18:29:06 +09:00
Shashwat Kedia
b18117bc07
Resolved Problems in UploadMediaDetails flow and UX #5511 (#5527)
* Fixed arrow flickering issue on zoom

* Resolved issue point 1 and 3

* Resolved issue point 2

* Minor changes

* Update UploadActivity.java

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-02-14 18:07:51 +09:00
Shashank Kumar
a308a1c8b5
Fix Methods Usage Incompatible with Android API Level 21 (#5525) 2024-02-14 09:05:13 +00:00
Shashank Kumar
8df7f66992
Show Labels For FAB in Contribution Page (#5493) 2024-02-13 21:33:03 +00:00
translatewiki.net
d8b7e27b48 Localisation updates from https://translatewiki.net. 2024-02-12 13:02:39 +01:00
Shashank Kumar
1895bb3ec2
Fix - Unable to Access Privacy Policy (#5534)
* Fix - Unable to Access Privacy Policy

* cleanup
2024-02-11 21:11:20 +09:00
Paul Hawke
f9090b0c2c
Consistent api interfaces (#5530)
* Converted CategoryInterface to kotlin

* Converted DepictsInterface to kotlin

* Convert the MediaDetailInterface to kotlin

* Convert MediaInterface to kotlin

* Convert ReviewInterface to kotlin

* Convert the UserInterface to kotlin

* Convert the WikiBaseInterface to kotlin

* Convert WikidataInterface to kotlin

* Convert WikidataMediaInterface to kotlin

* Convert UploadInterface to kotlin
2024-02-09 13:43:01 +09:00
Paul Hawke
c6cb97e199
Add ability to suppress logging of known unsuccessful API calls (#5526) 2024-02-09 06:55:56 +09:00
translatewiki.net
ba11f0d06e Localisation updates from https://translatewiki.net. 2024-02-08 13:02:19 +01:00
translatewiki.net
a534c11bbb Localisation updates from https://translatewiki.net. 2024-02-05 13:03:06 +01:00
Paul Hawke
0c3085257d
Data client simplification / removal (#5507)
* Removed unused code from the data client module

* Move remaining code out of the data-client and remove it
2024-02-03 10:26:06 +09:00
Shashank Kumar
72a6fd2c90
Enhancement - Nearby banner shows Item without image (#5468)
* Enhancement Nearby banner shows Item without image

* spacing

* Enhancement Nearby banner shows Item without image

* spacing

* Fix Crash

* Reverted "Fix Crash"

This reverts commit a41c9362bb.

* Fixed

* Fix null location

* Fix Conflict

* Show Only Items that exists

---------

Co-authored-by: shashankkumar <shashankkumar45556@gmail.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-02-01 22:17:52 +09:00
translatewiki.net
60046f4881 Localisation updates from https://translatewiki.net. 2024-02-01 13:02:45 +01:00
Paul Hawke
8db0b54929
Remove the data-client app adapter implementation (#5499)
* logErrorsInsteadOfCrashing only ever returned false, so remove it and simplify logger

* Removed unused getMediaWikiBaseUrl()

* Removed getDesiredLeadImageDp() from commons app adapter, since it's unused

* Inlined the isLoggedIn() method of the app adapter

* Inline the app adapter username/password

* Removed the unused getRestbaseUriFormat() from the commons app adapter

* Remove references to the data-client SharedPreferenceCookieManager

* Manage our own OkHttpClient and remove the AppAdapter implementation
2024-01-31 10:21:43 +09:00
Paul Hawke
ab9e57f5be
Decouple from the data-client service factory, with some code cleanup in the process (#5496) 2024-01-30 07:46:01 +09:00
translatewiki.net
7ec2a22fce Localisation updates from https://translatewiki.net. 2024-01-29 13:03:35 +01:00
Shashank Kumar
8bafee3801
Enhancement-Show Icon Labels When Long Pressed (#5492)
* Enhancement-Show Icon Labels when Long Pressed

* Tests Added
2024-01-29 17:05:43 +09:00
Nicolas Raoul
a8545abff2 Merge remote-tracking branch 'origin/switch-to-commons-toolforge' 2024-01-29 15:35:33 +09:00
Rohit Verma
9f7e407181
DepictsFragment: add null check for media (#5488) 2024-01-29 15:33:36 +09:00
Paul Hawke
84ffffbbe7
Create CsrfTokenClient and LoginClient by injection, along with a little cleanup (#5491) 2024-01-29 12:36:57 +09:00
Shashwat Kedia
5661e8c332
Fixed flickering of nearby banner compass (#5486) 2024-01-29 09:02:30 +09:00
Kaartic Sivaraam
f1276e4697 Fix broken reference to a missing resource ID
Seems like a fallout of the change done in PR #5464

This hopefully should make the instrumentation tests resume.
2024-01-28 17:53:27 +05:30
Kaartic Sivaraam
805076ee6b Update test case for the toolforge URL change 2024-01-28 17:09:43 +05:30
Kaartic Sivaraam
611f40801e Switch to using the commons toolforge instance fully
So far we used both the urbanecmbot instances and also the commons-android-app
toolforge instance for the functioning of the app.

The reality is that the commons-android-app instance itself had the ability
to return all the data necessary for the app. Use the same to get all the
data necessary for the app.

Fixes #5462
2024-01-28 14:27:13 +05:30
Paul Hawke
9e970123fd
Removed references to the data-client Service interface (#5484) 2024-01-28 08:25:56 +09:00
Shashwat Kedia
8222c4a42c
Resolves Issue #5413 Crash when opening Nearby when location permission hasn't been granted yet (#5418)
* Resolves Issue #5413

* Added Javadoc and formatted code
2024-01-27 22:47:36 +09:00
Kanahia
71de19f27b
Fixed javadoc issue (#5481) 2024-01-27 22:40:18 +09:00
Kanahia
96b2608eb1
Replace Mapbox with OSMDroid (Explore Activity) (#5475)
* Fixed Grey empty screen at Upload wizard caption step after denying files permission

* Empty commit

* Fixed loop issue

* Created docs for earlier commits

* Fixed javadoc

* Fixed spaces

* Added added basic features to OSM Maps

* Added search location feature

* Added filter to Open Street Maps

* Fixed chipGroup in Open Street Maps

* Removed mapBox code

* Removed mapBox's code

* Reformat code

* Reformatted code

* Removed rotation feature to map

* Removed rotation files and Fixed Marker click problem

* Ignored failing tests

* Added voice input feature

* Fixed test cases

* Changed caption and description text

* Replaced mapbox to osmdroid in upload activity

* Fixed Unit Tests

* Made selected marker to be fixed on map

* Changed color of map marker

* Fixes #5439 by capitalizing first letter of voice input

* Made UI changes in UploadMediaDetailAdapter

* Added javadoc

* Replaced Mapbox with OSMDroid in explore activity

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-01-27 21:39:08 +09:00
Paul Hawke
02ce017c98
Convert the LoginClient to kotlin (#5479)
* Convert the result classes to kotlin

* Convert response and callback to kotlin

* Cleanup code-quality warnings before converting

* Converted the LoginClient to kotlin

* Updated the UserExtendedInfoClientTest to be kotlin, and live in the correct spot
2024-01-27 12:39:00 +09:00
Paul Hawke
0541aacdff
Move login client out of the data-client (#5476) 2024-01-26 23:11:44 +09:00
Shashank Kumar
8789879f10
Fix Multi-Upload Wizard only asks Metadata for one picture (#5478)
* Fix Multi-Upload Wizard only asks Metadata for one picture

* javadoc

* typo

---------

Co-authored-by: shashankkumar <shashankkumar45556@gmail.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-01-26 22:43:07 +09:00
translatewiki.net
5225f3e7f2 Localisation updates from https://translatewiki.net. 2024-01-25 13:03:23 +01:00
Paul Hawke
97a208dcfa
Refactor CSRF token API to move it into the main commons code base (#5472)
* Remove redundent constructor parameter

* Converted the CsrfTokenClient and test to kotlin

* Moved getCsrfTokenCall() out of the data client
2024-01-24 22:15:51 +09:00
Shashank Kumar
e8e87b1d1c
Fix crash upload wizard (#5466)
* Upload Wizard Crash Fix

* Upload Wizard Crash Fix 2

* Fixes

---------

Co-authored-by: shashankkumar <shashankkumar45556@gmail.com>
2024-01-24 18:30:49 +09:00
Paul Hawke
8b8eb84fae
Moved the CSRF token client over into main commons code (#5471) 2024-01-24 10:36:43 +09:00
Kanahia
3d0e65c92c
Fixes on Edit button, there is + sign overlayed over letter E #5388 (#5464)
* Fixed Grey empty screen at Upload wizard caption step after denying files permission

* Empty commit

* Fixed loop issue

* Created docs for earlier commits

* Fixed javadoc

* Fixed spaces

* Added added basic features to OSM Maps

* Added search location feature

* Added filter to Open Street Maps

* Fixed chipGroup in Open Street Maps

* Removed mapBox code

* Removed mapBox's code

* Reformat code

* Reformatted code

* Removed rotation feature to map

* Removed rotation files and Fixed Marker click problem

* Ignored failing tests

* Added voice input feature

* Fixed test cases

* Changed caption and description text

* Replaced mapbox to osmdroid in upload activity

* Fixed Unit Tests

* Made selected marker to be fixed on map

* Changed color of map marker

* Fixes #5439 by capitalizing first letter of voice input

* Made UI changes in UploadMediaDetailAdapter

* Added javadoc

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-01-23 23:03:38 +09:00
Rohit Verma
ab3540312a
Resolve displaced icons problem for small screens sizes (#5467)
* UploadMediaDetailInputFilter: added pattern to identify colon

Added hex code of colon for MediaDetailInputFilter and updated test for it.

* styles.xml: removed color styles for floatingActionButton
2024-01-23 22:59:57 +09:00
Srishti Rohatgi
495d001dc9
Send thanks button in more details fragment (#5424)
* Send thanks button in more details fragment

* failing test fix

* suggested fix
2024-01-23 22:55:16 +09:00
Paul Hawke
3c1cdf18a1
Move notification API into main commons codebase (#5465)
* Moved the notification API calls out of the data client

* Converted the NofificationClient to kotlin and improved its test
2024-01-23 22:43:37 +09:00
translatewiki.net
1948bab873 Localisation updates from https://translatewiki.net. 2024-01-22 13:02:37 +01:00
Paul Hawke
ef47b7025e
Move thanks API into main commons codebase (#5463)
* Move thanks API into main commons codebase

* KDoc

* KDoc

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-01-22 13:57:01 +09:00
Shashwat Kedia
2c086b3d79
Updating nearby banner on slight location change (#5459) 2024-01-21 18:01:16 +09:00
Shashwat Kedia
cbf022d2f2
Resolves #5445 highlighting nearest place on clicking home nearby banner (#5453)
* Highlighted nearest place when user clicks on home nearby banner

* Fixed incorrect behaviour of home nearby banner on being clicked

* Fixing failure of unit test cases

* spacing

* indentation

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-01-19 14:16:36 +09:00
Kanahia
b7323d0913
Fixes #5439 by capitalizing first letter of voice input (#5450) 2024-01-19 13:37:39 +09:00
Nicolas Raoul
1ebbe63fc7
Previous key Commons-GitHub2 key was abused on January 6 2024-01-19 13:10:02 +09:00
translatewiki.net
86608ede54 Localisation updates from https://translatewiki.net. 2024-01-18 13:02:47 +01:00
Kanahia
6319da5445
Replaced mapbox to osmdroid (Upload Activity) (#5443)
* Fixed Grey empty screen at Upload wizard caption step after denying files permission

* Empty commit

* Fixed loop issue

* Created docs for earlier commits

* Fixed javadoc

* Fixed spaces

* Added added basic features to OSM Maps

* Added search location feature

* Added filter to Open Street Maps

* Fixed chipGroup in Open Street Maps

* Removed mapBox code

* Removed mapBox's code

* Reformat code

* Reformatted code

* Removed rotation feature to map

* Removed rotation files and Fixed Marker click problem

* Ignored failing tests

* Added voice input feature

* Fixed test cases

* Changed caption and description text

* Replaced mapbox to osmdroid in upload activity

* Fixed Unit Tests

* Made selected marker to be fixed on map

* Changed color of map marker
2024-01-18 14:28:53 +09:00
Rohit Verma
11e7b1cde7
UploadMediaDetailInputFilter: added pattern to identify colon (#5451)
Added hex code of colon for MediaDetailInputFilter and updated test for it.
2024-01-18 09:23:50 +09:00
Shashwat Kedia
1aa07f9368
Resolves #2307 make achievements activity more visible (#5442)
* Resolves #2307 by adding user level in menu

* Formatted code as requested

* Start sentence with uppercase

* javadoc

* Fixed my typo

* javadoc

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-01-17 15:49:14 +09:00
Paul Hawke
56e21ab7c8
Removed butterknife and cleaned up the test (#5446) 2024-01-17 15:35:14 +09:00
Zen-Miyajima
87d1255323
added icon.png file (#5447)
I added icon.png file to resolve the grey icon issue.
2024-01-17 10:03:11 +09:00
Shashwat Kedia
38b1a014dd
Resolved #5411 by rotating button initially (#5412)
* Resolved #5411 by rotating button initially

* Renamed the image file to arrow_up
2024-01-15 22:02:26 +09:00
Rohit Verma
dd605fba87
Made Nearby Pins More Visible (#5440)
* NearbyParentFragment : added referer

In file NearbyParentFragment.java, I added header property, i.e., the referer - http://maps.wikimedia.org/
and set tile source to wikimedia.

* Reworded comments

* sdkmanager: added installation command for build-tools-30.0.3

* Revert "sdkmanager: added installation command for build-tools-30.0.3"

This reverts commit b3e5019e36.

* Update android.yml

* Update gradle.properties

* android.yml: removed extra debug commands

Removed some debug commands because they are no longer needed.

* ic_custom_map_marker: changed fill color to make it more visible.

Changed fill color for map marker used for nearby places that needs photo.

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-01-15 21:53:51 +09:00
shashankiitbhu
54c7187bba
Peer Review Fix (#5435)
* Peer Review Fix

* Peer Review Fix #2

---------

Co-authored-by: shashankkumar <shashankkumar45556@gmail.com>
2024-01-15 21:40:33 +09:00
translatewiki.net
a16d9f7473 Localisation updates from https://translatewiki.net. 2024-01-15 13:02:38 +01:00
Shashwat Kedia
b3a4e8731e
Resolved issue of dark icons not visible in bottom NavBar and Achievements Fragment (#5410) 2024-01-15 17:02:23 +09:00
Shashwat Kedia
1f738eb7c4
Resolved issue #4513 vertical scrollbar not visible (#5420)
* Resolved issue #4513

* Localisation updates from https://translatewiki.net.

* NearbyParentFragment : added referer (#5417)

* NearbyParentFragment : added referer

In file NearbyParentFragment.java, I added header property, i.e., the referer - http://maps.wikimedia.org/
and set tile source to wikimedia.

* Reworded comments

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Removed butterknife from the quiz result activity (#5425)

* ConnectRefuseError: removed the proxy from properties.gradle file to allow downloading of build tools during CI. (#5434)

* NearbyParentFragment : added referer

In file NearbyParentFragment.java, I added header property, i.e., the referer - http://maps.wikimedia.org/
and set tile source to wikimedia.

* Reworded comments

* sdkmanager: added installation command for build-tools-30.0.3

* Revert "sdkmanager: added installation command for build-tools-30.0.3"

This reverts commit b3e5019e36.

* Update android.yml

* Update gradle.properties

* android.yml: removed extra debug commands

Removed some debug commands because they are no longer needed.

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>

* Removed butterknife and inlined a couple of tiny methods (#5426)

* Resolves #2239 by adding a compass arrow for direction of nearest item (#5433)

* Resolves issue #2239 by adding an arrow for direction

* Removed unnecessary change in styles.xml

* spacing

* javadoc

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>

* Added voice input for caption and description (#5415)

* Fixed Grey empty screen at Upload wizard caption step after denying files permission

* Empty commit

* Fixed loop issue

* Created docs for earlier commits

* Fixed javadoc

* Fixed spaces

* Added added basic features to OSM Maps

* Added search location feature

* Added filter to Open Street Maps

* Fixed chipGroup in Open Street Maps

* Removed mapBox code

* Removed mapBox's code

* Reformat code

* Reformatted code

* Removed rotation feature to map

* Removed rotation files and Fixed Marker click problem

* Ignored failing tests

* Added voice input feature

* Fixed test cases

* Changed caption and description text

---------

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: Rohit Verma <101377978+rohit9625@users.noreply.github.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
Co-authored-by: Paul Hawke <paul.hawke@gmail.com>
Co-authored-by: Kanahia <114223204+kanahia1@users.noreply.github.com>
2024-01-15 16:48:10 +09:00
Priyank Shankar
f2e7c7645c
Fixed bitmap too large issue (#5430) 2024-01-15 15:27:24 +09:00
Kanahia
b7090d90c4
Added voice input for caption and description (#5415)
* Fixed Grey empty screen at Upload wizard caption step after denying files permission

* Empty commit

* Fixed loop issue

* Created docs for earlier commits

* Fixed javadoc

* Fixed spaces

* Added added basic features to OSM Maps

* Added search location feature

* Added filter to Open Street Maps

* Fixed chipGroup in Open Street Maps

* Removed mapBox code

* Removed mapBox's code

* Reformat code

* Reformatted code

* Removed rotation feature to map

* Removed rotation files and Fixed Marker click problem

* Ignored failing tests

* Added voice input feature

* Fixed test cases

* Changed caption and description text
2024-01-15 14:22:25 +09:00
Shashwat Kedia
e5c789e874
Resolves #2239 by adding a compass arrow for direction of nearest item (#5433)
* Resolves issue #2239 by adding an arrow for direction

* Removed unnecessary change in styles.xml

* spacing

* javadoc

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-01-15 13:57:44 +09:00
Paul Hawke
e99ff1c044
Removed butterknife and inlined a couple of tiny methods (#5426) 2024-01-15 11:48:37 +09:00
Rohit Verma
31b7357bdb
ConnectRefuseError: removed the proxy from properties.gradle file to allow downloading of build tools during CI. (#5434)
* NearbyParentFragment : added referer

In file NearbyParentFragment.java, I added header property, i.e., the referer - http://maps.wikimedia.org/
and set tile source to wikimedia.

* Reworded comments

* sdkmanager: added installation command for build-tools-30.0.3

* Revert "sdkmanager: added installation command for build-tools-30.0.3"

This reverts commit b3e5019e36.

* Update android.yml

* Update gradle.properties

* android.yml: removed extra debug commands

Removed some debug commands because they are no longer needed.

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-01-14 21:48:15 +09:00
Paul Hawke
908d3c43a4
Removed butterknife from the quiz result activity (#5425) 2024-01-10 23:03:08 +09:00
translatewiki.net
94b2f891ab Localisation updates from https://translatewiki.net. 2024-01-08 13:02:48 +01:00
translatewiki.net
54ab87013c Localisation updates from https://translatewiki.net. 2024-01-04 13:02:31 +01:00
Rohit Verma
6a70c90643
NearbyParentFragment : added referer (#5417)
* NearbyParentFragment : added referer

In file NearbyParentFragment.java, I added header property, i.e., the referer - http://maps.wikimedia.org/
and set tile source to wikimedia.

* Reworded comments

---------

Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
2024-01-03 22:01:55 +09:00
translatewiki.net
050a06b258 Localisation updates from https://translatewiki.net. 2024-01-01 13:02:52 +01:00
translatewiki.net
4b2d6d3280 Localisation updates from https://translatewiki.net. 2023-12-28 13:02:38 +01:00
translatewiki.net
9a52e7f86a Localisation updates from https://translatewiki.net. 2023-12-25 13:03:08 +01:00
Kanahia
5df18fb4a6
Replaced Mapbox with osmdroid (Nearby activity) (#5403)
* Fixed Grey empty screen at Upload wizard caption step after denying files permission

* Empty commit

* Fixed loop issue

* Created docs for earlier commits

* Fixed javadoc

* Fixed spaces

* Added added basic features to OSM Maps

* Added search location feature

* Added filter to Open Street Maps

* Fixed chipGroup in Open Street Maps

* Removed mapBox code

* Removed mapBox's code

* Reformat code

* Reformatted code

* Removed rotation feature to map

* Removed rotation files and Fixed Marker click problem

* Ignored failing tests
2023-12-24 20:10:39 +09:00
Paul Hawke
3d525d4eb3
Removed butterknife from contributions list fragment (#5396)
* Removed butterknife from contributions list fragment and overhauled its test

* Suggested fix from stack overflow to remove duplicate class error during build
2023-12-23 15:31:10 +09:00
translatewiki.net
8b054926fe Localisation updates from https://translatewiki.net. 2023-12-21 13:02:30 +01:00
Srishti Rohatgi
c818e8b7c2
widget correction (#5402) 2023-12-20 22:48:32 +09:00
translatewiki.net
77dbafaa9b Localisation updates from https://translatewiki.net. 2023-12-18 13:03:00 +01:00
translatewiki.net
26400c930d Localisation updates from https://translatewiki.net. 2023-12-14 13:02:12 +01:00
Ritika Pahwa
d9e41b9d2b
MainActivity.java: resume uploads that got stuck because of app being killed or device being rebooted (#5399) 2023-12-12 22:30:25 +09:00
translatewiki.net
3ae5bb5cd7 Localisation updates from https://translatewiki.net. 2023-12-11 13:02:55 +01:00
translatewiki.net
eef82d04eb Localisation updates from https://translatewiki.net. 2023-12-07 13:03:19 +01:00
translatewiki.net
7e5e17ea9e Localisation updates from https://translatewiki.net. 2023-12-04 13:03:31 +01:00
Srishti Rohatgi
b3c908583e
mapbox token correction (#5398) 2023-12-01 22:04:50 +09:00
translatewiki.net
96431dd01d Localisation updates from https://translatewiki.net. 2023-11-30 13:02:29 +01:00
Pierre Monier
e1e4f9329a
Add background color option for media detail page (#5394)
* feat: add backgroundColor property on media

* feat: add optional menu items for media backgroundColor

* fix: test pass when running in batch

* refactor: remove backgroundColor from media

* refactor: add string for background color menu

* chore: remove useless change

* feat: change media image background color

* feat: pass backgroundColor to ZoomableActivity

* chore: remove extra space
2023-11-30 10:07:53 +09:00
translatewiki.net
9028e0ed32 Localisation updates from https://translatewiki.net. 2023-11-27 13:02:26 +01:00
translatewiki.net
76337454da Localisation updates from https://translatewiki.net. 2023-11-23 13:03:03 +01:00
Srishti Rohatgi
2dafc0d2ad
moves mapbox token inside gradle.properties (#5392) 2023-11-22 23:34:38 +09:00
translatewiki.net
e7b15b1160 Localisation updates from https://translatewiki.net. 2023-11-20 13:03:11 +01:00
u7469570
60764f6f73
#3101: Add image upload limit of 20 to custom selector (#5369)
* Add basic image limit warning to custom selector

* Block upload button when image limit is exceeded

* Complete basic functionality for upload limit: Disabled button, warning sign & toast

* Consolidate functionality between upload limit and not for upload marking

* Upload Limit: write unit tests and optimize control flow

* Upload Limit Tests: improve logic coverage and alter to stay valid if limit is changed

* Upload Limit: polish javadocs and add explanation to warning toast.

* Upload Limit: refactor variable names

* Upload Limit: change warning toast to dialog box, repurposing welcome dialog code & layout

* Upload Limit: remove error icon when the mark as not for upload button is pressed
2023-11-20 18:13:05 +09:00
Paul Hawke
3118a8368b
Removed butterknife from quiz activity (#5383) 2023-11-20 17:48:22 +09:00
Ritika Pahwa
d967279abc
UploadActivity: fix multi-upload bugs (#5389) 2023-11-20 17:46:32 +09:00
translatewiki.net
a85decd2cd Localisation updates from https://translatewiki.net. 2023-11-16 13:02:57 +01:00
translatewiki.net
d87f7dec3c Localisation updates from https://translatewiki.net. 2023-11-13 13:03:19 +01:00
Nicolas Raoul
8be5526b7a
new disposable Mapbox token 2023-11-13 12:11:35 +09:00
Paul Hawke
5e35db159d
Remove butterknife from achievements fragment (#5382)
* Replace butterknife view bindings

* Migrated onClick listeners, and removed Butterknife
2023-11-12 14:39:59 +09:00
Paul Hawke
861d2b9bf6
Removed butterknife from login activity (#5380)
* Removed butterknife view bindings

* Migrated click listeners to view binding

* Migrate onEditorAction to use ViewBinding

* Finally, removed butterknife
2023-11-11 22:54:08 +09:00
Paul Hawke
9620f6eee0
Replaced Butterknife with Viewbinding, and dealt the a whole bunch of code quality warnings (#5379) 2023-11-10 23:03:12 +09:00
translatewiki.net
b113f3c986 Localisation updates from https://translatewiki.net. 2023-11-09 13:02:57 +01:00
Srishti Rohatgi
2ab100d99f
fixes wrong string translation in french (#5376) 2023-11-07 22:46:10 +09:00
Nicolas Raoul
c901140796
Replaced with disposable token "Commons-GitHub", please replace with former token when releasing 2023-11-07 11:23:06 +09:00
translatewiki.net
327541c7b1 Localisation updates from https://translatewiki.net. 2023-11-06 13:02:54 +01:00
translatewiki.net
fb166b52ec Localisation updates from https://translatewiki.net. 2023-11-02 13:02:53 +01:00
Kanahia
187872114c
Fixed Grey empty screen at Upload wizard (#5356)
* Fixed Grey empty screen at Upload wizard caption step after denying files permission

* Empty commit

* Fixed loop issue

* Created docs for earlier commits

* Fixed javadoc

* Fixed spaces
2023-11-02 10:19:47 +09:00
HNYDDDTONY-ANU
6f96e8959b
Fixes #5344 Some categories hidden at top of Upload Wizard suggestions, need to manually scroll up (#5370)
* Fix Issue #5344

* fix update Issue #5344

* Add Comment
2023-11-01 22:25:07 +09:00
translatewiki.net
b7913fa027 Localisation updates from https://translatewiki.net. 2023-10-30 13:02:43 +01:00
Ritika Pahwa
39a2fbe3d5
ensure that cancelled uploads are really getting cancelled (#5367) 2023-10-29 23:21:16 +09:00
translatewiki.net
6166fde7cd Localisation updates from https://translatewiki.net. 2023-10-26 13:03:03 +02:00
Kaartic Sivaraam
14b6c455bf Version v4.2.1 2023-10-25 23:29:06 +05:30
Priyank Shankar
2ddb6b2e5e
[WIP]Lossless Transformations(Rotate feature) (#5252)
* UI setup for the crop feature almost setup

* basic setup of rotate feature done

* Added basic changes for editing feature

* Getting data back from edit activity

* Getting data back from edit activity

* Updated contentUri

* Finally the rotated image is getting uploaded

* Minor Improvements for better testing

* Fixed thumbnail preview

* Fixed loss of exif data

* Copy exif data

* Save exif data

* Added java docs

* Minor fix

* Added Javadoc

* Refactoring

* Formatting fixes

* Minor Formatting Fix

* Fix unit test

* Add test coverage

* Formatting fixes

* Formatting Fixes

---------

Co-authored-by: Priyank Shankar <priyankshankar@changejar.in>
2023-10-24 13:04:21 +09:00
translatewiki.net
6b8954b4a9 Localisation updates from https://translatewiki.net. 2023-10-23 13:03:01 +02:00
Shin0017
6c14163c66
checks items length (#5360)
* checks items length

* Update UploadMediaPresenter.java

* Update UploadMediaPresenter.java

* Update UploadMediaPresenter.java
2023-10-23 11:09:45 +09:00
Zhiyuan Xu
57d7159ee0
Update the SoLoader SDK version (#5361) 2023-10-22 22:15:41 +09:00
Kaartic Sivaraam
c086ff264f
app: avoid R8 from obfuscating our model classes (#5359)
R8 shouldn't obfuscate the classes that we use for serialization /
de-serialization over Gson. This causes issues with app functioning.

Fixes #5358
2023-10-22 14:42:26 +09:00
Nicolas Raoul
1490710a51 Merge branch 'v4.2.0-release' 2023-10-20 13:51:30 +09:00
Nicolas Raoul
d4917b5455 Switch Mapbox account from Vivek to Nicolas 2023-10-20 12:05:02 +09:00
Srishti Rohatgi
c9dfc03a20
fixes unit tests (#5354)
* fixes unit tests

* fixes failing unit tests
2023-10-20 11:50:51 +09:00
translatewiki.net
af581612f6 Localisation updates from https://translatewiki.net. 2023-10-19 13:02:52 +02:00
Nicolas Raoul
04aec20fc9
Switch Mapbox account from Vivek to Nicolas 2023-10-19 17:27:20 +09:00
Tai Ha
988b83dc32
Fix #5212: removing bug causing progress dialog to load forever (#5350)
* Fixes bug causing the progress dialog to load forever (#5212)

* Fixes bug causing the progress dialog to load forever (#5212)

* remove unnecessary new line (#5212)
2023-10-19 16:20:28 +09:00
Alvin Tang
f7164d0b78
Fix #5246: map icon in Upload Wizard indicating if location is included in the EXIF data (#5343)
* Add XML map icons with a tick/question mark for the Upload Wizard
The existing map icon may not be intuitive enough to indicate
whether the location EXIF data will be included
The two new XML map icons are intended to indicate the status of
location sharing with the location data in the Upload Wizard

* Label the map icon in the Upload Wizard if location is included
If an image is capture with the in-app camera, the location in the
image metadata by default
If so, the map icon in the Upload Wizard should be labelled with
a green tick during initialisation of its UploadMediaDetailFragment instance

* Update the map icon in Upload Wizard if location is pin-pointed
If the user selects images from the device storage
to upload, the location EXIF data might originally not be included
The map icon is labelled with a red question mark
After pin-pointing the location manully, the map icon should be
labelled with a green tick instead

* Fix Upload Wizard map icon XML rendering failure
SVG path is invalid, resulting in failure to render the icons
Also imports are required for UploadMediaDetailFragment to
use Drawable objects and R objects

* Add hasLocation() to UploadableFile to indicate existence of EXIF
When an image is chosen from the album to the Upload Wizard,
its EXIF might contain location data. hasLocation() and fix of init()
in UploadMediaDetailFragment ensures that the map icon is shown
correctly

* Fix init() NullPointerException in UploadMediaDetailFragment

* Fix comment typo in UploadMediaDetailFragment
Fix the comment about red and green labels for the map icon

* Use SLF4J logging for try-catch clauses in UploadableFile class
Instead of using printStackTrace(), error directed to logcat

* Use Timber for logging in UploadableFile
Clean up the catch clause in hasLocation() and getDataTimeFromExif()
2023-10-18 22:42:01 +09:00
Srishti Rohatgi
64652b987d
fixes blank screen decrepancy when sharing items from external apps (#5345)
* fixes blank screen decrepancy when sharing items from external apps

* reverts comment removal
2023-10-18 12:16:33 +09:00
JiaYuan Huang
f13085147f
5338 bug fix (#5340)
* fix Bug index out bound

* fix Bug index out bound

* fix Bug index out bound

* fix Bug index out bound

* add some comments for that

* add some comments for that

* add some comments for that

* add some comments for that
2023-10-17 14:50:24 +09:00
Kaartic Sivaraam
26eaa4650d Merge branch 'siva/gradle-version-upgrade' into v4.2.0-release 2023-10-17 07:58:37 +05:30
Kaartic Sivaraam
870d138d11 Empty commit to enable merge 2023-10-17 07:55:04 +05:30
translatewiki.net
f06dedaebc Localisation updates from https://translatewiki.net. 2023-10-16 13:03:39 +02:00
Kaartic Sivaraam
e5e3a6b875 Upgrade robolectric to fix unit tests
This is as per the observation of Nicolas Raoul in the MR. He mentions
this brings down test failures to just 5.

Ref: https://github.com/commons-app/apps-android-commons/pull/5220#issuecomment-1722425627
2023-10-16 00:28:09 +05:30
Kaartic Sivaraam
eae3e312e4 Disable full mode R8 optimizations
Full mode R8 configurations are hindering the working of the app severly.
So, disable the same.

Also, ensure the POJO classes used to hold the API responses aren't optimized
so that we could use the response properly without any issues.
2023-10-16 00:14:21 +05:30
translatewiki.net
8553a96358 Localisation updates from https://translatewiki.net. 2023-10-12 13:03:03 +02:00
Srishti Rohatgi
a708c811d6
fixes image retention when no network is available (#5335) 2023-10-10 23:00:17 +09:00
Srishti Rohatgi
b18bc8ff4b
fixes popup message title and description on cancelling uploading image (#5334) 2023-10-10 22:21:15 +09:00
Srishti Rohatgi
0d90ac3c53
Tick icon in place of number of images selected in custom picker (#5331)
* tick in place of number of images selected in custom picker

* fixes tests, dark mode visibility, bold tick icon for better visibility
2023-10-09 23:08:00 +09:00
translatewiki.net
f69ecde713 Localisation updates from https://translatewiki.net. 2023-10-09 13:03:04 +02:00
Srishti Rohatgi
733c8709fc
Makes depicted place and category items unselectable for nearby place (#5325)
* Makes depicted place and category items unselectable for nearby place

* UploadCategoriesFragmentUnitTests.kt fixes and javadoc addition

* comment fix

* Fixes tests and hidden category appearing and dissapearing issue
2023-10-08 18:26:27 +09:00
Dean Stirrat
05fbfce865
check for exact category match on upload search (#5328) 2023-10-07 22:30:27 +09:00
Srishti Rohatgi
048b78a03a
Fixes location issue in upload wizard (#5329)
* Fixes location issue in upload wizard

* Fixes blue dot disappearance on first install
2023-10-07 22:07:08 +09:00
Srishti Rohatgi
8aee7a680d
Fixes copy to subsequent media functionality for nearby uploaded images (#5326) 2023-10-07 07:10:28 +09:00
translatewiki.net
fd6ba00fbd Localisation updates from https://translatewiki.net. 2023-10-05 13:03:16 +02:00
Kaartic Sivaraam
a629756f3a Retain siva's comment about disabling force = true 2023-10-04 06:56:52 +05:30
Kaartic Sivaraam
62661604ff Merge commit 'refs/pull/5220/head' of github.com:commons-app/apps-android-commons into new-tools 2023-10-04 06:54:48 +05:30
Aryan Arora
373c6201bd
Show progress dialog on mark/unmark photos not for upload (#5322) 2023-10-03 23:17:29 +09:00
Kaartic Sivaraam
b314fe1896 Version v4.2.0 2023-10-03 10:20:21 +05:30
translatewiki.net
ee78ceaa28 Localisation updates from https://translatewiki.net. 2023-10-02 13:02:51 +02:00
Srishti Rohatgi
f7e6d30499
fixes copy option not appearing for multi asset upload (#5320) 2023-10-01 19:08:36 +09:00
Ayan Sarkar
fec27ed914
Fixes 4745 : Add bookmarked items to suggested depictions (#4746)
* Dialog can't be dismissed

* Dialog can't be dismissed

* Appended bookmarked items in searching

* Test fixed

* Resolve conflicts

* Resolve conflicts
2023-09-29 15:55:26 +09:00
Srishti Rohatgi
9525409b9b
fixes issues related to location permission denial even when allowed inside in-app camera flow (#5313)
* fixes issues related to location permission denial even when allowed inside in-app camera flow

* fixes related to in app camera location permissions
2023-09-28 23:07:28 +09:00
translatewiki.net
8d604a25fa Localisation updates from https://translatewiki.net. 2023-09-28 13:02:44 +02:00
Srishti Rohatgi
a2ad0394ce
fixes crash in sign up activity in api 21 and 22 (#5311)
* fixes crash in sign up activity

* javadoc comments added
2023-09-26 16:14:41 +09:00
Zeeshan Alam
19733b3e69
bug fix 5240 (#5292)
* bug fix 5240

Signed-off-by: Zeeshan Alam <zeeshan.alam@fmr.com>

* Incorporated review comments. Remove method MediaDetailPagerFragment.newInstance(false, false, 0) which was called only in unit test

* Added Required empty public constructor

---------

Signed-off-by: Zeeshan Alam <zeeshan.alam@fmr.com>
2023-09-25 21:42:40 +05:30
Ritika Pahwa
2282ce3d02
5195: Fix upload wizard crash on tapping target icon (#5306)
* LocationPickerActivity: fix crash on setting location for pictures with no EXIF location

* strings.xml: remove extra string introduced

* optimise constants

* LocationPickerActivity: request for permission only on tapping target icon

* remove newline

* handle location permissions using LocationPermissionsHelper

* add null check to prevent crash
2023-09-25 17:00:46 +09:00
Srishti Rohatgi
70f8256565
Night mode color contrast fix (#5307)
* Fixes dark mode color contrast fix

* fixes text color contrast on app-level dark mode settings
2023-09-25 16:24:46 +09:00
Srishti Rohatgi
2fc8527330
Fixes in-app camera behaviour (#5302) 2023-09-25 09:52:42 +09:00
Srishti Rohatgi
ff7fa79af1
Fixes dark mode color contrast fix (#5304) 2023-09-24 22:13:52 +09:00
Ritika Pahwa
4caa8a509b
5195: Fix crash on setting location for pictures with no EXIF location (#5205)
* LocationPickerActivity: fix crash on setting location for pictures with no EXIF location

* strings.xml: remove extra string introduced

* optimise constants

* LocationPickerActivity: request for permission only on tapping target icon

* remove newline

* handle location permissions using LocationPermissionsHelper
2023-09-24 09:31:57 +09:00
Srishti Rohatgi
6881158743
Android 13 permission related fixes (#5299)
* Android 13 permission related fixes

* removes audio and video as permissions
2023-09-22 09:39:28 +09:00
Ritika Pahwa
f5770539a5
target the latest Android version (#5296) 2023-09-19 20:16:35 +09:00
Ritika Pahwa
81030d1e78
5136: Fix retried uploads stuck in queued state (#5272)
* fix stuck uploads

* automate retries for failed uploads once the user returns to the app

* UploadWorker: modify PendingIntent flag and Android version code

* MainActivity: remove automatic retry logic

* Revert "MainActivity: remove automatic retry logic"

* set work request as expedited

* handle notification for foreground service on older versions of Android

* set backoff criteria for work requests

* enqueue failed uploads for a retry

* revert "enqueue failed uploads for a retry"

* limit the number of retries for a failed upload

* add a popup that suggests users to switch to unrestricted battery usage mode

* take users to the battery settings page on the first big upload

* take users to battery optimisation settings page using the standard intent

* add instructions to the battery optimisation settings popup

* remove the first usage of fr.free.nrw.commons from the popup

* comply with the wording in the OS settings

* modify battery optimisation popup instructions, add comments and rename firstBigUploadSet

* add filename to the retry log statement

* update database version

* make battery optimisation dialog appear only on Android 6 and above

* use foreground service instead of setting work request as expedited

* fix retried uploads stuck in queued state

* use MIN_BACKOFF_MILLIS constant instead of using the number 10 and add comments

* factorise the creation of the new OneTimeWorkRequest at one place

* ensure work requests are in accordance with the unit tests

* forbid retries for images which have got uploaded without caption

* add a TODO for the suggestion related to retries

* revert "forbid retries for images which have got uploaded without caption"
2023-09-09 22:46:13 +05:30
Kaartic Sivaraam
4540f54d59
Fix document picker trigger bug (#5275)
* Revert "Revert a1b6973 until we find out why it uses OPEN_DOCUMENT by default on fresh install"

This reverts commit 7ce3b7ebb1.

* Potential fix for get_content picker being used in first run

The initial state of the 'openDocumentPhotoPickerPref' seems to be incorrect
during a fresh install on some devices.

Try to ensure we always use the proper initial state by propagating the default
to the preference access code.

This hopefully fixes #5274
2023-09-04 11:18:58 +09:00
Nicolas Raoul
7ce3b7ebb1 Revert a1b6973 until we find out why it uses OPEN_DOCUMENT by default on fresh install 2023-09-03 23:28:02 +09:00
Ritika Pahwa
5073ca08c3
5196: Fix in-app camera location loss (#5249)
Merging as this is a great improvement, additional issues/bugs can be filed as GitHub issues.

* fix in-app camera location loss

* fix failing unit tests

* UploadMediaDetailFragmentUnitTest: modify testOnActivityResultAddLocationDialog to have null location

* reintroduce removed variable

* enable prePopulateCategoriesAndDepictionsBy for current user location

* add relevant comment and fix failing test

* modify dialog and disable location tag redaction from EXIF

* modify in-app camera dialog flow and change location to inAppPictureLocation

* change location to inAppPictureLocation

* fix location flow

* preferences.xml: remove redundant default value

* inform users about location loss happening for first upload

* FileProcessor.kt: remove commented-out code

* prevent user location from getting attached to images with no EXIF location in normal and custom selector

* handle onPermissionDenied for location permission

* remove last location when the user turns the GPS off

* disable photo picker and in app camera preferences in settings for logged-out users

* remove debug statements and add toast inside runnables
2023-09-01 15:45:50 +09:00
translatewiki.net
1cab938d81 Localisation updates from https://translatewiki.net. 2023-08-31 13:02:53 +02:00
translatewiki.net
dc608ed8f5 Localisation updates from https://translatewiki.net. 2023-08-28 13:04:14 +02:00
translatewiki.net
f561b2c199 Localisation updates from https://translatewiki.net. 2023-08-24 13:03:20 +02:00
translatewiki.net
9d5deed58f Localisation updates from https://translatewiki.net. 2023-08-21 13:02:20 +02:00
translatewiki.net
a620cc9de6 Localisation updates from https://translatewiki.net. 2023-08-17 13:03:15 +02:00
translatewiki.net
07f7b7e0a2 Localisation updates from https://translatewiki.net. 2023-08-14 13:03:22 +02:00
Matija Nalis
d2cd6df3ca
use correct geo: URI format (#5268)
(like OsmAnd, StreetComplete etc do), which works with all apps, and not only some.
2023-08-11 07:44:06 +09:00
translatewiki.net
4ec08e8325 Localisation updates from https://translatewiki.net. 2023-08-10 13:06:31 +02:00
translatewiki.net
bb2c1b0ba1 Localisation updates from https://translatewiki.net. 2023-08-07 13:02:08 +02:00
translatewiki.net
3ddd8448e8 Localisation updates from https://translatewiki.net. 2023-08-03 13:02:15 +02:00
translatewiki.net
0a9b431846 Localisation updates from https://translatewiki.net. 2023-07-31 13:02:22 +02:00
translatewiki.net
9e0c95172f Localisation updates from https://translatewiki.net. 2023-07-27 13:04:37 +02:00
Jean-Baptiste
7db72f90f4
Bump actions (#5229) 2023-07-25 17:53:24 +09:00
Kaartic Sivaraam
a1b6973614
Toggle photo picker switch behaviour and tweak phrases (#5250)
* photo picker: toggle behaviour of switch and adjust phrasing for better UX

The enable state used to trigger the GET_CONTENT intent. Alter the flow
such that the GET_CONTENT intent is triggered when switch is disabled.
Adjust default value and other parts of code naming to reflect this.

The existing phrasing had a lot of tech jargon in it which could
result in the non-technical users being confused. Tweak the phrasing
to avoid such phrases.

The documentation in the website could also use some follow up
improvements.

* Adjust strings to clearly convey that location loss is a "risk"
2023-07-25 17:48:53 +09:00
translatewiki.net
8a9aa962bc Localisation updates from https://translatewiki.net. 2023-07-24 13:02:46 +02:00
paco-arana
3f529e674f
Removed comma separator (#5261)
* Removed comma separator from file descriptions

* Removed a redundant line that deleted the last comma of the descriptions

* Added a line to formatDescriptions that replaces every instance of "}}, " with "}}" to remove the comma between descriptions.

* Specified separator as an empty string instead of default value ", " for .joinToString method. Deleted previous fix using .replace method.

* Restored buffer.replace() in updateDescription
2023-07-20 23:14:21 +09:00
translatewiki.net
cdb2e4278c Localisation updates from https://translatewiki.net. 2023-07-20 13:01:53 +02:00
translatewiki.net
d75f693435 Localisation updates from https://translatewiki.net. 2023-07-17 13:02:16 +02:00
translatewiki.net
b86a92ad11 Localisation updates from https://translatewiki.net. 2023-07-13 13:02:46 +02:00
translatewiki.net
0b25c07fcd Localisation updates from https://translatewiki.net. 2023-07-10 13:04:12 +02:00
Kaartic Sivaraam
ff09c3487f
Try fixing pipeline after Gradle build changes 2023-07-08 23:49:55 +05:30
translatewiki.net
5c0ed12491 Localisation updates from https://translatewiki.net. 2023-07-06 13:03:21 +02:00
AnkitThakur98
2593f4e1b6
Replaced junit.framework with org.junit (#5253) 2023-07-06 14:25:49 +09:00
Alfusainey Jallow
368e1c753d
Fix resource leak bug (#5251)
Signed-off-by: Alfusainey Jallow <alf.jallow@gmail.com>
2023-07-06 00:20:46 +05:30
translatewiki.net
532e5375c2 Localisation updates from https://translatewiki.net. 2023-07-03 13:02:59 +02:00
translatewiki.net
a4ef6bb3d3 Localisation updates from https://translatewiki.net. 2023-06-29 13:02:50 +02:00
translatewiki.net
fffb2ab175 Localisation updates from https://translatewiki.net. 2023-06-26 13:02:41 +02:00
Siva Subramaniam
1911b8b957 upgrade AGP to 8.0.2, enable gradle build cache and change java version to 17 in github workflow 2023-06-26 12:56:40 +05:30
Siva Subramaniam
c4d4cbeae2 Merge branch 'master' of https://github.com/siva-subramaniam-v/apps-android-commons into gradle-version-upgrade 2023-06-26 12:15:38 +05:30
translatewiki.net
95b4c3be82 Localisation updates from https://translatewiki.net. 2023-06-22 13:04:03 +02:00
Matija Nalis
b1a272ef49
allow running GitHub workflow manually (#5248) 2023-06-22 09:55:44 +05:30
Kaartic Sivaraam
f4e8de79fb
nearby: make sure places is initialized (#5241)
On taking a look at the following stack trace:

  java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
  at fr.free.nrw.commons.nearby.fragments.NearbyParentFragment.updatePlaceList(NearbyParentFragment.java:777)
  at fr.free.nrw.commons.nearby.fragments.NearbyParentFragment.lambda$initFilterChips$10$NearbyParentFragment(NearbyParentFragment.java:730)
  at fr.free.nrw.commons.nearby.fragments.-$$Lambda$NearbyParentFragment$AGol6SoJlvIYd45Vbz6tTjDiWU4.onCheckedChanged(Unknown Source:2)
  at android.widget.CompoundButton.setChecked(CompoundButton.java:235)
  at com.google.android.material.chip.Chip.setChecked(Chip.java:665)
  at android.widget.CompoundButton.toggle(CompoundButton.java:150)
  ...

... it seems clear the 'places' list is trying to be iterated
in the updatePlaceList method when it is empty. This is resulting
in an NPE and consequently an app crash.

Avoid the same by ensuring it is always initialized to an empty list.
2023-06-19 20:23:20 +09:00
translatewiki.net
00b69c6731 Localisation updates from https://translatewiki.net. 2023-06-19 13:01:47 +02:00
Ritika Pahwa
4a9101c614
FilePickerTest: fix failing unit test (#5237) 2023-06-16 19:41:07 +09:00
Kaartic Sivaraam
4cb3b0cfe9
Reduce minSdk back to 21 (#5236)
Commit 0f0358f22 (Bump minSdk to 29, 2023-04-30) bumped the minSdk to
29 since it was found to be necessary for publishing the app to Play
Store.

On futher analysis[1], it seems like that might actually not be necessary.
The crux is:

  1. We (rightly) answer "No" to the Play Console question:

       "Does your app access location in the background in APKs or
        app bundles targeting Android 9 (Pie) or older (SDK level 28 or lower)?"

  2. We do not request for the ACCESS_BACKGROUND_LOCATION permission.

So, it should be safe for us to have the minSdkVersion as 21 itself. If
again we face any rejection of the app update, let us handle it at that
point. I clearly am not able to see any valid reason for Play store to
reject the app update.

[1]: https://github.com/commons-app/apps-android-commons/issues/5223#issuecomment-1569554999

Co-authored-by: Kaartic Sivaraam <kaartic.sn@zohocorp.com>
2023-06-16 15:52:15 +09:00
translatewiki.net
231b96d00e Localisation updates from https://translatewiki.net. 2023-06-15 13:04:03 +02:00
Ritika Pahwa
9a0f35c681
5196: Fix location stripped from EXIF metadata (#5227)
* MainActivity: add ACCESS_MEDIA_LOCATION permission check to retain location info in EXIF metadata

* remove redundant permission check and optimise imports

* FilePicker: switch to ACTION_OPEN_DOCUMENT intent for opening image files

* add a comment explaining the change

* implement GET_CONTENT photo picker toggle switch

* add location loss warning pop up

* SettingsFragment: modify the comment about GET_CONTENT takeover for more clarity
2023-06-15 10:05:55 +09:00
translatewiki.net
4d71c305f2 Localisation updates from https://translatewiki.net. 2023-06-12 13:11:57 +02:00
translatewiki.net
40f3e7fa7c Localisation updates from https://translatewiki.net. 2023-06-08 13:01:52 +02:00
tpettwa1
3f664d62f8
Added changes to readme.md + comments. (#5230)
* Update README.md

* Update LatLng.java

* Update LoginActivity.java

* Updated LoginActivity.java to feature javadoc syntax
2023-06-07 10:31:53 +09:00
translatewiki.net
cbc54c71d9 Localisation updates from https://translatewiki.net. 2023-06-05 13:01:39 +02:00
translatewiki.net
81fcc7bc0a Localisation updates from https://translatewiki.net. 2023-06-01 13:02:16 +02:00
translatewiki.net
55ce4c2515 Localisation updates from https://translatewiki.net. 2023-05-29 13:01:54 +02:00
translatewiki.net
e9b5bb8e7a Localisation updates from https://translatewiki.net. 2023-05-25 13:02:07 +02:00
translatewiki.net
4f1764fa12 Localisation updates from https://translatewiki.net. 2023-05-22 13:01:51 +02:00
translatewiki.net
d8cc62b8bc Localisation updates from https://translatewiki.net. 2023-05-18 13:02:02 +02:00
translatewiki.net
e5e07b64cc Localisation updates from https://translatewiki.net. 2023-05-15 13:01:45 +02:00
translatewiki.net
05de0c9454 Localisation updates from https://translatewiki.net. 2023-05-11 13:08:58 +02:00
translatewiki.net
955cbc96c4 Localisation updates from https://translatewiki.net. 2023-05-08 13:02:43 +02:00
Siva Subramaniam
a280f79f36 remove redundant comment in module level build.gradle file 2023-05-03 11:50:08 +05:30
Siva Subramaniam
368701ec59 fixes #5208: gradle build fails with android studio flamingo update 2023-05-03 11:12:28 +05:30
translatewiki.net
0460a8c4e1 Localisation updates from https://translatewiki.net. 2023-05-01 13:01:58 +02:00
Kaartic Sivaraam
1649d1e2ce Changelog for v4.1.0
Gathered the significant release note entries by going through the commits.
2023-04-30 19:07:32 +05:30
Kaartic Sivaraam
61e2a7177b Versioning for v4.1.0
We bump the version code directly to 1034 since v4.0.4 and v4.0.5 took
up the codes b/w 1029 and 1034.
2023-04-30 19:07:31 +05:30
Kaartic Sivaraam
9e1752dfe1 CHANGELOG: incorporate changelog for v4.0.4 and v4.0.5 from 4.0-release branch
Corresponding commits:

- 8053188fc (Added note for v4.0.5, 2022-08-23)
- f03b7dd8d (Changelog for v4.0.5, 2022-08-22)
- ef34302e6 (Changelog for v4.0.4, 2022-08-16)
2023-04-30 19:07:29 +05:30
Kaartic Sivaraam
0f0358f227 Bump minSdk to 29
A replication of the fix done in 9b9521a03 (Update min SDK to 29, 2022-08-22)
to temporarily address #5031.

We're replicating this rather than merging the 4.0-release branch since
merging results in multiple merge conflicts that are non-trivial to
resolve.

We need to find a proper fix for the play store issue, though.
2023-04-30 19:07:00 +05:30
translatewiki.net
48e4c40ce3 Localisation updates from https://translatewiki.net. 2023-04-27 13:02:23 +02:00
translatewiki.net
9d0614e734 Localisation updates from https://translatewiki.net. 2023-04-24 13:02:39 +02:00
Kaartic Sivaraam
7568883e02
Avoid ambiguity in a string (#5210)
The phrase "Is this a photo of Place ...?" when placed along with an actual place
name could get confusing. For instance, "Is this a photo of Place More London?"

The casing of "Place" is especially confusing. So, tweak the phrase to avoid
this ambiguity.

Co-authored-by: Kaartic Sivaraam <kaartic.sn@zohocorp.com>
2023-04-18 15:09:18 +09:00
Ritika Pahwa
a116a17e7b
5204: Fix unit test UploadMediaPresenterTest.handleImageResult (#5206)
* UploadMediaPresenterTest: fix failing unit tests

* change else if to if condition to handle all cases

* include errorCodes 68 for duplicate image and 96 for image without exif

* optimise if statements

* remove redundant cases

* modify if statements to cover all cases

* simplify all if statements

* add removed comment again

* remove unused imports
2023-04-18 15:01:20 +09:00
translatewiki.net
2c7f2d05cd Localisation updates from https://translatewiki.net. 2023-04-17 13:01:39 +02:00
Ritika Pahwa
68ddcf0bc6
ReviewImageFragment: fix disappearing author name on changing orientation (#5209) 2023-04-16 23:21:11 +05:30
José Arias Canto
013809f46a
Fixes #5187: Fix App crashes when you click on Author Name (#5199)
* Add conditional on function onAuthorViewClicked for when there's not logged-in user

* Change media.getAuthor() for media.getUser()

* Change hardcoded URL for one given by the BuildConfig object
2023-04-13 19:59:50 +09:00
translatewiki.net
9fb13395f6 Localisation updates from https://translatewiki.net. 2023-04-10 13:02:19 +02:00
Nicolas Raoul
1af3297ae3 Disabled failing unit test as a temporary measure 2023-04-09 19:22:17 +09:00
translatewiki.net
67d2e7f1ab Localisation updates from https://translatewiki.net. 2023-04-06 13:02:51 +02:00
Ritika Pahwa
cf35307d9a
add constants file for map styles used across various fragments (#5200) 2023-04-05 16:05:05 +09:00
Priyank Shankar
07616485ae
Enable support toolbar for ProfileActivity and added a couple of unit… (#5188)
* Enable support toolbar for ProfileActivity and added a couple of unit tests

* Nit fixes

* Nit Fixes

* Minor styling changes in ContributionsFragment
2023-04-03 16:02:16 +09:00
Priyank Shankar
fc672dbd9b
Fixed #5181 Misleading warning title for duplicate file name (#5185)
* Added a string resource and changed the title of alertbox showDuplicatePicturePopup

* Removed duplicate_image_found from strings.xml as it is unused
2023-04-03 15:27:29 +09:00
Arman Navodia
92ecd61b6f
fixing: Duplicate filename notification completely replaces image-found-on-internet warning #5180 (#5192) 2023-04-03 15:08:24 +09:00
Ritika Pahwa
a5a65fc1ee
5191: Fix UI elements not conforming to dark mode (#5193)
* feedback dialog: fix black font in dark mode

* LocationPickerActivity: fix light map in dark mode

* Fix #5182 Switch From Mapbox to MapLibre (#5184)

* Fix #5182 Switch From Mapbox to MapLibre

* Fix #5182 Switch From Mapbox to MapLibre - Resolved requestFeature() issue

* Fix #5182 Switch From Mapbox to MapLibre - Resolved dark mode issue on two screens

* Fix #5182 Switch From Mapbox to MapLibre - Resolved dark mode issue on additional screens

* Fix #5182 Switch From Mapbox to MapLibre - Resolved dark mode issue on notification screen

* Fix #5182 Switch From Mapbox to MapLibre - Test errors

* fix issue #5015 - custom image selector not identifying photo location (#5190)

Co-authored-by: Siva <doodsiva@gmail.com>

* feedback dialog: fix black font in dark mode

* LocationPickerActivity: fix light map in dark mode

* LocationPicker: use predefined style based on device theme

* LocationPickerActivityTest: add additional target exception in catch block

* LocationPickerConstants: remove extra newline introduced

---------

Co-authored-by: Kartikay Kaushik <93285364+kartikaykaushik14@users.noreply.github.com>
Co-authored-by: Siva Subramaniam <112970189+siva-subramaniam-v@users.noreply.github.com>
Co-authored-by: Siva <doodsiva@gmail.com>
2023-04-03 14:27:52 +09:00
Siva Subramaniam
0f1e526326
fix issue #5015 - custom image selector not identifying photo location (#5190)
Co-authored-by: Siva <doodsiva@gmail.com>
2023-03-31 12:21:07 +09:00
Kartikay Kaushik
8f8dcc0d52
Fix #5182 Switch From Mapbox to MapLibre (#5184)
* Fix #5182 Switch From Mapbox to MapLibre

* Fix #5182 Switch From Mapbox to MapLibre - Resolved requestFeature() issue

* Fix #5182 Switch From Mapbox to MapLibre - Resolved dark mode issue on two screens

* Fix #5182 Switch From Mapbox to MapLibre - Resolved dark mode issue on additional screens

* Fix #5182 Switch From Mapbox to MapLibre - Resolved dark mode issue on notification screen

* Fix #5182 Switch From Mapbox to MapLibre - Test errors
2023-03-31 09:31:58 +09:00
translatewiki.net
2989b73dee Localisation updates from https://translatewiki.net. 2023-03-30 13:02:07 +02:00
translatewiki.net
553c55b127 Localisation updates from https://translatewiki.net. 2023-03-27 17:30:06 +02:00
Manuel Cota
d1af26c8a8
Fix: user reset for Thanks screen (#5183)
Removed previous if statement. If the app is rotated, the Thanks message will disappear, but the username gets a reset for each new image reviewed.
2023-03-24 15:58:59 +09:00
translatewiki.net
4e50e6c76e Localisation updates from https://translatewiki.net. 2023-03-23 13:02:35 +01:00
translatewiki.net
f1f39a1946 Localisation updates from https://translatewiki.net. 2023-03-20 13:02:58 +01:00
translatewiki.net
9722628184 Localisation updates from https://translatewiki.net. 2023-03-16 13:02:14 +01:00
Kartikay Kaushik
c7ee38e578
Fix:5158 Upgraded Kotlin Version from 1.5.10 to 1.7.20 (#5164)
* Kotlin Version Upgraded to 1.6.10

* Kotlin Version Upgraded to 1.6.20

* Kotlin Version Upgraded to 1.7.20

* Fix:5175 Upgraded Minimum SDK Version, Compile and Target SDK Version
2023-03-16 18:12:20 +09:00
Kartikay Kaushik
9b0b936c62
Fix:5175 Upgraded Minimum SDK Version, Compile and Target SDK Version (#5177)
* Kotlin Version Upgraded to 1.6.10

* Kotlin Version Upgraded to 1.6.20

* Kotlin Version Upgraded to 1.7.20

* Fix:5175 Upgraded Minimum SDK Version, Compile and Target SDK Version
2023-03-16 18:02:35 +09:00
Chan Jun Da
66e15a17ef
Change UploadModel::createAndAddUploadItem to not duplicate new uploadItems of same UploadableFile (#5179) 2023-03-16 10:19:24 +09:00
Ritika Pahwa
be1946cd7b
5161: Fix repeating images in peer review (#5170)
* fix API call to fetch the latest changes

* add database table to keep a track of reviewed and skipped images

* fix repeating reviewed or skipped images

* add removed newline again

* add necessary comments

* change from timber.e to timber.i in case there is no exception

* reintroduce the parameter rctag in the API URL

* modify API URL to retrieve latest uploads

* remove unused imports and code

* modify ReviewHelperTest and add new unit tests

* modify tests in ReviewHelperTest.kt

* add comments about the value of gcmlimit
2023-03-15 07:15:24 +09:00
translatewiki.net
c920ef0371 Localisation updates from https://translatewiki.net. 2023-03-13 13:01:48 +01:00
Avanish Yadav
3f5b7f4c58
Fix:4797:Add one more choice to the list (#5173) 2023-03-10 14:21:17 +09:00
Eduardo Isai Martínez Méndez
ce1a0b88c3
Fix#5084: Tapping on GitHub icon opens app when installed (#5171) 2023-03-10 11:45:32 +09:00
Arman Navodia
b048e099c0
fixed: When the coordinates have been copied from another picture, explain it in description #4700 (#5166)
Very useful contribution, thanks Arman!
2023-03-10 11:37:18 +09:00
translatewiki.net
caab97b341 Localisation updates from https://translatewiki.net. 2023-03-09 13:02:05 +01:00
Arin Modi
496933654b
Skip used images (#5160)
* Only Review Images That Has No Usage

* Coding Standard Related Changes

* Coding Standard Changes - 1

* small change
2023-03-07 14:46:36 +09:00
Arman Navodia
b917fe3229
Leaderboard: Taping on my avatar should open tip popup explaining how to change it #4774 (#5159)
* fixed Leaderboard: Taping on my avatar should open tip popup explaining how to change it #4774

* fixed Leaderboard: Taping on my avatar should open tip popup explaining how to change it #4774

* Leaderboard: Taping on my avatar should open tip popup explaining how to change it #4774

* fixed Leaderboard: Taping on my avatar should open tip popup explaining how to change it #4775
2023-03-07 14:30:11 +09:00
translatewiki.net
e4e13587d0 Localisation updates from https://translatewiki.net. 2023-03-06 13:02:04 +01:00
Ritika Pahwa
27e11c7f3f
fix longer questions not visible completely in Peer Review (#5162) 2023-03-03 18:30:25 +09:00
translatewiki.net
f8f43ae228 Localisation updates from https://translatewiki.net. 2023-03-02 13:02:28 +01:00
Kartikay Kaushik
e1c04f2013
Disabled telemetry - Bug #5154 (#5155) 2023-02-28 22:17:14 +09:00
translatewiki.net
067aff45ee Localisation updates from https://translatewiki.net. 2023-02-27 13:01:39 +01:00
Arman Navodia
94d462cafb
Fixed: After canceling a sharing, application goes back to the search menu #2296 (#5156)
* fixed:After canceling a sharing, application goes back to the search menu #2296

* fixed:After canceling a sharing, application goes back to the search menu #2296

* fixed:After canceling a sharing, application goes back to the search menu #2296

* fixed SeachActivityUnityTest failure when calling testOnBackPressed and cleaned up unnecessary code
2023-02-27 15:42:20 +09:00
Ritika Pahwa
7d895c4379
5074: Fix cropped numbers in Leaderboard (#5143)
* fix cropped numbers in the Achievements fragment

* add null check in inflateAchievements method to fix NullPointerException in AchievementsFragmentUnitTests
2023-02-26 14:24:55 +09:00
Chan Jun Da
23ee2b60d8
Fix #5151: Use DialogUtil for MediaDetailFragment (#5153)
* Update DialogUtil to return the dialog object

* Update first instance of Builder to DialogAlert

* Update DialogUtil to allow null instead of empty string

* Update MediaDetailFragment to use DialogUtil

* Remove unnecessary semicolons
2023-02-25 15:34:57 +09:00
Chan Jun Da
20100c4960
Fix #5151: Use DialogUtil methods instead of AlertDialog.Builder (#5152)
* Update AboutActivity to use DialogUtil

* Update ProfileActivity to use DialogUtil

* Update AchievementsFragment to use DialogUtil

* Remove wrong message set in ProfileActivity

* Update DialogUtil to accept null instead of empty string
2023-02-24 18:00:58 +09:00
translatewiki.net
968911db32 Localisation updates from https://translatewiki.net. 2023-02-23 13:01:52 +01:00
Arman Navodia
7da7062e3a
fixed 4731: Nearby banner appearing in Media Details (#5150)
* fixed 4731: Nearby banner appearing in Media Details

* fixed 4731: Nearby banner appearing in Media Details
2023-02-21 15:33:59 +09:00
translatewiki.net
4f1265643f Localisation updates from https://translatewiki.net. 2023-02-20 13:02:03 +01:00
Chan Jun Da
f56ee50c60
Fix #5148: Use DialogUtil method in Uploadactivity (#5149)
* Replace showInfoAlert with available DialogUtil method

* Remove test case that is no longer relevant
2023-02-20 15:27:57 +09:00
Chan Jun Da
1a8a068552
Fix #493: Fix erroneous no location reminder (#5145)
* Add showAlertDialog option for UploadPresenter to use

* Move location reminder logic from UploadActivity to UploadPresenter

* Add test cases for dialog alert with handleSubmit

* Change threshold variable name to be more descriptive

* Fix broken reference to renamed constant in tests
2023-02-18 23:18:52 +09:00
translatewiki.net
9bf5cf7441 Localisation updates from https://translatewiki.net. 2023-02-16 13:01:58 +01:00
translatewiki.net
cf7474b548 Localisation updates from https://translatewiki.net. 2023-02-13 13:01:40 +01:00
Chan Jun Da
f85efeba97
Fix #4347: Remove leading and trailing spaces in title (#5141)
* Update method to remove leading whitespace

* Update test cases testing remove whitespace method

* Remove unused whitespace check method

* Add comment about use of strip and trim in dealing with whitespace
2023-02-10 16:31:45 +09:00
translatewiki.net
654a0fce33 Localisation updates from https://translatewiki.net. 2023-02-09 13:02:02 +01:00
translatewiki.net
86aa60e11e Localisation updates from https://translatewiki.net. 2023-02-06 13:02:23 +01:00
Ritika Pahwa
1bc21c2629
4671: Change the deprecated RuntimeEnvironment.application in all the Robolectric unit tests (#5140)
* Robolectric Unit Tests: change deprecated robolectric RuntimeEnvironment.application to ApplicationProvider and optimise imports

* Delete app/CommonsContributions directory

Removed unnecessary directory created in the process
2023-02-06 17:17:16 +09:00
translatewiki.net
87f637f5c6 Localisation updates from https://translatewiki.net. 2023-02-02 13:02:03 +01:00
Arin Modi
191186a474
Fix #5104: popup shown when tapping an already uploaded image in Medi… (#5127)
* Fix #5104: popup shown when tapping an already uploaded image in Media Details

* Small Changes

* JavaDoc Changes

* Javadoc Changes

* Coding Standards Changes
2023-01-30 22:41:41 +09:00
translatewiki.net
3e073583ea Localisation updates from https://translatewiki.net. 2023-01-30 13:01:41 +01:00
translatewiki.net
dd920b6980 Localisation updates from https://translatewiki.net. 2023-01-26 13:02:36 +01:00
translatewiki.net
88b39b5023 Localisation updates from https://translatewiki.net. 2023-01-23 13:01:38 +01:00
translatewiki.net
e0d42b015d Localisation updates from https://translatewiki.net. 2023-01-09 13:04:00 +01:00
translatewiki.net
91953946e9 Localisation updates from https://translatewiki.net. 2023-01-02 13:01:44 +01:00
translatewiki.net
b9c97aecbc Localisation updates from https://translatewiki.net. 2022-12-29 13:02:35 +01:00
translatewiki.net
f75de2adab Localisation updates from https://translatewiki.net. 2022-12-26 13:02:15 +01:00
Ankush Bose
9c6c09621c
5125: Fix LocationPickerActivityUnitTests (#5126)
* 5121: Fix RecentLanguagesAdapterUnitTest
- all tests are passing
- additionally removed 'context' variable from AdvanceQueryFragmentUnitTests.kt as it is not used, and not removed on previous PR #5119

* 5125: Fix LocationPickerActivityUnitTest
- all tests are passing
2022-12-24 18:04:17 +09:00
Ankush Bose
b52d053212
5121: Fix RecentLanguagesAdapterUnitTest (#5124)
- all tests are passing
- additionally removed 'context' variable from AdvanceQueryFragmentUnitTests.kt as it is not used, and not removed on previous PR #5119
2022-12-24 18:04:08 +09:00
translatewiki.net
afa7a63f2b Localisation updates from https://translatewiki.net. 2022-12-22 13:02:01 +01:00
translatewiki.net
1d1471d9ed Localisation updates from https://translatewiki.net. 2022-12-19 13:01:48 +01:00
russianbear222
6dec69147f
[Enhancement] Add option to centre on GPS location for issue #5008 (#5098)
* Add option to centre on GPS location for issue #5008

* Rename and add new comments for issue #5008

* Add new comments for issue #5008

* Update comments for issue #5008
2022-12-17 23:05:45 +09:00
Ankush Bose
7b18c3eeb7
5115: Fix AdvanceQueryFragmentUnitTests (#5119)
* 5115: Fix AdvanceQueryFragmentUnitTests

* 5115: Adding further coverage
- removed redundant button.post() methods.
- increased code coverage
2022-12-17 22:43:34 +09:00
translatewiki.net
77bb789f9e Localisation updates from https://translatewiki.net. 2022-12-15 13:01:49 +01:00
Jeremy Kenny
3dbc744075
review: exclude images not uploaded from the app (#5118)
* the Review feature (in the app's menu) was originally thought as a way to improve our app's overall upload quality, it is not really adapted to the wide variety of pictures uploaded via other upload tools.

* update the Review API call to request only images with the `android app edit` tag.
2022-12-14 19:29:29 +09:00
translatewiki.net
d0871dd2c4 Localisation updates from https://translatewiki.net. 2022-12-12 13:01:46 +01:00
translatewiki.net
32c190750e Localisation updates from https://translatewiki.net. 2022-12-08 13:01:39 +01:00
translatewiki.net
6f6496aac4 Localisation updates from https://translatewiki.net. 2022-12-05 13:01:30 +01:00
translatewiki.net
b95c9386a3 Localisation updates from https://translatewiki.net. 2022-12-01 13:01:45 +01:00
translatewiki.net
ce4b457a7b Localisation updates from https://translatewiki.net. 2022-11-28 13:01:26 +01:00
translatewiki.net
673422d55c Localisation updates from https://translatewiki.net. 2022-11-24 13:01:39 +01:00
Ankush Bose
f7d3414cc3
4664: Moved RecentLanguagesAdapter to ViewBinding (#5112) 2022-11-21 23:00:40 +09:00
Ankush Bose
b90c123333
4664: Moved LanguagesAdapter to ViewBinding (#5111) 2022-11-21 23:00:29 +09:00
translatewiki.net
f512f797dd Localisation updates from https://translatewiki.net. 2022-11-21 13:01:28 +01:00
translatewiki.net
6437b72aba Localisation updates from https://translatewiki.net. 2022-11-17 13:01:35 +01:00
translatewiki.net
06c4f93ec2 Localisation updates from https://translatewiki.net. 2022-11-14 13:01:43 +01:00
translatewiki.net
f507d40ba1 Localisation updates from https://translatewiki.net. 2022-11-07 13:05:55 +01:00
translatewiki.net
1bb1990f3c Localisation updates from https://translatewiki.net. 2022-11-03 13:01:43 +01:00
translatewiki.net
a0936cd94f Localisation updates from https://translatewiki.net. 2022-10-31 13:04:53 +01:00
Jiaweeeeeen
3488644938
Fix issue #4962, remove trailing whitespace in caption field when set to uploadMediaDetails (#5085)
* add methods to check and remove trailing whitespace

* fix filter to check and remove trailing whitespace

* fix filter to check and remove trailing space first

* add test and fix filter() and removeTrailingWhitespace()

* caption trailing whitespace: change solution to remove trailing whitespaces when set to uploadMediaDetails

* update code documentation

* add more tests include instance tab, carriage return and Japanese whitespace

* Caption field: Stop blocking Japanese Space, convert to English Space when set to uploadMediaDetails

* Change method name from convertJapSpaceToEngSpace to convertIdeographicSpaceToLatinSpace

* Change pattern name from JapSpacePattern to ideographicSpacePattern
2022-10-30 18:58:15 +09:00
gengarrrr
09564c3eca
Fix issue #2649, create unit tests for darkness-checking logic using six images (#5096)
* add images and test too dark

* add dark and proper images and check if too dar

* test: add refer

Co-authored-by: Ruofan <u7307578@anu.edu.au>
2022-10-29 19:38:32 +09:00
Daniel Kolibár
aa97629cbf
Rewrote reverseGeoCode() method to use Coordinates2Country library (#5093)
* rewrote reverseGeoCode() method to use Coordinates2Country library; wrote simple TC for receiveImage() method to check if country coordinates are set

* removed unused slf4j import in UploadMediaPresenter class

* updated mock in for setCorrectCountryCodeForReceivedImage() TC to match against exact location arguments

* added javadoc for getCountryNamesAndCodes() method in UploadMediaPresenter; implemented "lazy loading" for countryNamesAndCodes field

* removed unused field added by me from UploadMediaPresenterTest
2022-10-29 19:37:11 +09:00
Ankush Bose
cc24caa83c
4664: Moved AdvanceQueryFragment to ViewBinding (#5091) 2022-10-29 18:33:50 +09:00
Ankush Bose
3fd63b009a
4664: Moved PageableMediaFragment to ViewBinding (#5090) 2022-10-29 18:33:43 +09:00
Ankush Bose
4c24b65d2d
4664: Moved FolderFragment to ViewBinding (#5089) 2022-10-29 18:33:33 +09:00
Ankush Bose
26d2669a74
4664: Moved ImageFragment to ViewBinding (#5067) 2022-10-29 17:50:25 +09:00
Ankush Bose
64d4ffc5f1
4664: Moved CustomSelectorActivity to ViewBinding (#5065) 2022-10-29 17:50:19 +09:00
Ankush Bose
10b025c237
4664: Moved WelcomeActivity to ViewBinding (#5063)
* 4664: Moved WelcomeActivity to ViewBinding

* 4664: Removed non-null test on member variables
2022-10-29 17:50:10 +09:00
Guilherme Lunetta
1a39c9f8b1
rewording 3 strings in the app/src/main/res/values/strings.xml file (#5102) 2022-10-29 07:35:59 +09:00
translatewiki.net
e9fbd47ac0 Localisation updates from https://translatewiki.net. 2022-10-27 13:03:33 +02:00
translatewiki.net
06017a66a7 Localisation updates from https://translatewiki.net. 2022-10-24 13:01:46 +02:00
translatewiki.net
c66f216f4b Localisation updates from https://translatewiki.net. 2022-10-20 13:01:57 +02:00
translatewiki.net
74f5249b88 Localisation updates from https://translatewiki.net. 2022-10-17 13:01:32 +02:00
translatewiki.net
80f7f966f3 Localisation updates from https://translatewiki.net. 2022-10-13 13:01:37 +02:00
translatewiki.net
d3445336fd Localisation updates from https://translatewiki.net. 2022-10-10 13:01:36 +02:00
translatewiki.net
e507351f35 Localisation updates from https://translatewiki.net. 2022-10-06 13:02:03 +02:00
translatewiki.net
27e3f564a1 Localisation updates from https://translatewiki.net. 2022-10-03 13:01:43 +02:00
translatewiki.net
624f42f3e5 Localisation updates from https://translatewiki.net. 2022-09-29 13:01:37 +02:00
translatewiki.net
7406c4bea5 Localisation updates from https://translatewiki.net. 2022-09-26 13:01:52 +02:00
Andrii Nyvchyk
5949ffd1e8
Fix #5058 (#5059) 2022-09-25 10:35:14 +09:00
translatewiki.net
d1bdb6a36e Localisation updates from https://translatewiki.net. 2022-09-22 13:01:46 +02:00
TurquoiseHexagonSun
eade6ca3a9
Merged the two conditions into a single condition. (#5055) 2022-09-21 14:43:12 +09:00
translatewiki.net
db30f07f64 Localisation updates from https://translatewiki.net. 2022-09-19 13:02:00 +02:00
Yusuke Matsubara
883ecddac7
Fix wrong import of Test (#5039) 2022-09-18 17:17:03 +09:00
Yusuke Matsubara
789960a966
Fix Wiki Love Monuments year (#5049)
* Remove year from messages containing "Wiki Loves Monuments 2021"

* Retrieve Wiki Love Monuments year dynamically

* Add test and doc
2022-09-18 15:50:44 +09:00
Ayan Sarkar
33679eb6b4
[GSoC 2022] Improve custom picker (all features) (#5035)
* Project Initiated by creating helper classes for database operations

* Database created

* Rest of the work and documentation

* Requested changes done

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* [GSoC] Insert and Remove Images from not for upload (#4999)

* Inserted and marked images as not for upload

* Documentation added

* Test delete

* Implemented remove from not for upload

* Test fixed

* Requested changes done

* Added tests for new lines in existing classes

* [GSoC] Added Bubble Scroll (#5023)

* Library added

* Bubble scroll implemented

* Left and right swipe

* Requested changes

* [GSoC] Hide/Unhide actioned pictures and change numbering (#5012)

* Changed numbering of marked images

* Hide Unhide implemented

* Test fixed

* Improved speed for database operation

* Improved speed for database operation

* Changed progress dialog

* Improved hiding speed

* Test fixed

* Fixed bug

* Fixed bug and improved performance

* Fixed bug and improved performance

* Test fixed

* Bug fixed

* Bug fixed

* Bug fixed

* Bug fixed

* Bug fixed

* Code clean up

* Test hiding images

* Test hiding images

* Test hiding images

* Code clean up and test fixed

* Fixed layout

* Fixed bug

* Bug fixed

* Renamed method

* Documentation added explaining logic

* Documentation added explaining logic

* [GSoC] Full Screen Mode (#5032)

* Gesture detection implemented

* Left and right swipe

* Selection implemented

* onDown implemented

* onDown implemented

* FS mode implemented

* OnSwipe doc

* Scope cancel

* Added label in Manifest

* Merged two features

* Requested changes

* Image uploaded bug fixed

* Increased DB version

* Made requested changes

* Made requested changes

* Made requested changes

* Made requested changes

* Solved image flashing bug

* Solved image flashing bug

* Requested changes

* Requested changes

* Changed name of a function

* Fixed transaction failure on large number of images

* Tested with isIdentity

* Tested with isIdentity

* Increased the threshold

* Added info dialog

* Minor changes

* ImageAdapter Test

* CustomSelectorActivity Test

* Requested changes

* Test for ZoomableActivity

* Test for ZoomableActivity

* Test for ImageLoader

* Test for OnSwipeTouchListener

* Test for rest

* Reverted some test changes

* Added more tests for ImageAdapter

* Added more tests for ImageAdapter and swipe gesture

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
2022-09-16 18:14:16 +09:00
translatewiki.net
b5ffe7120c Localisation updates from https://translatewiki.net. 2022-09-15 13:01:45 +02:00
translatewiki.net
571be4f5e3 Localisation updates from https://translatewiki.net. 2022-09-12 13:01:44 +02:00
translatewiki.net
9cf417123d Localisation updates from https://translatewiki.net. 2022-09-08 13:01:43 +02:00
translatewiki.net
59a70a19fa Localisation updates from https://translatewiki.net. 2022-09-05 13:01:44 +02:00
Yusuke Matsubara
c864d6c49d
Rename values-ks-arab -> values-ks (#5040) 2022-09-05 13:03:25 +09:00
translatewiki.net
65bf347f00 Localisation updates from https://translatewiki.net. 2022-09-01 13:01:52 +02:00
translatewiki.net
5e990da7cc Localisation updates from https://translatewiki.net. 2022-08-29 13:01:49 +02:00
translatewiki.net
d702b404c0 Localisation updates from https://translatewiki.net. 2022-08-25 13:02:26 +02:00
translatewiki.net
97674ac334 Localisation updates from https://translatewiki.net. 2022-08-22 13:01:49 +02:00
translatewiki.net
77f87bfced Localisation updates from https://translatewiki.net. 2022-08-18 13:01:56 +02:00
translatewiki.net
23c9d9d1a6 Localisation updates from https://translatewiki.net. 2022-08-15 13:01:36 +02:00
translatewiki.net
be5674c058 Localisation updates from https://translatewiki.net. 2022-08-11 13:01:56 +02:00
translatewiki.net
0ba8eb1589 Localisation updates from https://translatewiki.net. 2022-08-08 13:01:38 +02:00
Madhur Gupta
3cdfdcffe1
Merge 4.0-release into master (#5028)
* Fix string for custom selector

* Fix bug #4950 back arrow still present on top-level activity (#4952)

* Fix bug #4949 by correctly setting previous db version number (#4956)

* Fix bug #4949 by correctly setting previous db version number

* Fix failing tests

* Fix bug #4959 by correctly setting previous db version number and updating the current db version (#4960)

* Fix bug #4957 (#4961)

* Update library to new version that handles older Java VMs

Fixes #4972 I believe.

* Versioning for v4.0.0

* Changelog for v4.0.0

* Fix bug #4984 Added queries for package name for Android API 30+ (#4987)

* Update mapbox sdk version (#4989)

* Versioning for v4.0.1

* Changelog for v4.0.1

* Remove network type information from NetworkUtils (#4996)

* Remove network type information from NetworkUtils

* Ignore dependent tests

* Fix #4992 invert the equals condition to be null safe (#4995)

* Fix java.lang.NullPointerException for username in ContributionBoundaryCallback (#5003)

* Fix failing tests for PR #5003 (#5004)

* Fix java.lang.NullPointerException for username in ContributionBoundaryCallback

* Fix failing tests

* Update Room DB Version (#5011)

* Fix #5001 (#5010)

* Fix DB update issue (#5016)

* [WIP] Fix both timezone problem and saved date problem (#5019)

* Fix both timezone problem and saved date problem

* Fixaccidental test code and add comments

* Add issue link to the comments

* Fix format issue and null checks

* Versioning for v4.0.2

* Changelog for v4.0.2

* Add "Report Violation" menu option (#5025)

* Add "Report Violation" menu option

* Update email template

* Update email address

* Fixed typo

Co-authored-by: Josephine Lim <josephinelim86@gmail.com>

* Versioning for v4.0.3

* Changelog for v4.0.3

Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
2022-08-08 15:51:07 +10:00
translatewiki.net
1de8968fa8 Localisation updates from https://translatewiki.net. 2022-08-04 13:01:54 +02:00
translatewiki.net
0e71cc49bd Localisation updates from https://translatewiki.net. 2022-08-01 13:02:09 +02:00
translatewiki.net
320d14c784 Localisation updates from https://translatewiki.net. 2022-07-28 13:02:54 +02:00
translatewiki.net
8f6b267e1e Localisation updates from https://translatewiki.net. 2022-07-25 13:02:28 +02:00
translatewiki.net
e29028245f Localisation updates from https://translatewiki.net. 2022-07-11 13:02:23 +02:00
translatewiki.net
7ba3e23a46 Localisation updates from https://translatewiki.net. 2022-06-30 13:02:30 +02:00
translatewiki.net
2b914fa181 Localisation updates from https://translatewiki.net. 2022-06-27 13:02:21 +02:00
translatewiki.net
37a9284b51 Localisation updates from https://translatewiki.net. 2022-06-23 13:02:28 +02:00
translatewiki.net
e3da7c7982 Localisation updates from https://translatewiki.net. 2022-06-20 13:02:31 +02:00
translatewiki.net
579958a5b3 Localisation updates from https://translatewiki.net. 2022-06-16 13:02:33 +02:00
translatewiki.net
653c113ba7 Localisation updates from https://translatewiki.net. 2022-06-13 13:02:25 +02:00
translatewiki.net
05641b0c3d Localisation updates from https://translatewiki.net. 2022-06-09 13:02:18 +02:00
translatewiki.net
faeb394a65 Localisation updates from https://translatewiki.net. 2022-06-06 13:02:37 +02:00
translatewiki.net
80f820b7e2 Localisation updates from https://translatewiki.net. 2022-06-02 13:02:43 +02:00
translatewiki.net
3547361c9e Localisation updates from https://translatewiki.net. 2022-05-30 13:02:20 +02:00
Dharun kumar
6e9f60fd86
Removed CommonsContributions empty files and folders (#4982) 2022-05-30 16:19:09 +09:00
96fbcb92e5
fix #4940 (#4986) 2022-05-30 16:14:40 +09:00
c5b527f450
fix #4971 (#4974) 2022-05-29 12:01:03 +09:00
HCH
ffbfdabb3a
fix commons-app#4978 (#4979) 2022-05-29 11:51:13 +09:00
translatewiki.net
be5827c2c7 Localisation updates from https://translatewiki.net. 2022-05-26 13:02:26 +02:00
Nicolas Raoul
68540a0e0a
Update library to new version that handles older Java VMs (#4975)
Fixes #4972 I believe.
2022-05-26 17:02:11 +10:00
Ben Mills
78bfd0986c
Content description for UI elements -- accessibility (#4935)
* Started from welcome layout to main layout adding content descriptions

* Adds UI description section to strings.xml and adds a few content descrpitions

* Consolidates UI strings to top of file

* fixes nearby typos

* Removes content descriptions that clash with pr #4766

* Removes unused elements and reverts out-of-scope changes

* Restores pic-of-the-day content description

Co-authored-by: joshuamccluskey <jpiff57@gmail.com>
2022-05-24 14:36:06 +03:00
translatewiki.net
e47d057bfe Localisation updates from https://translatewiki.net. 2022-05-23 13:02:08 +02:00
translatewiki.net
325a09d93a Localisation updates from https://translatewiki.net. 2022-05-16 13:01:48 +02:00
AlexMahlon
d8724f4541
Fixes #4934. Enforces Wikimedia character blocklisting on media titles. (#4955) 2022-05-15 19:33:08 +09:00
d647c0674e
disable dialog display (#4954) 2022-05-13 17:50:35 +09:00
translatewiki.net
1d4a89d89e Localisation updates from https://translatewiki.net. 2022-05-12 13:01:43 +02:00
translatewiki.net
262517a70f Localisation updates from https://translatewiki.net. 2022-05-09 13:01:50 +02:00
translatewiki.net
75dcc6b7a7 Localisation updates from https://translatewiki.net. 2022-05-05 13:01:51 +02:00
Ayan Sarkar
a16dca9f56
[Fixes Bug]: After moving between tabs on Bookmark fragment, Bookmarks never loads (#4951)
* Fixed the issue added tests

* Added requested changes
2022-05-05 10:08:56 +03:00
translatewiki.net
932991e060 Localisation updates from https://translatewiki.net. 2022-05-02 13:01:54 +02:00
Benard Mathu
6ad70932c5
Refactor: notification models (#4866)
* Refactor: move notification modesl to data.models.notification

* Refactor: move notification models to notifications/models
2022-04-28 18:23:44 +03:00
Benard Mathu
8cdcd0f7c2
Refactor: RecentSearch model (#4857)
* Refactor: move recent search to data.models

* Refactor: move search models to explore/models
2022-04-28 17:57:17 +03:00
Benard Mathu
d37cdef3c4
Refactor: Campaign model (#4852)
* Refactor: move Campaign.kt to data.models

* Refactor: move campaign models to campaign/models
2022-04-28 17:35:07 +03:00
HCH
b2a901b9b3
Fixes #4942 Change category extraction algorithm (#4943)
* updated addCategory()method

* update addCategory()method

* add unit test for none category

* add comments to addCategory()method

* update comments

* update comments for addCategory()method
2022-04-28 23:21:45 +09:00
translatewiki.net
79086fe942 Localisation updates from https://translatewiki.net. 2022-04-28 13:02:01 +02:00
bf82fcc8d3
change description extraction algorithm (#4938)
The original algorithm uses comma to separate descriptions which causes bugs when there are comma inside description.
The algorithm is changed to repeatedly matching string patterns of `{{languageCode|desciption}}`
2022-04-28 17:34:02 +10:00
Madhur Gupta
36510a4301
Fix Instrumentation Tests (#4832)
* Fix AboutActivity Instrumentation Tests

* Fix WelcomeActivity Instrumentation Tests

* Fix SearchActivity Instrumentation Tests

* Fix SignupTest Instrumentation Tests

* Fix LoginActivityTest Instrumentation Tests

* Fix SettingsActivity Instrumentation Tests

* Fix LoginActivity Instrumentation Tests

* Update loginUser

* Add logoutUser

* Fix logoutUser

* Update github action to use env variables

* Fix github action to use env variables

* Fix github action

* Fix github action

* Fix github action

* Fix github action

* Fix github action

* Fix github action

* Fix github action

* Fix github action

* Fix github action

* Fix github action

* Fix github action

* Remove scroll

* Add wait time

* Fix keyboard issue

* Disable animation

* Enable animation

* Enable animation

* Disable animation

* Fix compile error

* Remove AVD Cache

* Set timezone and dns

* Add AVD cache

* Add API level

* Update API level to 24

* Add sleep timer

* Add scroll

* Remove logout

* Ignore some tests

* update logout

* update logout

* Fix scroll layout problem

* Fix scroll layout problem

* Ignore orientation test

* Update tests

* Update tests

* Update API level to 29

* Change device and API level to 27

* Use AndroidJUnit4

* Change API to 28

* Try with macos

* Use nested scrollview

* Update Profile Activity Test

* Update Profile Activity Test

* Turn off rotation

* Change device

* Remove failing test

* Change API to 24

* Add rotation lock for failing test

* Change API to 24

* Add sleep

* Remove text

* Remove child

* Force rotation on back press

* Force open more sheet

* Change device to pixel 5

* Change device to 13.5inch

* Update tests

* Ignore failing test

* Use linux

* Update tests

* Use repo secrets instead

* Add mainactivity tests

* Remove content description

* Different workflows for PR and branch, PR workflow will need maintainer approval to prevent secrets getting leaked

* Run instrumentation tests only for push and not for PRs

* Fix FileNotFound Exception

* Update MainActivity and Profile tests

* Fix coverage path issue

* Add wait time for map to load

* Open contribution

* Update settings tests

* Update main activity tests

* Fix failing test

* Fix failing test

* Increase login time

* Separate settings test

* Update review tests

* Ignore uploadCancelledAfterLocationPickedTest

* Update MainActivity Tests

* Update UploadCancelledTest

* Update UploadCancelledTest

* Update device

* Fix Init release error

* Fix failing test

* Fix failing test

* Try with long click

* Update UploadCancelledTest.kt

* Fix Leaderboard Test

* Update testContributions

* Set GPS coordinates

* Add zoomControllers to excludes

* Add ExploreActivityTest

* Remove failing condition

* Merge tests

* Remove failing test

* Remove failing test

* Fix failing test

* Fix failing test

* Update AboutActivityTest.kt

* Update jacoco.gradle
2022-04-26 21:09:15 +10:00
neslihanturan
0df272c250
The issue related directory is removed (#4946) 2022-04-26 20:53:10 +10:00
Benard Mathu
7fa3ff0eee
Refactor: Bookmark model (#4851)
* Bookmark: moved model to data.models package

* Refactor: move bookmark models to bookmark/models
2022-04-26 12:34:14 +03:00
Arin Modi
1ae013d2b3
Fixed #4906 : Peer review: "thank the contributor" should show snackb… (#4914)
* Fixed #4906 : Peer review: "thank the contributor" should show snackbar instead of notification

* changes the snackbar to toast

* added the tests

* minor changes

* minor changes - 2
2022-04-25 22:48:43 +03:00
translatewiki.net
11bc72c514 Localisation updates from https://translatewiki.net. 2022-04-25 13:02:05 +02:00
translatewiki.net
e7a9ba9ad9 Localisation updates from https://translatewiki.net. 2022-04-21 13:02:00 +02:00
Pratham Pahariya
d7ad3b934d
#4730 - Nothing happens on clicking media in the Contribution tab of User's Profile (#4736)
* enable clicking on contributions in user's profile

* Added null condition

* Added Comments

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2022-04-18 16:17:40 +03:00
translatewiki.net
7579c1aa16 Localisation updates from https://translatewiki.net. 2022-04-18 13:01:47 +02:00
f492d95014
Fix #4930 : change the nearby bookmark icon color (#4932)
The original black icon cannot be seen in the dark theme. The color is changed to orange so that it is visible in both themes.
2022-04-14 21:30:39 +09:00
Ayan Sarkar
17ac591233
Fixed the issue added tests (#4933) 2022-04-14 21:29:14 +09:00
translatewiki.net
31d63d1a2a Localisation updates from https://translatewiki.net. 2022-04-14 13:02:01 +02:00
neslihanturan
ee1bf4b5b6
Explore nearby pictures (#4910)
* Add map fragment for explore and search

* Create structure of explore map by defining view and user action interfaces to presenter

* Add methods to map start, bottom sheet and permission

* Make the simple map visible

* Imitate methods from nearby map for permission needed and non needed map initialisation operations, however, needs to be tested and reactor

* a level of abstraction

* update media params to include coordinates

* Implement pageable presenter to explore

* Create Root fragment for map and media

* Iplement two presenter one for map operations, the other for pageable operations

* Construct general structure for both explore with search query and just by location

* fix injection issue

* Make default explore work with zoom level

* increase offscreen page limit with newly added fragment

* Make two distinct api calls for search with and without query

* Before trying to use same presenter for both search with and without query

* Add notes for Madhur

* Add Madhur's fixes for binding

* Call serch with and without query from the same spot

* partially solve zoom issue

* Make tab view unswipble while map is being used on search activity

* make viewpager unswipable while map is being used

* Code cleanup and reverting unnecessry edits

* Add search this area methods

* Implement search this area button functionality

* Fix search this area button, current location FAB and bottom attribution UI elements

* Add marker click action

* Solve bookmarkdao injection issue

* Make display bottom sheet details on marker click

* remove label and set bottom sheet behavior

* Remove irrelevan buttons like wikidata and article buttons

* Cancel bookmark feature for commons images for know, needs to be thought

* Add search this area button

* Add location off dialog

* Implement back button for explore map fragment while not on search activity

* Make thumbnails visible, they need some styling though

* Make gridle views even more beautiful

* Remove classes added to support query

* Remove query related code from Reach Activity

* Solve two progressbar issue

* Remove query related ekstra codes

* Remove not needed anymore callback

* Make medai details work

* Remove all old removed code dependencies

* Solve initial load takes too long issue

* Solve current position track

* Add placeholder for possible load issues

* Add red stroke to bitmap

* Add borders to rectangles

* Change media details text to details

* Fix file name extension anf File: prefix

* Fix some code style issues

* Fix some style issues

* Fix style issues

* Fix build issue

* Fix test about etMediaListFromSearch

* Fix test issue with Seacrh Activity

* Fix conflict mark
2022-04-14 18:28:17 +10:00
Ayan Sarkar
7655562272
Fixes 4922 : Crash when trying to edit description (in Media details) (#4929)
* DescriptionEditActivity handled

* Minor change

* Minor changes
2022-04-11 21:14:26 +09:00
translatewiki.net
644cd473f8 Localisation updates from https://translatewiki.net. 2022-04-11 13:01:53 +02:00
Ayan Sarkar
11292ab514
Fixes 4620 : Editing categories of an existing picture: Reuse categories selection UI from the Upload Wizard (#4928)
* Entry to new UI

* Getting existing categories

* Hidden categories managed

* Category edit updated

* Category Edition implemented

* Java docs added

* Java docs added

* Java docs added

* Previous UI discarded

* Test added

* More test added

* More test added

* More test added

* More test added

* More java docs added

* Minor changes
2022-04-11 19:30:21 +09:00
translatewiki.net
48343035d3 Localisation updates from https://translatewiki.net. 2022-04-07 13:01:33 +02:00
translatewiki.net
2bb2cbc59c Localisation updates from https://translatewiki.net. 2022-04-04 13:01:41 +02:00
translatewiki.net
0d25c2421b Localisation updates from https://translatewiki.net. 2022-03-31 13:01:58 +02:00
translatewiki.net
50c4458746 Localisation updates from https://translatewiki.net. 2022-03-28 13:02:05 +02:00
RISHAV GUPTA
6e8bd4b7a3
FIXES :- Improve review feature documentation #3361 (#4915)
* detailed explanation added

* done the requested changes

* requested changes done 2
2022-03-26 09:21:58 +09:00
translatewiki.net
efa7e109da Localisation updates from https://translatewiki.net. 2022-03-24 13:02:03 +01:00
Ayan Sarkar
4194409cd2
Fixes 4544 : Language selection: history (#4880)
* Xml changes

* Content provider created

* Database setup done

* Database setup revised

* Database setup revised

* SettingsFragment finished

* SettingsFragment finished

* UploadMediaDetailFragment updated

* UploadMediaDetailFragment updated

* Java docs

* Test fixed

* Test added

* Test added

* Test updated

* More tests added
2022-03-23 16:33:54 +09:00
Devarsh Mavani
85bdcd5a7a
App downloads too many of my contributions, without reason (#4916)
* Init commit

* Fixed tests
2022-03-23 11:15:48 +09:00
Ayan Sarkar
bd9531b969
Fixed 4616 : Option for editing depictions (#4725)
* Dialog can't be dismissed

* Dialog can't be dismissed

* Option for editing depiction

* Java docs added

* Minor issues fixed

* Lining done

* "Depictions not updating instantly" issue resolved

* Existing Depicts on the top

* Existing Depicts on the top

* Back press handled

* Previous depictions unchecked

* Whole Screen issue fixed

* Nearby banner removed

* Test fixed

* Upload Wizard issue fixed

* Upload Wizard issue fixed

* Previous depicts issue fixed

* Previous depicts issue fixed

* All issues fixed

* Fixed late loading of updated depicts

* Depiction is removable

* Test fixed

* Back button press handled after losing focus for edittext

* RequiresApi removed

* RequiresApi removed

* Test fixed

* Requested changes

* Test added

* Test added

* UploadModelUnitTest added

* DepictEditHelperUnitTest added

* DepictEditHelperUnitTest added

* Test added

* More test added

* Indentation Reversed

* Indentation reversed

* Update MediaDetailFragment.java

* Indentation reversed

* Update MediaDetailFragment.java

* Indentation reversed

* Indentation reversed

* Indentation reversed

* Indentation reversed

* More test added

* More test added

* Minor fixes

* Minor fixes

* Minor fixes
2022-03-22 14:33:43 +09:00
Arin Modi
e58322ed63
Fixed #4908 : Thumbnail image is grey during upload (#4909)
* Fixed #4908 : Thumbnail image is grey during upload

* Test Added and minor changes
2022-03-21 22:25:20 +09:00
translatewiki.net
4ba463c6b2 Localisation updates from https://translatewiki.net. 2022-03-21 13:01:46 +01:00
Devarsh Mavani
37070321d8
Init Commit (#4907) 2022-03-20 18:43:33 +09:00
Devarsh Mavani
fa0370438b
In app feedback (#4845)
* rebase

* Progress

* Completed UI and POST Request

* removed invalid string resource

* Removed unused code & Added string resources

* Resolved Code style issues

* Javadoc for getters & setters

* Codestyle fixes

* Minor Fixes

* wip

* Tests

* Comments

* Fixed Tests

* Minor changes

* minor change

* Comments

* Minor Fixes

* fixed tests

* Removed Butterknife

* Fixed tests

* Removed Unecessary strings

* Minor chnages

* Minor fix

* Minor changes

* Minor changes

* Implemented Suggestions

* Removed Redundant Toast
2022-03-20 12:10:25 +09:00
RISHAV GUPTA
00760ba1c6
Fixes [Bug]: Prod/beta flavor messages may be nonsense for users #4850 (#4899)
* small string changes

* small change done

* small changes done
2022-03-20 07:51:54 +05:30
RISHAV GUPTA
6ea3198d65
Fixes : #4273 Add link to user guide in About (#4882)
* user guide added in about

* test added

* unit test added
2022-03-20 07:50:25 +05:30
translatewiki.net
1078c70525 Localisation updates from https://translatewiki.net. 2022-03-17 13:02:08 +01:00
Devarsh Mavani
103e2d546e
Review category issues (#4897)
* Ask for category only if exists in Peer Review

* Minor Fixes

* Fixed wrong categories issue

* Added comments

* Added comments

* Minor Changes

* Added test

* Tests

* Tests

* Tests
2022-03-17 19:12:30 +09:00
Arin Modi
7bc78f67ff
Remember last opened screen on app startup (Nearby or Contributions) (#4881)
* added required changes

* Fixed #4808 : Added the feature of opening last opened screen between Contribution & NearBy

* removed the unnecessary commits

* removed the unnecessary commits

* removed the unnecessary commits

* removed the unnecessary commits

* added test

* comments added
2022-03-16 18:09:54 +05:30
RISHAV GUPTA
332a69fe5c
Bengali Upload bug fix (#4890) 2022-03-15 01:22:03 +05:30
translatewiki.net
a04d0bc031 Localisation updates from https://translatewiki.net. 2022-03-14 13:02:04 +01:00
Devarsh Mavani
caad8644a3
Unit tests failing (#4889)
* tests

* fixed tests
2022-03-13 09:41:45 +09:00
RISHAV GUPTA
ed572aab6f
Fixes #4589 :- The empty screen while no images found in custom picture selector [bug] (#4884)
* bug fix

* bug fix 2
2022-03-11 23:12:39 +09:00
translatewiki.net
4ea20fafde Localisation updates from https://translatewiki.net. 2022-03-10 13:01:50 +01:00
translatewiki.net
bd61128e14 Localisation updates from https://translatewiki.net. 2022-03-07 13:01:39 +01:00
RISHAV GUPTA
c02d569468
Fixes #4589 :- The empty screen while no images found in custom picture selector (#4863)
* no image found

* old removed

* new way

* minor changes

* reqeusted changes done
2022-03-07 18:34:03 +09:00
RISHAV GUPTA
824a82ad2a
Fixes : #4855 Copyright warning for beta flavor (#4873)
* xml work done

* testing

* copyright popup added local

* minor changes

* minor changes 2

* picture removed
2022-03-07 18:16:14 +09:00
Arin Modi
c626f97fb9
Fixed - #4844 : In peer review, deletion proposal is sent even if no reason is chosen (#4862)
* Fixed - #4844 : [Bug]: In peer review, deletion proposal is sent even if no reason is chosen

* Minor Changes

* Minor Fixes

* added required changes

* added required changes - 1

* Added Test For OK Button

* Minor Fixes
2022-03-07 17:52:04 +09:00
translatewiki.net
16266975d8 Localisation updates from https://translatewiki.net. 2022-03-03 13:01:56 +01:00
Arin Modi
9431e3770c
Fixed #4836 & #4840 Added the functionality of cancel upload and also solved the small bug of pausing upload (#4843)
* Fixed #4836 & #4840

* Added Pausing PopUp

* Closing Pausing PopUp exactly when pause button disappears

* Managed to display the Pausing Upload

* Added the Pausing Dialog Using Progress Bar

* Added the Pausing Dialog Using Progress Bar

* Added Required Changes

* Added Required Changes-wording change

* Added Required Changes-wording change
2022-02-26 08:41:14 +09:00
RISHAV GUPTA
f1169eaff9
Fixes #4523 :-Tap to view: could be success could be failure (#4860)
* Tap to view: could be success could be failure

* little change
2022-02-25 20:31:07 +05:30
translatewiki.net
87b9648aae Localisation updates from https://translatewiki.net. 2022-02-24 13:01:39 +01:00
Jacob Fano
1405300fd5
Fixed #4784 : Inform users about unsupported features in beta flavor (#4834)
* Display toast and disable API in LeaderboardFragment beta flavor

* Display toast and disable API in AchievementsFragment beta flavor

* Removed unused Gravity import

* Added Toast appearance tests for AchievementsFragment

* Added Toast appearance tests for LeaderboardFragment

* Improve Context detection in Achievements+Leaderboard fragments to ensure Context found for Toast

* Add testOnCreateView for AchievementsFragment
2022-02-24 14:40:51 +09:00
Ayan Sarkar
18a9170691
Unit Tests for LocationPickerViewModel (#4846)
* LocationPickerViewModel Unit Tests added

* LocationPickerViewModel Unit Tests added
2022-02-23 00:00:37 +05:30
Devarsh Mavani
d81587b85a
Deletion Language is in english (#4841)
* Deletion Language is in english

* Added Tests

* Added Tests

* Added Tests
2022-02-22 11:45:35 +09:00
translatewiki.net
0f515823e9 Localisation updates from https://translatewiki.net. 2022-02-21 13:01:48 +01:00
Ayan Sarkar
4a69bc55cd
Unit Tests for LocationPickerActivity (#4830)
* LocationPickerActivityUnitTests.kt class created

* Unit tests for LocationPickerActivity

* Unit tests for LocationPickerActivity

* Added verify

* verify added

* Minor changes

* Covered more lines

* Covered more lines

* addCredits test added
2022-02-20 11:37:32 +05:30
Arin Modi
ea6258ccf5
Fixed #4750 : "Exists" is enabled by default for map view (#4838) 2022-02-19 18:02:50 +09:00
Arin Modi
68a0400b9f
Fixed #4793 : Remove the need to tap "Next" again (#4833)
* Fixed #4793 : Remove the need to tap "Next" again

* Fixed #4793 : Remove the need to tap "Next" again

* Fixed #4793 : Remove the need to tap "Next" again, Added Changes
2022-02-19 16:44:44 +09:00
Madhur Gupta
e26f6144f3
Add model subfolder to excludes (#4821) 2022-02-18 16:19:32 +10:00
Madhur Gupta
ecb43faef5
Add BookmarkListRootFragment Unit Tests (#4822) 2022-02-18 16:19:24 +10:00
Madhur Gupta
2fc33b0299
Add ZoomControllers Unit Tests (#4823)
* Add MultiPointerGestureDetector Unit Tests

* Add TransformGestureDetector Unit Tests
2022-02-18 16:19:17 +10:00
Madhur Gupta
52bdb56fb2
Add WikiAccountAuthenticator Unit Tests (#4827) 2022-02-18 16:19:11 +10:00
Madhur Gupta
9205f37605
Run Instrumentation tests and generates unified code coverage (#4828)
* Run instrumentation tests on CI and generate unified coverage report

* Fix ci

* Fix failing tests and use mac machine for HAXM

* Fix failing tests

* Fix coverage failure

* Try with ubuntu latest

* Change API level to 23

* Fix Failing Test

* Add prod APK generator workflow back
2022-02-18 16:18:29 +10:00
Devarsh Mavani
c6fda6dadb
Show progress when uploading image (#4831) 2022-02-18 12:44:16 +09:00
translatewiki.net
b56fd4c220 Localisation updates from https://translatewiki.net. 2022-02-17 13:01:39 +01:00
Madhur Gupta
01904bccdf
Add CustomOkHttpNetworkFetcher Unit Tests (#4826) 2022-02-17 17:06:36 +10:00
Arin Modi
863477aa02
Fixed 4794 : Added a functionality of remembering zoom level on map (#4817)
* Fixed 4794 : Added a functionality of remembering zoom level on map

* Added Required Changes

* Added Required Changes

* Added Required Changes

* Added Required Changes

* Added Required Tests for the RememberZoomLevel
2022-02-17 15:52:48 +09:00
Devarsh Mavani
755b216507
Show user current location (#4825) 2022-02-16 23:13:23 +09:00
Ayan Sarkar
27e3f20ba2
Fixes 4539 : When Wikidata has no description showing instance_of's label as a description (#4799)
* Showing instance_of's name as a description

* Indentation fixed

* DepictsClient Test added
2022-02-16 14:19:27 +09:00
Devarsh Mavani
c2bc5b4f23
Show Last Known Location in LocationPickerActivity (#4816)
* Show Last Known Location in LocationPickerActivity

* Removed extra empty line

* Added tests

* Added tests

* Added tests

* Added tests

* Added tests

* Added tests

* Added tests
2022-02-16 00:44:46 +05:30
Madhur Gupta
458024bdee
Update MoreBottomSheetFragment Unit Tests (#4812)
* Update MoreBottomSheetFragment Unit Tests

* Fix failing tests
2022-02-15 19:40:34 +10:00
Madhur Gupta
4081bf6e61
Add concurrency, db, data and kvstore folder to exclude list (#4813)
* Add concurrency folder to exclude list

* Add kvstore to excludes

* Add db to excludes

* Add data to excludes
2022-02-15 19:40:27 +10:00
Madhur Gupta
fd0dbf4cfd
Add AccountUtil Unit Tests (#4814) 2022-02-15 19:40:13 +10:00
Madhur Gupta
dcf3aa8670
Add some more tests for NearbyParentFragment (#4815) 2022-02-15 19:40:03 +10:00
Madhur Gupta
272f59b217
Add tests for CommonsAppAdapter (#4818)
* Add tests for CommonsAppAdapter

* Remove robolectric dependency
2022-02-15 19:39:50 +10:00
Madhur Gupta
092079986a
Add UploadMediaDetailAdapter Unit Tests (#4819) 2022-02-15 19:36:31 +10:00
translatewiki.net
dea438c27c Localisation updates from https://translatewiki.net. 2022-02-14 13:01:43 +01:00
Ayan Sarkar
15fa93e8d0
Description and thumbnail is showing for the categories that are associated with Wikidata (#4803)
* Depiction.commons categories showing with description and thumbnail

* Test added

* Test added
2022-02-14 19:45:59 +09:00
Arin Modi
ecc6b1bf28
Fixed the issue #4806: Now, "Location Not Found" pop appears only one… (#4807)
* Fixed the issue #4806: Now, "Location Not Found" pop appears only one time

* Fixed the issue #4806: solved the small bug related to popups warning

* Fixed the issue #4806: solved the small bug of : Location Not Found Pop Up

* Fixed the issue #4806: solved the small bug of : Location Not Found Pop Up

* Fixed the issue #4806: solved the small bug of : Location Not Found Pop Up
2022-02-13 22:49:49 +09:00
Devarsh Mavani
ab6bd8a682
Make caption field single line Issue#4795 (#4811) 2022-02-13 22:10:42 +09:00
Madhur Gupta
7afd0e843b
Add ExploreFragment Unit Tests (#4809) 2022-02-13 16:28:56 +10:00
Madhur Gupta
bababe757e
Add ExploreListRootFragment Unit Tests (#4810) 2022-02-13 16:25:15 +10:00
translatewiki.net
9f09b1353b Localisation updates from https://translatewiki.net. 2022-02-10 13:01:53 +01:00
Kaartic Sivaraam
e6c64b9368
GitHub issue forms (#4804)
* .github: move pull request template into .github directory

This keeps it out of the root directory. The main intention is
that keeping it out-of-root helps give it less attention which
is enough for the template.

* .github: add a issue form template for the app

This is based on the exisitng issue template of the app. It has
some additional tweaks done to update stale information.

* .github: add some more issue templates
2022-02-10 17:05:32 +10:00
Madhur Gupta
aab0bc1b36
Add UploadRepository Unit Tests (#4791) 2022-02-09 01:33:16 +10:00
Madhur Gupta
90b8d8c62e
Add CoordinateEditHelper Unit Tests (#4796) 2022-02-09 01:31:01 +10:00
Madhur Gupta
ebcbc6add3
Add DescriptionEditHelper Unit Tests (#4798) 2022-02-09 01:30:37 +10:00
RISHAV GUPTA
9c27f8510d
small changes (#4789) 2022-02-07 23:03:26 +09:00
translatewiki.net
769b295647 Localisation updates from https://translatewiki.net. 2022-02-07 13:01:35 +01:00
Ayan Sarkar
0e4755301e
Nearby tab accessible without GPS (#4771)
* Nearby accessible without GPS

* Java doc added

* Added NearbyParentFragment test

* Test added

* merged two method and tests updates
2022-02-05 21:16:08 +05:30
Ayan Sarkar
e135fea20d
Fixes 1848 : Option for adding location for those pictures which have no location (#4755)
* Location wizard

* Location wizard

* Minor fix

* message changed

* Test fail fixed

* Test fail fixed

* Test fail fixed

* last location triggered

* last location added

* Some test added

* Java docs added

* More java docs added
2022-02-05 09:56:59 +09:00
translatewiki.net
587ff3b54f Localisation updates from https://translatewiki.net. 2022-02-03 13:01:43 +01:00
Madhur Gupta
49274c5dbd
Update CI with latest versions, artifacts and caching (#4785)
* Auto generate apk after build is complete

* Add cache

* Fix syntax error

* Fix syntax error

* Fix artifact name not valid error
2022-02-03 15:52:57 +10:00
Madhur Gupta
ff8f067841
Add Unit Tests for CategoryEditSearchRecyclerViewAdapter (#4775)
* Add Unit Tests for CategoryEditSearchRecyclerViewAdapter

* Use mock context instead of robolectric context
2022-02-02 16:24:32 +10:00
Madhur Gupta
54676ba0d7
Add DescriptionEditActivity Unit Tests (#4773)
* Add DescriptionEditActivity Unit Tests

* Add assertion and verifications
2022-02-02 16:15:55 +10:00
Madhur Gupta
85d309e7eb
Add ReviewControllerTest (#4769)
* Add ReviewControllerTest

* Fix failing build

* Add test to cover more lines

* Add assertion and verifications
2022-02-02 16:14:39 +10:00
Madhur Gupta
9e38c33650
Add some more tests for SearchActivity (#4780) 2022-02-01 19:26:13 +10:00
Madhur Gupta
d77ae8e582
Add some more tests for NearbyController (#4778) 2022-02-01 19:25:49 +10:00
Rishi Kumar Ray
15d70bbe0a
Cancel previous ongoing runs in the PR/branch when you push new commits (#4783)
* added cancel previous build

* updated Cancel Workflow Action

* added cancel previous builds

* reverted unwanted changes
2022-02-01 13:16:15 +05:30
Ratnesh
873b4c500b
Show alert dialog card for sharing personal detail submission via email when clicking on the feedback menu. (#4772)
* Fixes #4732 Show alert dialog card for sharing personal detail submission via email when clicking on feedback menu.

* Show alert dialog card for sharing personal detail submission via email when clicking on feedback menu when user is logged in.

Add javadoc for the new methods
Update alert dialog message.
2022-01-31 23:16:02 +09:00
translatewiki.net
d0e14b7345 Localisation updates from https://translatewiki.net. 2022-01-31 13:01:31 +01:00
translatewiki.net
0042466b56 Localisation updates from https://translatewiki.net. 2022-01-27 13:01:48 +01:00
Ayan Sarkar
f162326e53
Fixed bug (#4763) 2022-01-25 21:38:37 +09:00
translatewiki.net
c637dba6b7 Localisation updates from https://translatewiki.net. 2022-01-24 13:01:53 +01:00
Ayan Sarkar
7e12d28557
Fixes 4497 : this a photo of place X: Do not ask if the item (depiction) is already selected for addition and the photo already has a caption (#4754)
* Dialog can't be dismissed

* Dialog can't be dismissed

* Nearby Place dialog can remember user preference

* Minor change

* Minor change

* Renamed the map
2022-01-20 23:34:44 +09:00
translatewiki.net
9afa686538 Localisation updates from https://translatewiki.net. 2022-01-20 13:01:55 +01:00
Ayan Sarkar
92957f4204
Displaying Category image and Description (#4531)
* API call done

* API call

* Image implementation done

* Gradle

* Java docs and code convention

* Description added

* Refactoring Category

* Refactoring Category

* Refactoring Category

* Description and thumbnail issue fixed

* Description and thumbnail issue fixed

* Minor issue fixed

* Minor issue fixed

* Server changed

* Logo changed

* Change in structure

* Fixed failed tests

* Fixed Test failed

* Optimized imports

* Dialog can't be dismissed

* Dialog can't be dismissed

* Resolved Conflicts

* UI fixed

* Added description and thumbnail in local DB

* Added description and thumbnail in local DB

* Test fixed

* Added

* Updated with latest master

* Test Updated with latest master

* Issue fixed

* Revert gradle changes

* Revert gradle changes

* Update gradle-wrapper.properties

* Require Api removed
2022-01-20 15:19:57 +09:00
Ayan Sarkar
0914eeea53
Fixed #4532 Items media in beta version are showing now (#4551)
* logs

* Issue resolved

* Logs removed

* Beta working

* Production GET call only for fetch images from depicted item

* Code convention maintained

* Code convention maintained

* Test resolved

* Java Docs added

* Quotes added
2022-01-19 18:10:55 +03:00
Pratham Pahariya
7bcaab2442
Fixes #53 - Suggest depicted country based on EXIF latitude/longitude (#4756)
* Fix - Suggest depicted country based on EXIF latitude/longitude

* Added null check and moved country suggestion to the end of the list
2022-01-19 20:28:38 +09:00
translatewiki.net
d7474fc799 Localisation updates from https://translatewiki.net. 2022-01-17 13:01:42 +01:00
translatewiki.net
db4a22d973 Localisation updates from https://translatewiki.net. 2022-01-13 13:01:38 +01:00
translatewiki.net
852d1958e7 Localisation updates from https://translatewiki.net. 2022-01-10 13:01:11 +01:00
Pratham Pahariya
35e9a2c267
added feature thumbnail recyclerview moves corresponding to the current picture (#4748)
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2022-01-06 21:48:09 +09:00
translatewiki.net
81cadf09dd Localisation updates from https://translatewiki.net. 2022-01-06 13:01:15 +01:00
translatewiki.net
f4ffcf1868 Localisation updates from https://translatewiki.net. 2022-01-03 13:01:17 +01:00
Pratham Pahariya
06a347eee1
Fixes #4543 - Language selection: Search (#4744)
* initial changes

* add search feature for selecting language

* add search feature for selecting language

* upload issue fix

* minor improvement

* added test and updated settings language selection ui

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-12-31 19:33:36 +09:00
translatewiki.net
fcb7ccae3c Localisation updates from https://translatewiki.net. 2021-12-30 13:01:20 +01:00
Ayan Sarkar
38ed364423
Added bookmark Wikidata items option (#4515)
* classes

* Almost done

* All done but build fail

* All done but build fail

* Modifications

* Modifications

* Fixed

* string resource

* minor change

* Maintained code conventions

* Moving

* Exception handled

* id name changed

* Test fail fixed

* Bookmark is available from other activities

* Test fail fixed

* Documentation error fixed

* Test added

* Revert Project_Default.xml

* Minor Change

* Revert changes
2021-12-28 20:15:09 +09:00
translatewiki.net
3c29f45f15 Localisation updates from https://translatewiki.net. 2021-12-27 13:01:33 +01:00
Pratham Pahariya
8a0d5580b2
Fixes #4571 - Nearby: Save last known location and show it immediately without waiting for GPS (#4721)
* save last location feature

* fix lat lng exchange

* removed unnecessary space

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-12-23 17:17:30 +09:00
Ayan Sarkar
8a2c30120d
Fixed 4728 : Suggest User to turn on camera location (#4735)
* Dialog can't be dismissed

* Dialog can't be dismissed

* Suggest users to turn on camera location

* Added safety pattern

* Title removed

* Changed constant
2021-12-22 22:15:58 +09:00
Pratham Pahariya
d8bfd1ffc5
fix achievement zero issue (#4737)
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-12-22 17:51:43 +09:00
KhyatiSaini
d38c3f1427
unformatted search text field for depicts and categories search field of upload wizard (#4724)
* unformatted search text field for depicts and categories search field of upload wizard

* fix tests by declaring search text field of type PasteSensitiveTextInputEditText
2021-12-17 14:02:58 +03:00
translatewiki.net
d834ce3e7e Localisation updates from https://translatewiki.net. 2021-12-16 13:01:36 +01:00
Ashish
a0ff15cdc2
Added advanced query support in Nearby (#4714)
* Added feature for advanced query options in Nearby

* Fix unit-tests coverage

* wip-tests

* Added log to identify if the nearby request is via an advanced query

* Rolledback test-dependency updates

* Fix tests

* build fix

* Added basic tests for relevant method in OkHttpJsonApiClient & NearbyController

* Added NearbyParentFragmentPresenter Tests

* Added AdvancedQueryFragment Unit Tests

* Added more tests for NearbyParentFragmentPresenter

* Reset ContributionsFragment with Upstream

* Overload method loadNearbyPlaces for CustomQuery

* Added more tests

* Added more tests

* Fixed tests for NearbyParentFragmentPresenter
2021-12-14 01:41:33 +10:00
Pratham Pahariya
bd00ce2071
fix-issue-4215 (#4729)
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-12-13 17:44:14 +05:30
translatewiki.net
01f6a2b8cb Localisation updates from https://translatewiki.net. 2021-12-13 13:01:48 +01:00
Ayan Sarkar
bf74da7b5d
Fixed 4718 : After uploading by sharing an image from gallery the app returns to contributions tab (#4727)
* Dialog can't be dismissed

* Dialog can't be dismissed

* UploadActivity returns to MainActivity
2021-12-12 21:23:30 +09:00
Prince kushwaha
b7be49333d
rename toolbar name Favorites to Bookmarks (#4717)
* rename toolbar name Favorites to Bookmarks

* fix issue

* fix string.xml file
2021-12-10 15:35:44 +03:00
Ayan Sarkar
674b033d32
"Starting uploads" notification is cleaned up when "Finishing uploads" notification pops up (#4719)
* Dialog can't be dismissed

* Dialog can't be dismissed

* Cleaned up "starting upload" notification before finishing starts
2021-12-10 02:56:55 +03:00
Paul Hawke
8c573eda26
Moved the PagedSearchCategoriesAdapter to use view binding (#4702) 2021-12-09 17:28:45 +03:00
Ayan Sarkar
dcbf57f712
Fixed 4703: Next button is not clickable while background task is going on (#4705)
* Dialog can't be dismissed

* Dialog can't be dismissed

* Dialog can't be dismissed
2021-12-09 17:24:28 +03:00
Mateusz Konieczny
d5ceb844e4
add badge counting good first issues (#4708)
fixes  #4696

note, I know nothing about trustworthiness of this service but readme is already using it anyway, so things are not made worse by this PR
2021-12-09 16:55:51 +03:00
Prince kushwaha
d4c7ec3a2e
added ReviewImageFragment Unittest (#4413)
* added ReviewImageFragment Unittest

* fix Unit test
2021-12-09 16:24:08 +03:00
Ashish
b373617a68
Fixes #4682 - Removed read_phone_state_permission (#4723) 2021-12-09 15:42:08 +03:00
translatewiki.net
d8f7d89a59 Localisation updates from https://translatewiki.net. 2021-12-09 13:01:55 +01:00
Madhur Gupta
d1bf6d0e1d
Add CommonPlaceClickActions Unit Tests (#4674) 2021-12-06 23:28:58 +03:00
Ayan Sarkar
0269894c64
Fix 4615: Option for editing caption and description (#4672)
* DescriptionEditHelper implemented

* Description extracted

* Description editable

* No description condition handled

* Code cleanup

* Added javadocs

* toolbar added

* API call done

* Caption edit available

* Progress dialog added

* Log

* Problem with ButterKnife

* Caption is editable

* Removed unused import

* Manifest file reverted

* Manifest file reverted

* Manifest file reverted

* View binding added

* Post operation test added

* Java docs added

* Java docs added

* MediaDetailFragment unit tests added

* Test added
2021-12-06 22:50:54 +03:00
dado1111
e910b1d14f
Pasted text should have fonts unified (for Caption/Description) (#4667)
* Changed hardcoded "More" to getStrings(R.string.more) for Unlogged user
- MainActivity toolbar showed "More" when clicked on More options
   in other language than English

* Changed hardcoded "More" to getStrings(R.string.more) for Logged user
- MainActivity toolbar showed "More" when clicked on More options
   in other language than English

* Added test for: MainActivity.setUpPager

* Pasted text is now unformatted for caption and description

* Removed other branch contribution

* Added test

* Rename .java to .kt

* Test from Java to Kotlin; +small fix

* PasteSensitiveTextInputEditTextTest - updated
2021-12-06 21:59:44 +03:00
Shreyas Bansode
ad0aa7d4ea
Tap to view fails issue resolved (#4656)
* upload fail tap to view fixed

* clean code

* added function documentation

* requested changes
2021-12-06 21:22:13 +03:00
translatewiki.net
5a2270b03a Localisation updates from https://translatewiki.net. 2021-12-06 13:01:27 +01:00
translatewiki.net
dcc0e3f3f4 Localisation updates from https://translatewiki.net. 2021-12-02 13:01:42 +01:00
translatewiki.net
a9b701bfe7 Localisation updates from https://translatewiki.net. 2021-11-29 13:01:13 +01:00
translatewiki.net
ab9e3e44a6 Localisation updates from https://translatewiki.net. 2021-11-25 13:01:42 +01:00
translatewiki.net
f1a057a06e Localisation updates from https://translatewiki.net. 2021-11-18 13:01:56 +01:00
translatewiki.net
97eca1c0df Localisation updates from https://translatewiki.net. 2021-11-15 13:01:52 +01:00
translatewiki.net
7cece7f0ef Localisation updates from https://translatewiki.net. 2021-11-11 13:01:18 +01:00
translatewiki.net
67caafbd88 Localisation updates from https://translatewiki.net. 2021-11-08 13:02:11 +01:00
Wojuola Ayotola
e297f6c240
**Increased number of leaderboard records fetched in a single request from API** (#4697)
Fixes #4372

What changes did you make and why?
Increased number of leaderboard records fetched in a single request from API

**Tests performed (required)**

Tested ProdDebug on Pixel 4 XL with API level 31.
2021-11-06 19:42:19 +05:30
Kasina Dheeraj
f5200d5bca
fix: Width of Rank has been increased so that it can accommodate ranks above 3 digits. (#4695) 2021-11-06 19:36:02 +05:30
Madhur Gupta
5535353480
Add RecentSearchesFragment Unit Tests (#4675) 2021-11-06 12:57:23 +03:00
Paul Hawke
462a2ac007
Converted the DepictionAdapter to use ViewBinding (#4689) 2021-11-06 12:51:13 +03:00
translatewiki.net
eb8882ab48 Localisation updates from https://translatewiki.net. 2021-11-04 13:01:30 +01:00
translatewiki.net
7bce3d4c0d Localisation updates from https://translatewiki.net. 2021-11-01 13:01:25 +01:00
Ashish
b4bfc6c5a3
Fixes #4447 1. Updated SDK version to 30 2. Updated WorkManager's version (#4677) (#4692) 2021-10-28 16:12:25 +10:00
KasinaDheeraj
ce8d10ea8f
fix: Cleanup of unnecessary empty file (#4691) 2021-10-27 20:01:41 +05:30
codingtosh
55c0b07ebf
[Contributions-Tab] Scroll to top on NavBar Button Pressed (#4668)
* [Contributions-Tab] Scroll to top on NavBar Button Pressed

On NavBar Contributions Button pressed, if already on the Contributions tab,
scroll to the top of the recyclerView in ContributionsListFragment.

* [UnitTest][Contributions-Tab] Scroll to Top on NavBar Button Pressed
2021-10-27 19:56:16 +05:30
Ashish
88b21a678e
Fixes #3389 - Show User profiles (#4678)
* Fixes #3389 - Show  User profiles

* Don't show dummy achievements data - show data only when loaded
2021-10-25 23:40:08 +03:00
Madhur Gupta
7ce80aa804
Add DepictsFragment Unit Tests and update tests dependencies (#4688)
* Add DepictsFragment Unit Tests and update tests dependencies

* Attempt to fix CI
2021-10-25 23:31:59 +03:00
Paul Hawke
3dcd271980
Swapped over to the ViewBinding version of adapterdelegates4 (#4687) 2021-10-25 23:08:55 +03:00
translatewiki.net
8168f454ed Localisation updates from https://translatewiki.net. 2021-10-25 13:02:15 +02:00
Ronak Upadhyay
9e12f9305e
Removed duplicate INTERNET Permission in Manifest file (#4685) 2021-10-23 10:49:58 +05:30
Paul Hawke
3e656b0c23
Converted the WikipediaInstructionsDialogFragment to use viewbinding, along with a cleaner way to build bundle arguments for the fragment (#4684) 2021-10-22 14:16:46 +03:00
Madhur Gupta
6da3c78d7d
Add view binding dependency and example (#4681)
* Add view binding dependency and example

* Add comments

* Minor change in a comment
2021-10-21 14:57:35 +03:00
translatewiki.net
a9a2565ea3 Localisation updates from https://translatewiki.net. 2021-10-21 13:01:24 +02:00
translatewiki.net
d7c487834a Localisation updates from https://translatewiki.net. 2021-10-18 13:01:49 +02:00
dado1111
6649da88a5
Clicking "More" on tabLayout caused it to be displayed on toolbar (in any other language than English) (#4666)
* Changed hardcoded "More" to getStrings(R.string.more) for Unlogged user
- MainActivity toolbar showed "More" when clicked on More options
   in other language than English

* Changed hardcoded "More" to getStrings(R.string.more) for Logged user
- MainActivity toolbar showed "More" when clicked on More options
   in other language than English

* Added test for: MainActivity.setUpPager
2021-10-17 13:54:18 +05:30
Ayan Sarkar
6978d00926
Fix 4511 Update Nearby list according to chip state (#4605)
* Exists and Need Photo list updated

* WLM filter added

* Minor bug fix nad code convention

* Code clean up

* Renamed NeedsPhoto and isExists
2021-10-15 18:53:35 +03:00
Madhur Gupta
401f70cf12
Fix scoped storage issue (#4613) 2021-10-14 23:28:29 +03:00
Madhur Gupta
52b05f75e8
Codecov Uploader Update (#4673)
* Update codecov uploader and fix di folder for jacoco

* Fix codecov uploader
2021-10-14 23:19:58 +03:00
BashCache
ba85958eda
Changed import statements from junit.framework to org.junit (#4650)
* Changed import statements from junit.framework to org.junit

* Replced deprecated assertequals for 2 doubles by adding a third parameter delta. Used hamcrest.MatcherAssert instead of junit.Assert
2021-10-14 23:18:29 +03:00
translatewiki.net
fa3c17280d Localisation updates from https://translatewiki.net. 2021-10-11 13:01:47 +02:00
translatewiki.net
7ab561f238 Localisation updates from https://translatewiki.net. 2021-10-07 13:01:29 +02:00
Yuhui Su
a99ae9d6c2
Made the login page scrollable (#4549)
* make the login page scrollable

* another modification to the login page
2021-10-07 13:24:19 +03:00
Jose Mora
a687046c02
fixed issue #4500 coordinate edit button should be hidden if login skipped (#4662) 2021-10-07 12:54:39 +03:00
translatewiki.net
c42edf0379 Localisation updates from https://translatewiki.net. 2021-10-04 13:01:39 +02:00
translatewiki.net
a6e37ac3ba Localisation updates from https://translatewiki.net. 2021-09-30 13:01:18 +02:00
jeremybowenn
07bf708fa6
Disabling the managed exifs tab if the user isn't logged in (#4579) 2021-09-29 18:24:43 +03:00
translatewiki.net
5f53a538d7 Localisation updates from https://translatewiki.net. 2021-09-27 13:01:52 +02:00
Madhur Gupta
a82745d07a
Ignore failing test (#4646) 2021-09-24 00:21:03 +05:30
pratik2315
dff6268a55
Added multi-file picker functionality for the WLM (#4637)
* Added multi-file picker functionality for the WLM

* Added multi-file picker functionality for the WLM

* Added multi-file picker functionality for the WLM

* Added multi-file picker functionality for the WLM
2021-09-23 19:27:44 +05:30
translatewiki.net
aa6f965c54 Localisation updates from https://translatewiki.net. 2021-09-23 13:01:42 +02:00
Madhur Gupta
457b03b7cb
Update file filters (#4640) 2021-09-22 01:37:42 +10:00
JAI
18b3e50c15
Update fragment_search_paginated.xml (#4576) 2021-09-21 12:23:19 +03:00
Madhur Gupta
82df881ebc
Remove Travis CI (#4641) 2021-09-21 11:38:01 +03:00
Jose Mora
b9273b063c
fixed issue #4590 fab of custom selector is still open after uploading (#4628) 2021-09-20 17:35:36 +03:00
Madhur Gupta
b1f06ad9bc
Update jacoco and github actions (#4639)
* Fix jacoco setup

* Fix task name

* Update CI yml file for codecov

* Fix syntax error

* Use all branch instead of just master

* Fix report upload issue

* Remove returnDefaultValues

* Add Github Action and Codecov badge
2021-09-20 22:39:54 +10:00
translatewiki.net
fea5abd802 Localisation updates from https://translatewiki.net. 2021-09-20 13:01:39 +02:00
Madhur Gupta
bd7fea8fa2
Add UploadActivity Unit Tests (#4636)
* Add UploadActivity Unit Tests

* Fix failing issue
2021-09-20 17:02:06 +10:00
Madhur Gupta
388e8286bc
Add LeaderboardFragment Unit Tests (#4635)
* Add LeaderboardFragment Unit Tests

* Add LeaderboardListAdapter Unit Tests
2021-09-20 17:01:54 +10:00
Madhur Gupta
e212caf30e
Add SettingsFragment Unit Tests (#4634)
* Add more Unit Tests for SettingsActivity

* Add SettingsFragment Unit Tests
2021-09-20 17:00:53 +10:00
Madhur Gupta
121119a358
Add some more Nearby Unit Tests (#4633) 2021-09-20 17:00:36 +10:00
Madhur Gupta
07d170a79c
Add MediaDetailFragment Unit Tests (#4632)
* Add MediaDetailFragment Unit Tests

* Add ZoomableActivity Unit Tests
2021-09-20 17:00:27 +10:00
Adam Jones
fb634934b9
Remove ignored lint rules (#4621)
We don't do anything about these ones, and they just clutter the logs making important stuff much harder to find (as agreed in #2823 and #4077).

We already use IntelliJ's inspections feature to replace the need for this.
2021-09-20 16:59:57 +10:00
Ashish
7476b0a24d
Merge changes from 3.1-release (#4629)
* Cherry-Picked NPE fix from master (#4569)

* Fix notification bug #4547 (#4570)

* Make Single Query for Nearby and WLM pins (#4573)

* Merge nearby and monument queries

* Bug Fix- query resource path change on shouldQueryForMonuments

* Bug Fixes
1. Propagate exceptions for nearby API calls to caller
2. Fix too much work on main thread exception in NearbyParentFragment

* Modify parameters for Nearby query

* Bug fix- current location marker (#4580)

* Move WLM template below geolocation template (#4582)

* Modify string for WLM upload notice

* Fix bug #4583 (#4591)

* Fix bug #4585 by updating kotlin and acra version (#4592)

* Fixes #4554 - only use WLM2021 template for countries that are included in it (#4574)

* Fixes #4554
1. For WLM uploads reverse geo code and see if the country code is supported -only then is the WLM upload flow triggered, otherwise usual nearby uploads happen
2. Bug Fix - Current Location marker and area

* Fixed compile error added after rebasing

* Bug fix for country code in reverse geo code

* Update WLM camaign dates [Do not merge now, merge only after alpha release] (#4584)

* Updates dates for WML campaign

* Bug fix- campaign dates

* Fixed logic for WLM enablement - stick to the month of September

* Add countries supported by WLM2021 template, except Italy

* Versioning for v3.1.0

* Update changelog.md

* Fix empty default lang bug (#4608)

* Fix bug #4583

* Fix empty default lang bug

* Fixes #4595 - Updated nearby query (#4622)

* Fixes #4595 - Updated nearby query

* Removed logic to replace local language in nearby query - that might acccidentally replace other strings

* Fetch property location in usual nearby query

* Remove duplicate line (#4626)

* Change "learn more" link to new wiki

* Add Sweden's P3426 to property filter

* Fixes #4601 - 1. Handle possible exceptions in upload file from stash 2. Modify MWException, as error is nullable, update getTitle and getMessage to rever that (#4627)

* Versioning for v3.1.1

* Update changelog.md

* Updated DB version to rever integrity

Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
2021-09-16 23:09:29 +10:00
translatewiki.net
b91222329e Localisation updates from https://translatewiki.net. 2021-09-16 13:01:28 +02:00
translatewiki.net
5337ca7cc7 Localisation updates from https://translatewiki.net. 2021-09-13 13:01:25 +02:00
translatewiki.net
ac842c78c0 Localisation updates from https://translatewiki.net. 2021-09-09 13:01:22 +02:00
Madhur Gupta
76e48a0616
Add WikidataItemDetailsActivity Unit Tests (#4618) 2021-09-08 15:48:26 +10:00
Madhur Gupta
4d2487dcc9
Add ContributionViewHolder Unit Tests (#4612) 2021-09-07 17:01:08 +10:00
translatewiki.net
7eab53afa8 Localisation updates from https://translatewiki.net. 2021-09-06 13:01:34 +02:00
translatewiki.net
2100701be7 Localisation updates from https://translatewiki.net. 2021-09-02 13:01:43 +02:00
translatewiki.net
f902270fb4 Localisation updates from https://translatewiki.net. 2021-08-30 13:02:17 +02:00
translatewiki.net
979b4f36d9 Localisation updates from https://translatewiki.net. 2021-08-26 13:02:22 +02:00
translatewiki.net
b977571bd6 Localisation updates from https://translatewiki.net. 2021-08-23 13:01:39 +02:00
Ashish
a1ed4142bb
Bug Fix in uploads - null checks for Wikidata Place (#4567)
Fixes #4565
2021-08-20 09:35:41 +09:00
Aditya-Srivastav
6d073d25a3
[GSoC] Update Dialog and Fix failing tests (#4564)
* Update Dialog and Fix failing tests

* Dialog Fix
2021-08-19 18:26:45 +05:30
translatewiki.net
68f2b65c5b Localisation updates from https://translatewiki.net. 2021-08-19 13:01:38 +02:00
Madhur Gupta
c1e83d7ee8
Add some more File Picker Unit Tests (#4536)
* Add some more File Picker Unit Tests

* Fix failing test

* Fix syntax error
2021-08-19 02:32:40 +10:00
Nicolas Raoul
c6f4649fcf
GSoC 2021 custom picture selector (#4534)
* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* [GSoC] Image Selection (#4457)

* Localisation updates from https://translatewiki.net.

* Fixes #4357  After switching to different account, contributions screen shows pictures of previous account (#4421)

* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>

* Remove unnecessary whitespace from a message (#4439)

* Merge v3.0.1 into master (#4446)

* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>

* Localisation updates from https://translatewiki.net.

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Added a feature for editing coordinates (#4418)

* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed

* Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)

* Localisation updates from https://translatewiki.net.

* Fixes 4344 - Duplicate Uploads (#4442)

* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed

* Image selection added

* Forwarded activity result to upload wizard

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Image selection added

* Forwarded activity result to upload wizard

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* fixed merge errors

* Documented the remaining function

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>

* [GSoC] Show uploaded images differently. (#4464)

* uploaded images shown differently

* Loaded images before query

* Handled exceptions, Made ImageLoader injectable, Document and clean code

* [GSoC] Added Uploaded status table in room database. (#4476)

* added Uploaded status table in room database

* Added unique property, minor refractoring

* Database intigrated

* Database integrated

* Handled result null exception

* Exceptions handled and refractored

* Introduced constants

* moved to sealed class

* No database insert on network error

* queried original image

* documented the code

* Updated uploaded status on upload success

* Image Helper test (#4485)

* [GSoC] Adapter Tests (#4488)

* Added FolderAdapterTest

* Image Adapter Test

* [GSoC] Master rebase. (#4505)

* Localisation updates from https://translatewiki.net.

* Fixes #4357  After switching to different account, contributions screen shows pictures of previous account (#4421)

* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>

* Remove unnecessary whitespace from a message (#4439)

* Merge v3.0.1 into master (#4446)

* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>

* Localisation updates from https://translatewiki.net.

* Added a feature for editing coordinates (#4418)

* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed

* Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)

* Localisation updates from https://translatewiki.net.

* Fixes 4344 - Duplicate Uploads (#4442)

* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed

* Fixes #3694 Pre-select places as depictions (#4452)

* WikidataEditService: stop automatically adding WikidataPlace as a depiction

When the user initiates the upload process from Nearby and also manually adds the place as a depiction, the depiction is added twice. Since this behavior is invisible to the user, it is being removed in preparation for auto-selecting the place as a depiction on the DepictsFragment screen.

* DepictsFragment: auto-select place as a depiction

Pass the Place reference from UploadActivity to DepictsFragment and select the corresponding DepictedItem. Using the place id, retrieve the corresponding Entity to create and select a DepictedItem.

* UploadRepository: use Place from UploadItem to obtain a DepictedItem

Instead of passing a Place object from UploadActivity to DepictsFragment and then passing the Place object up the chain to obtain and select a DepictedItem, retrieve the Place object directly within UploadRepository

* DepictsFragment: select Place depiction when fragment becomes visible

* UploadDepictsAdapter: make adapter aware of selection state

Update selection state when recycled list items are automatically selected, preventing automatically selected items from appearing as unselected until they are forced to re-bind (i.e. after scrolling)

* DepictsFragment: pre-select place depictions for all UploadItems

If several images are selected and set to different places, pre-select all place depictions to reinforce the intended upload workflow philosophy (i.e. all images in a set are intended to be from/of the same place). See discussion in commons-app/apps-android-commons#3694

* DepictsFragment: scroll to the top every time list is updated

* Typo fixes (#4461)

* Fixed typo on class documentation of TextUtils

* corrected comma placement in documentation

* Fixed typos in comments

* fix-issue-4424 (#4445)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* fix edit categories ui (#4414)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fix doom version issue (#4463)

* Update db version

* DBOpenHelper version update

* fix :Back Pressed Event not work in Explore tab when user not login (#4404)

* fix :Back Pressed Event not work in Explore tab

* minor changes

* fix :Upload count or number of contribution does not get updated when media  is successful uploaded (#4399)

* * fix:Number of Contributions not updated
 * Add javadocs

* minor changes

* made minor changes

* String was nonsense and untranslatible, fixed (#4466)

* Ability to show captions and descriptions in all entered languages (#4355)

* implement Ability to show captions and descriptions in all entered languages
*Add Javadoc

* handle Back event of fragment(mediaDetailFragment)

* fix minor bugs

* add internationalization

* revert previous changes

* fix visibility bug

* resolve conflict

* Fixes #4437 - Changed indentation on files with 2 spaces to 4 spaces (#4462)

* Edited Project.xml to make indent size 4

* Changed files with 2 space indentation to use 4 space indentation

* Edited Project.xml to make indent size 4

* changed files with 2 space indent to 4 space indent

* fix :Back Pressed Event not work in Explore tab when user not login (#4404)

* fix :Back Pressed Event not work in Explore tab

* minor changes

* fix :Upload count or number of contribution does not get updated when media  is successful uploaded (#4399)

* * fix:Number of Contributions not updated
 * Add javadocs

* minor changes

* made minor changes

* String was nonsense and untranslatible, fixed (#4466)

* Ability to show captions and descriptions in all entered languages (#4355)

* implement Ability to show captions and descriptions in all entered languages
*Add Javadoc

* handle Back event of fragment(mediaDetailFragment)

* fix minor bugs

* add internationalization

* revert previous changes

* fix visibility bug

* resolve conflict

Co-authored-by: Prince kushwaha <65972015+Prince-kushwaha@users.noreply.github.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>

* Use more understandable strings (#4470)

* Fix #3792 Missing Column Issue (#4468)

* Fix Missing Column Issue

* Fix tests

* Add UploadCategoriesFragment Unit Tests (#4473)

* Panorama (#4467)

* panoramic images fixed

* made requested changes

* Minor refactoring

Co-authored-by: Aditya Srivastava <iamaditya2009@gmail.com>

* Localisation updates from https://translatewiki.net.

* Main activity title is sometimes "Contributions", sometimes "Commons" (#4472)

Fixes #4438  Replace == with equals() in onRestoreInstanceState

* Localisation updates from https://translatewiki.net.

* caption and description copyable (#4481)

* Removed next button in quiz (#4382)

* issues resolved

* modification done

* warning fixed

* issues resolved

* Button added

* don't know function added

* Button added

* modification done

* modification done

* Localisation updates from https://translatewiki.net.

* Added option to show and modify location while uploading (#4475)

* initial commit

* Everything done

* minor modification

* minor modification

* Issues fixed

* minor modifications

* issue fixed

* Issues fixed

* Tutorial removed from log out state (#4479)

* tutorial removed from log out state

* Issue removed

* Update changelog.md

* Versioning for v3.0.2

* Fix #4482 (#4484)

* Fix crash when image resolution is very high (#4483)

* Localisation updates from https://translatewiki.net.

* Add Contributions Fragment Unit Tests (#4490)

* Fix Tests Errors (#4491)

* Add UploadMediaDetailFragment Unit Tests (#4492)

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* [GSoC] Image Selection (#4457)

* Localisation updates from https://translatewiki.net.

* Fixes #4357  After switching to different account, contributions screen shows pictures of previous account (#4421)

* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>

* Remove unnecessary whitespace from a message (#4439)

* Merge v3.0.1 into master (#4446)

* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>

* Localisation updates from https://translatewiki.net.

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Added a feature for editing coordinates (#4418)

* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed

* Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)

* Localisation updates from https://translatewiki.net.

* Fixes 4344 - Duplicate Uploads (#4442)

* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed

* Image selection added

* Forwarded activity result to upload wizard

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Image selection added

* Forwarded activity result to upload wizard

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* fixed merge errors

* Documented the remaining function

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>

* [GSoC] Show uploaded images differently. (#4464)

* uploaded images shown differently

* Loaded images before query

* Handled exceptions, Made ImageLoader injectable, Document and clean code

* [GSoC] Added Uploaded status table in room database. (#4476)

* added Uploaded status table in room database

* Added unique property, minor refractoring

* Database intigrated

* Database integrated

* Handled result null exception

* Exceptions handled and refractored

* Introduced constants

* moved to sealed class

* No database insert on network error

* queried original image

* documented the code

* Updated uploaded status on upload success

* Image Helper test (#4485)

* [GSoC] Adapter Tests (#4488)

* Added FolderAdapterTest

* Image Adapter Test

* merge fix

* rebase fix

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>
Co-authored-by: Brigham Byerly <6891883+byerlyb20@users.noreply.github.com>
Co-authored-by: Jamie Brown <jamiejbrown521@gmail.com>
Co-authored-by: Prince kushwaha <65972015+Prince-kushwaha@users.noreply.github.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
Co-authored-by: Ashar <asharalikhan200@gmail.com>

* [GSoC] Custom Selector Tests (#4494)

* Localisation updates from https://translatewiki.net.

* Fixes #4357  After switching to different account, contributions screen shows pictures of previous account (#4421)

* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>

* Remove unnecessary whitespace from a message (#4439)

* Merge v3.0.1 into master (#4446)

* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>

* Localisation updates from https://translatewiki.net.

* Added a feature for editing coordinates (#4418)

* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed

* Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)

* Localisation updates from https://translatewiki.net.

* Fixes 4344 - Duplicate Uploads (#4442)

* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed

* Fixes #3694 Pre-select places as depictions (#4452)

* WikidataEditService: stop automatically adding WikidataPlace as a depiction

When the user initiates the upload process from Nearby and also manually adds the place as a depiction, the depiction is added twice. Since this behavior is invisible to the user, it is being removed in preparation for auto-selecting the place as a depiction on the DepictsFragment screen.

* DepictsFragment: auto-select place as a depiction

Pass the Place reference from UploadActivity to DepictsFragment and select the corresponding DepictedItem. Using the place id, retrieve the corresponding Entity to create and select a DepictedItem.

* UploadRepository: use Place from UploadItem to obtain a DepictedItem

Instead of passing a Place object from UploadActivity to DepictsFragment and then passing the Place object up the chain to obtain and select a DepictedItem, retrieve the Place object directly within UploadRepository

* DepictsFragment: select Place depiction when fragment becomes visible

* UploadDepictsAdapter: make adapter aware of selection state

Update selection state when recycled list items are automatically selected, preventing automatically selected items from appearing as unselected until they are forced to re-bind (i.e. after scrolling)

* DepictsFragment: pre-select place depictions for all UploadItems

If several images are selected and set to different places, pre-select all place depictions to reinforce the intended upload workflow philosophy (i.e. all images in a set are intended to be from/of the same place). See discussion in commons-app/apps-android-commons#3694

* DepictsFragment: scroll to the top every time list is updated

* Typo fixes (#4461)

* Fixed typo on class documentation of TextUtils

* corrected comma placement in documentation

* Fixed typos in comments

* fix-issue-4424 (#4445)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* fix edit categories ui (#4414)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fix doom version issue (#4463)

* Update db version

* DBOpenHelper version update

* fix :Back Pressed Event not work in Explore tab when user not login (#4404)

* fix :Back Pressed Event not work in Explore tab

* minor changes

* fix :Upload count or number of contribution does not get updated when media  is successful uploaded (#4399)

* * fix:Number of Contributions not updated
 * Add javadocs

* minor changes

* made minor changes

* String was nonsense and untranslatible, fixed (#4466)

* Ability to show captions and descriptions in all entered languages (#4355)

* implement Ability to show captions and descriptions in all entered languages
*Add Javadoc

* handle Back event of fragment(mediaDetailFragment)

* fix minor bugs

* add internationalization

* revert previous changes

* fix visibility bug

* resolve conflict

* Fixes #4437 - Changed indentation on files with 2 spaces to 4 spaces (#4462)

* Edited Project.xml to make indent size 4

* Changed files with 2 space indentation to use 4 space indentation

* Edited Project.xml to make indent size 4

* changed files with 2 space indent to 4 space indent

* fix :Back Pressed Event not work in Explore tab when user not login (#4404)

* fix :Back Pressed Event not work in Explore tab

* minor changes

* fix :Upload count or number of contribution does not get updated when media  is successful uploaded (#4399)

* * fix:Number of Contributions not updated
 * Add javadocs

* minor changes

* made minor changes

* String was nonsense and untranslatible, fixed (#4466)

* Ability to show captions and descriptions in all entered languages (#4355)

* implement Ability to show captions and descriptions in all entered languages
*Add Javadoc

* handle Back event of fragment(mediaDetailFragment)

* fix minor bugs

* add internationalization

* revert previous changes

* fix visibility bug

* resolve conflict

Co-authored-by: Prince kushwaha <65972015+Prince-kushwaha@users.noreply.github.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>

* Use more understandable strings (#4470)

* Fix #3792 Missing Column Issue (#4468)

* Fix Missing Column Issue

* Fix tests

* Add UploadCategoriesFragment Unit Tests (#4473)

* Panorama (#4467)

* panoramic images fixed

* made requested changes

* Minor refactoring

Co-authored-by: Aditya Srivastava <iamaditya2009@gmail.com>

* Localisation updates from https://translatewiki.net.

* Main activity title is sometimes "Contributions", sometimes "Commons" (#4472)

Fixes #4438  Replace == with equals() in onRestoreInstanceState

* Localisation updates from https://translatewiki.net.

* caption and description copyable (#4481)

* Removed next button in quiz (#4382)

* issues resolved

* modification done

* warning fixed

* issues resolved

* Button added

* don't know function added

* Button added

* modification done

* modification done

* Localisation updates from https://translatewiki.net.

* Added option to show and modify location while uploading (#4475)

* initial commit

* Everything done

* minor modification

* minor modification

* Issues fixed

* minor modifications

* issue fixed

* Issues fixed

* Tutorial removed from log out state (#4479)

* tutorial removed from log out state

* Issue removed

* Update changelog.md

* Versioning for v3.0.2

* Fix #4482 (#4484)

* Fix crash when image resolution is very high (#4483)

* Localisation updates from https://translatewiki.net.

* Add Contributions Fragment Unit Tests (#4490)

* Fix Tests Errors (#4491)

* Add UploadMediaDetailFragment Unit Tests (#4492)

* Localisation updates from https://translatewiki.net.

* Folder Fragment test

* Folder Fragment test done

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* [GSoC] Image Selection (#4457)

* Localisation updates from https://translatewiki.net.

* Fixes #4357  After switching to different account, contributions screen shows pictures of previous account (#4421)

* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>

* Remove unnecessary whitespace from a message (#4439)

* Merge v3.0.1 into master (#4446)

* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>

* Localisation updates from https://translatewiki.net.

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Added a feature for editing coordinates (#4418)

* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed

* Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)

* Localisation updates from https://translatewiki.net.

* Fixes 4344 - Duplicate Uploads (#4442)

* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed

* Image selection added

* Forwarded activity result to upload wizard

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Image selection added

* Forwarded activity result to upload wizard

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* fixed merge errors

* Documented the remaining function

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>

* [GSoC] Show uploaded images differently. (#4464)

* uploaded images shown differently

* Loaded images before query

* Handled exceptions, Made ImageLoader injectable, Document and clean code

* [GSoC] Added Uploaded status table in room database. (#4476)

* added Uploaded status table in room database

* Added unique property, minor refractoring

* Database intigrated

* Database integrated

* Handled result null exception

* Exceptions handled and refractored

* Introduced constants

* moved to sealed class

* No database insert on network error

* queried original image

* documented the code

* Updated uploaded status on upload success

* Image Helper test (#4485)

* [GSoC] Adapter Tests (#4488)

* Added FolderAdapterTest

* Image Adapter Test

* Folder Fragment test

* Folder Fragment test done

* Fragment test complete

* Added Custom Selector View Model Test

* ImageFileLoaderTest

* Update strings.xml

* Custom Selector Activiy test

* Image Loader Test

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>
Co-authored-by: Brigham Byerly <6891883+byerlyb20@users.noreply.github.com>
Co-authored-by: Jamie Brown <jamiejbrown521@gmail.com>
Co-authored-by: Prince kushwaha <65972015+Prince-kushwaha@users.noreply.github.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
Co-authored-by: Ashar <asharalikhan200@gmail.com>

* Image Loader Improvements (#4516)

* ImageLoader Test Updated (#4517)

* [GSoC] Improvement and bug Fixes (#4522)

* Improvement and bug Fixes

* fixed ellipsize

* Saving selector state (#4526)

* [GSoC] Saved Image Fragment Scroll State (#4528)

* Saved Image Fragment Scroll State

* Fix delete image

* Fixed Delete bug

* Changed custom selector icon

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* [GSoC] Image Selection (#4457)

* Localisation updates from https://translatewiki.net.

* Fixes #4357  After switching to different account, contributions screen shows pictures of previous account (#4421)

* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>

* Remove unnecessary whitespace from a message (#4439)

* Merge v3.0.1 into master (#4446)

* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>

* Localisation updates from https://translatewiki.net.

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Added a feature for editing coordinates (#4418)

* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed

* Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)

* Localisation updates from https://translatewiki.net.

* Fixes 4344 - Duplicate Uploads (#4442)

* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed

* Image selection added

* Forwarded activity result to upload wizard

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Image selection added

* Forwarded activity result to upload wizard

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* fixed merge errors

* Documented the remaining function

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>

* [GSoC] Show uploaded images differently. (#4464)

* uploaded images shown differently

* Loaded images before query

* Handled exceptions, Made ImageLoader injectable, Document and clean code

* [GSoC] Added Uploaded status table in room database. (#4476)

* added Uploaded status table in room database

* Added unique property, minor refractoring

* Database intigrated

* Database integrated

* Handled result null exception

* Exceptions handled and refractored

* Introduced constants

* moved to sealed class

* No database insert on network error

* queried original image

* documented the code

* Updated uploaded status on upload success

* Image Helper test (#4485)

* [GSoC] Adapter Tests (#4488)

* Added FolderAdapterTest

* Image Adapter Test

* [GSoC] Master rebase. (#4505)

* Localisation updates from https://translatewiki.net.

* Fixes #4357  After switching to different account, contributions screen shows pictures of previous account (#4421)

* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>

* Remove unnecessary whitespace from a message (#4439)

* Merge v3.0.1 into master (#4446)

* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>

* Localisation updates from https://translatewiki.net.

* Added a feature for editing coordinates (#4418)

* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed

* Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)

* Localisation updates from https://translatewiki.net.

* Fixes 4344 - Duplicate Uploads (#4442)

* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed

* Fixes #3694 Pre-select places as depictions (#4452)

* WikidataEditService: stop automatically adding WikidataPlace as a depiction

When the user initiates the upload process from Nearby and also manually adds the place as a depiction, the depiction is added twice. Since this behavior is invisible to the user, it is being removed in preparation for auto-selecting the place as a depiction on the DepictsFragment screen.

* DepictsFragment: auto-select place as a depiction

Pass the Place reference from UploadActivity to DepictsFragment and select the corresponding DepictedItem. Using the place id, retrieve the corresponding Entity to create and select a DepictedItem.

* UploadRepository: use Place from UploadItem to obtain a DepictedItem

Instead of passing a Place object from UploadActivity to DepictsFragment and then passing the Place object up the chain to obtain and select a DepictedItem, retrieve the Place object directly within UploadRepository

* DepictsFragment: select Place depiction when fragment becomes visible

* UploadDepictsAdapter: make adapter aware of selection state

Update selection state when recycled list items are automatically selected, preventing automatically selected items from appearing as unselected until they are forced to re-bind (i.e. after scrolling)

* DepictsFragment: pre-select place depictions for all UploadItems

If several images are selected and set to different places, pre-select all place depictions to reinforce the intended upload workflow philosophy (i.e. all images in a set are intended to be from/of the same place). See discussion in commons-app/apps-android-commons#3694

* DepictsFragment: scroll to the top every time list is updated

* Typo fixes (#4461)

* Fixed typo on class documentation of TextUtils

* corrected comma placement in documentation

* Fixed typos in comments

* fix-issue-4424 (#4445)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* fix edit categories ui (#4414)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fix doom version issue (#4463)

* Update db version

* DBOpenHelper version update

* fix :Back Pressed Event not work in Explore tab when user not login (#4404)

* fix :Back Pressed Event not work in Explore tab

* minor changes

* fix :Upload count or number of contribution does not get updated when media  is successful uploaded (#4399)

* * fix:Number of Contributions not updated
 * Add javadocs

* minor changes

* made minor changes

* String was nonsense and untranslatible, fixed (#4466)

* Ability to show captions and descriptions in all entered languages (#4355)

* implement Ability to show captions and descriptions in all entered languages
*Add Javadoc

* handle Back event of fragment(mediaDetailFragment)

* fix minor bugs

* add internationalization

* revert previous changes

* fix visibility bug

* resolve conflict

* Fixes #4437 - Changed indentation on files with 2 spaces to 4 spaces (#4462)

* Edited Project.xml to make indent size 4

* Changed files with 2 space indentation to use 4 space indentation

* Edited Project.xml to make indent size 4

* changed files with 2 space indent to 4 space indent

* fix :Back Pressed Event not work in Explore tab when user not login (#4404)

* fix :Back Pressed Event not work in Explore tab

* minor changes

* fix :Upload count or number of contribution does not get updated when media  is successful uploaded (#4399)

* * fix:Number of Contributions not updated
 * Add javadocs

* minor changes

* made minor changes

* String was nonsense and untranslatible, fixed (#4466)

* Ability to show captions and descriptions in all entered languages (#4355)

* implement Ability to show captions and descriptions in all entered languages
*Add Javadoc

* handle Back event of fragment(mediaDetailFragment)

* fix minor bugs

* add internationalization

* revert previous changes

* fix visibility bug

* resolve conflict

Co-authored-by: Prince kushwaha <65972015+Prince-kushwaha@users.noreply.github.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>

* Use more understandable strings (#4470)

* Fix #3792 Missing Column Issue (#4468)

* Fix Missing Column Issue

* Fix tests

* Add UploadCategoriesFragment Unit Tests (#4473)

* Panorama (#4467)

* panoramic images fixed

* made requested changes

* Minor refactoring

Co-authored-by: Aditya Srivastava <iamaditya2009@gmail.com>

* Localisation updates from https://translatewiki.net.

* Main activity title is sometimes "Contributions", sometimes "Commons" (#4472)

Fixes #4438  Replace == with equals() in onRestoreInstanceState

* Localisation updates from https://translatewiki.net.

* caption and description copyable (#4481)

* Removed next button in quiz (#4382)

* issues resolved

* modification done

* warning fixed

* issues resolved

* Button added

* don't know function added

* Button added

* modification done

* modification done

* Localisation updates from https://translatewiki.net.

* Added option to show and modify location while uploading (#4475)

* initial commit

* Everything done

* minor modification

* minor modification

* Issues fixed

* minor modifications

* issue fixed

* Issues fixed

* Tutorial removed from log out state (#4479)

* tutorial removed from log out state

* Issue removed

* Update changelog.md

* Versioning for v3.0.2

* Fix #4482 (#4484)

* Fix crash when image resolution is very high (#4483)

* Localisation updates from https://translatewiki.net.

* Add Contributions Fragment Unit Tests (#4490)

* Fix Tests Errors (#4491)

* Add UploadMediaDetailFragment Unit Tests (#4492)

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* [GSoC] Image Selection (#4457)

* Localisation updates from https://translatewiki.net.

* Fixes #4357  After switching to different account, contributions screen shows pictures of previous account (#4421)

* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>

* Remove unnecessary whitespace from a message (#4439)

* Merge v3.0.1 into master (#4446)

* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>

* Localisation updates from https://translatewiki.net.

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Added a feature for editing coordinates (#4418)

* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed

* Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)

* Localisation updates from https://translatewiki.net.

* Fixes 4344 - Duplicate Uploads (#4442)

* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed

* Image selection added

* Forwarded activity result to upload wizard

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Image selection added

* Forwarded activity result to upload wizard

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* fixed merge errors

* Documented the remaining function

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>

* [GSoC] Show uploaded images differently. (#4464)

* uploaded images shown differently

* Loaded images before query

* Handled exceptions, Made ImageLoader injectable, Document and clean code

* [GSoC] Added Uploaded status table in room database. (#4476)

* added Uploaded status table in room database

* Added unique property, minor refractoring

* Database intigrated

* Database integrated

* Handled result null exception

* Exceptions handled and refractored

* Introduced constants

* moved to sealed class

* No database insert on network error

* queried original image

* documented the code

* Updated uploaded status on upload success

* Image Helper test (#4485)

* [GSoC] Adapter Tests (#4488)

* Added FolderAdapterTest

* Image Adapter Test

* merge fix

* rebase fix

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>
Co-authored-by: Brigham Byerly <6891883+byerlyb20@users.noreply.github.com>
Co-authored-by: Jamie Brown <jamiejbrown521@gmail.com>
Co-authored-by: Prince kushwaha <65972015+Prince-kushwaha@users.noreply.github.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
Co-authored-by: Ashar <asharalikhan200@gmail.com>

* [GSoC] Custom Selector Tests (#4494)

* Localisation updates from https://translatewiki.net.

* Fixes #4357  After switching to different account, contributions screen shows pictures of previous account (#4421)

* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>

* Remove unnecessary whitespace from a message (#4439)

* Merge v3.0.1 into master (#4446)

* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>

* Localisation updates from https://translatewiki.net.

* Added a feature for editing coordinates (#4418)

* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed

* Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)

* Localisation updates from https://translatewiki.net.

* Fixes 4344 - Duplicate Uploads (#4442)

* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed

* Fixes #3694 Pre-select places as depictions (#4452)

* WikidataEditService: stop automatically adding WikidataPlace as a depiction

When the user initiates the upload process from Nearby and also manually adds the place as a depiction, the depiction is added twice. Since this behavior is invisible to the user, it is being removed in preparation for auto-selecting the place as a depiction on the DepictsFragment screen.

* DepictsFragment: auto-select place as a depiction

Pass the Place reference from UploadActivity to DepictsFragment and select the corresponding DepictedItem. Using the place id, retrieve the corresponding Entity to create and select a DepictedItem.

* UploadRepository: use Place from UploadItem to obtain a DepictedItem

Instead of passing a Place object from UploadActivity to DepictsFragment and then passing the Place object up the chain to obtain and select a DepictedItem, retrieve the Place object directly within UploadRepository

* DepictsFragment: select Place depiction when fragment becomes visible

* UploadDepictsAdapter: make adapter aware of selection state

Update selection state when recycled list items are automatically selected, preventing automatically selected items from appearing as unselected until they are forced to re-bind (i.e. after scrolling)

* DepictsFragment: pre-select place depictions for all UploadItems

If several images are selected and set to different places, pre-select all place depictions to reinforce the intended upload workflow philosophy (i.e. all images in a set are intended to be from/of the same place). See discussion in commons-app/apps-android-commons#3694

* DepictsFragment: scroll to the top every time list is updated

* Typo fixes (#4461)

* Fixed typo on class documentation of TextUtils

* corrected comma placement in documentation

* Fixed typos in comments

* fix-issue-4424 (#4445)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* fix edit categories ui (#4414)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fix doom version issue (#4463)

* Update db version

* DBOpenHelper version update

* fix :Back Pressed Event not work in Explore tab when user not login (#4404)

* fix :Back Pressed Event not work in Explore tab

* minor changes

* fix :Upload count or number of contribution does not get updated when media  is successful uploaded (#4399)

* * fix:Number of Contributions not updated
 * Add javadocs

* minor changes

* made minor changes

* String was nonsense and untranslatible, fixed (#4466)

* Ability to show captions and descriptions in all entered languages (#4355)

* implement Ability to show captions and descriptions in all entered languages
*Add Javadoc

* handle Back event of fragment(mediaDetailFragment)

* fix minor bugs

* add internationalization

* revert previous changes

* fix visibility bug

* resolve conflict

* Fixes #4437 - Changed indentation on files with 2 spaces to 4 spaces (#4462)

* Edited Project.xml to make indent size 4

* Changed files with 2 space indentation to use 4 space indentation

* Edited Project.xml to make indent size 4

* changed files with 2 space indent to 4 space indent

* fix :Back Pressed Event not work in Explore tab when user not login (#4404)

* fix :Back Pressed Event not work in Explore tab

* minor changes

* fix :Upload count or number of contribution does not get updated when media  is successful uploaded (#4399)

* * fix:Number of Contributions not updated
 * Add javadocs

* minor changes

* made minor changes

* String was nonsense and untranslatible, fixed (#4466)

* Ability to show captions and descriptions in all entered languages (#4355)

* implement Ability to show captions and descriptions in all entered languages
*Add Javadoc

* handle Back event of fragment(mediaDetailFragment)

* fix minor bugs

* add internationalization

* revert previous changes

* fix visibility bug

* resolve conflict

Co-authored-by: Prince kushwaha <65972015+Prince-kushwaha@users.noreply.github.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>

* Use more understandable strings (#4470)

* Fix #3792 Missing Column Issue (#4468)

* Fix Missing Column Issue

* Fix tests

* Add UploadCategoriesFragment Unit Tests (#4473)

* Panorama (#4467)

* panoramic images fixed

* made requested changes

* Minor refactoring

Co-authored-by: Aditya Srivastava <iamaditya2009@gmail.com>

* Localisation updates from https://translatewiki.net.

* Main activity title is sometimes "Contributions", sometimes "Commons" (#4472)

Fixes #4438  Replace == with equals() in onRestoreInstanceState

* Localisation updates from https://translatewiki.net.

* caption and description copyable (#4481)

* Removed next button in quiz (#4382)

* issues resolved

* modification done

* warning fixed

* issues resolved

* Button added

* don't know function added

* Button added

* modification done

* modification done

* Localisation updates from https://translatewiki.net.

* Added option to show and modify location while uploading (#4475)

* initial commit

* Everything done

* minor modification

* minor modification

* Issues fixed

* minor modifications

* issue fixed

* Issues fixed

* Tutorial removed from log out state (#4479)

* tutorial removed from log out state

* Issue removed

* Update changelog.md

* Versioning for v3.0.2

* Fix #4482 (#4484)

* Fix crash when image resolution is very high (#4483)

* Localisation updates from https://translatewiki.net.

* Add Contributions Fragment Unit Tests (#4490)

* Fix Tests Errors (#4491)

* Add UploadMediaDetailFragment Unit Tests (#4492)

* Localisation updates from https://translatewiki.net.

* Folder Fragment test

* Folder Fragment test done

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* [GSoC] Image Selection (#4457)

* Localisation updates from https://translatewiki.net.

* Fixes #4357  After switching to different account, contributions screen shows pictures of previous account (#4421)

* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>

* Remove unnecessary whitespace from a message (#4439)

* Merge v3.0.1 into master (#4446)

* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>

* Localisation updates from https://translatewiki.net.

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Added a feature for editing coordinates (#4418)

* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed

* Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)

* Localisation updates from https://translatewiki.net.

* Fixes 4344 - Duplicate Uploads (#4442)

* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed

* Image selection added

* Forwarded activity result to upload wizard

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Image selection added

* Forwarded activity result to upload wizard

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* fixed merge errors

* Documented the remaining function

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>

* [GSoC] Show uploaded images differently. (#4464)

* uploaded images shown differently

* Loaded images before query

* Handled exceptions, Made ImageLoader injectable, Document and clean code

* [GSoC] Added Uploaded status table in room database. (#4476)

* added Uploaded status table in room database

* Added unique property, minor refractoring

* Database intigrated

* Database integrated

* Handled result null exception

* Exceptions handled and refractored

* Introduced constants

* moved to sealed class

* No database insert on network error

* queried original image

* documented the code

* Updated uploaded status on upload success

* Image Helper test (#4485)

* [GSoC] Adapter Tests (#4488)

* Added FolderAdapterTest

* Image Adapter Test

* Folder Fragment test

* Folder Fragment test done

* Fragment test complete

* Added Custom Selector View Model Test

* ImageFileLoaderTest

* Update strings.xml

* Custom Selector Activiy test

* Image Loader Test

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>
Co-authored-by: Brigham Byerly <6891883+byerlyb20@users.noreply.github.com>
Co-authored-by: Jamie Brown <jamiejbrown521@gmail.com>
Co-authored-by: Prince kushwaha <65972015+Prince-kushwaha@users.noreply.github.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
Co-authored-by: Ashar <asharalikhan200@gmail.com>

* Image Loader Improvements (#4516)

* ImageLoader Test Updated (#4517)

* [GSoC] Improvement and bug Fixes (#4522)

* Improvement and bug Fixes

* fixed ellipsize

* Saving selector state (#4526)

* [GSoC] Saved Image Fragment Scroll State (#4528)

* Saved Image Fragment Scroll State

* Fix delete image

* Fixed Delete bug

* Changed custom selector icon

* rebase fix

* Tests updated (#4538)

* orientation fixed (#4540)

* refractoring (#4541)

* refractoring (#4545)

* [GSoC] Welcome Dialog (#4546)

* Welcome Dialog

* Condition Fix

* Orientation, back button Fix

* [GSoC] Image preview (#4559)

* Image preview

* refractor

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* [GSoC] Image Selection (#4457)

* Localisation updates from https://translatewiki.net.

* Fixes #4357  After switching to different account, contributions screen shows pictures of previous account (#4421)

* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>

* Remove unnecessary whitespace from a message (#4439)

* Merge v3.0.1 into master (#4446)

* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>

* Localisation updates from https://translatewiki.net.

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Added a feature for editing coordinates (#4418)

* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed

* Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)

* Localisation updates from https://translatewiki.net.

* Fixes 4344 - Duplicate Uploads (#4442)

* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed

* Image selection added

* Forwarded activity result to upload wizard

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Image selection added

* Forwarded activity result to upload wizard

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* fixed merge errors

* Documented the remaining function

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>

* [GSoC] Show uploaded images differently. (#4464)

* uploaded images shown differently

* Loaded images before query

* Handled exceptions, Made ImageLoader injectable, Document and clean code

* [GSoC] Added Uploaded status table in room database. (#4476)

* added Uploaded status table in room database

* Added unique property, minor refractoring

* Database intigrated

* Database integrated

* Handled result null exception

* Exceptions handled and refractored

* Introduced constants

* moved to sealed class

* No database insert on network error

* queried original image

* documented the code

* Updated uploaded status on upload success

* Image Helper test (#4485)

* [GSoC] Adapter Tests (#4488)

* Added FolderAdapterTest

* Image Adapter Test

* [GSoC] Master rebase. (#4505)

* Localisation updates from https://translatewiki.net.

* Fixes #4357  After switching to different account, contributions screen shows pictures of previous account (#4421)

* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>

* Remove unnecessary whitespace from a message (#4439)

* Merge v3.0.1 into master (#4446)

* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>

* Localisation updates from https://translatewiki.net.

* Added a feature for editing coordinates (#4418)

* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed

* Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)

* Localisation updates from https://translatewiki.net.

* Fixes 4344 - Duplicate Uploads (#4442)

* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed

* Fixes #3694 Pre-select places as depictions (#4452)

* WikidataEditService: stop automatically adding WikidataPlace as a depiction

When the user initiates the upload process from Nearby and also manually adds the place as a depiction, the depiction is added twice. Since this behavior is invisible to the user, it is being removed in preparation for auto-selecting the place as a depiction on the DepictsFragment screen.

* DepictsFragment: auto-select place as a depiction

Pass the Place reference from UploadActivity to DepictsFragment and select the corresponding DepictedItem. Using the place id, retrieve the corresponding Entity to create and select a DepictedItem.

* UploadRepository: use Place from UploadItem to obtain a DepictedItem

Instead of passing a Place object from UploadActivity to DepictsFragment and then passing the Place object up the chain to obtain and select a DepictedItem, retrieve the Place object directly within UploadRepository

* DepictsFragment: select Place depiction when fragment becomes visible

* UploadDepictsAdapter: make adapter aware of selection state

Update selection state when recycled list items are automatically selected, preventing automatically selected items from appearing as unselected until they are forced to re-bind (i.e. after scrolling)

* DepictsFragment: pre-select place depictions for all UploadItems

If several images are selected and set to different places, pre-select all place depictions to reinforce the intended upload workflow philosophy (i.e. all images in a set are intended to be from/of the same place). See discussion in commons-app/apps-android-commons#3694

* DepictsFragment: scroll to the top every time list is updated

* Typo fixes (#4461)

* Fixed typo on class documentation of TextUtils

* corrected comma placement in documentation

* Fixed typos in comments

* fix-issue-4424 (#4445)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* fix edit categories ui (#4414)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fix doom version issue (#4463)

* Update db version

* DBOpenHelper version update

* fix :Back Pressed Event not work in Explore tab when user not login (#4404)

* fix :Back Pressed Event not work in Explore tab

* minor changes

* fix :Upload count or number of contribution does not get updated when media  is successful uploaded (#4399)

* * fix:Number of Contributions not updated
 * Add javadocs

* minor changes

* made minor changes

* String was nonsense and untranslatible, fixed (#4466)

* Ability to show captions and descriptions in all entered languages (#4355)

* implement Ability to show captions and descriptions in all entered languages
*Add Javadoc

* handle Back event of fragment(mediaDetailFragment)

* fix minor bugs

* add internationalization

* revert previous changes

* fix visibility bug

* resolve conflict

* Fixes #4437 - Changed indentation on files with 2 spaces to 4 spaces (#4462)

* Edited Project.xml to make indent size 4

* Changed files with 2 space indentation to use 4 space indentation

* Edited Project.xml to make indent size 4

* changed files with 2 space indent to 4 space indent

* fix :Back Pressed Event not work in Explore tab when user not login (#4404)

* fix :Back Pressed Event not work in Explore tab

* minor changes

* fix :Upload count or number of contribution does not get updated when media  is successful uploaded (#4399)

* * fix:Number of Contributions not updated
 * Add javadocs

* minor changes

* made minor changes

* String was nonsense and untranslatible, fixed (#4466)

* Ability to show captions and descriptions in all entered languages (#4355)

* implement Ability to show captions and descriptions in all entered languages
*Add Javadoc

* handle Back event of fragment(mediaDetailFragment)

* fix minor bugs

* add internationalization

* revert previous changes

* fix visibility bug

* resolve conflict

Co-authored-by: Prince kushwaha <65972015+Prince-kushwaha@users.noreply.github.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>

* Use more understandable strings (#4470)

* Fix #3792 Missing Column Issue (#4468)

* Fix Missing Column Issue

* Fix tests

* Add UploadCategoriesFragment Unit Tests (#4473)

* Panorama (#4467)

* panoramic images fixed

* made requested changes

* Minor refactoring

Co-authored-by: Aditya Srivastava <iamaditya2009@gmail.com>

* Localisation updates from https://translatewiki.net.

* Main activity title is sometimes "Contributions", sometimes "Commons" (#4472)

Fixes #4438  Replace == with equals() in onRestoreInstanceState

* Localisation updates from https://translatewiki.net.

* caption and description copyable (#4481)

* Removed next button in quiz (#4382)

* issues resolved

* modification done

* warning fixed

* issues resolved

* Button added

* don't know function added

* Button added

* modification done

* modification done

* Localisation updates from https://translatewiki.net.

* Added option to show and modify location while uploading (#4475)

* initial commit

* Everything done

* minor modification

* minor modification

* Issues fixed

* minor modifications

* issue fixed

* Issues fixed

* Tutorial removed from log out state (#4479)

* tutorial removed from log out state

* Issue removed

* Update changelog.md

* Versioning for v3.0.2

* Fix #4482 (#4484)

* Fix crash when image resolution is very high (#4483)

* Localisation updates from https://translatewiki.net.

* Add Contributions Fragment Unit Tests (#4490)

* Fix Tests Errors (#4491)

* Add UploadMediaDetailFragment Unit Tests (#4492)

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* [GSoC] Image Selection (#4457)

* Localisation updates from https://translatewiki.net.

* Fixes #4357  After switching to different account, contributions screen shows pictures of previous account (#4421)

* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>

* Remove unnecessary whitespace from a message (#4439)

* Merge v3.0.1 into master (#4446)

* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>

* Localisation updates from https://translatewiki.net.

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Added a feature for editing coordinates (#4418)

* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed

* Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)

* Localisation updates from https://translatewiki.net.

* Fixes 4344 - Duplicate Uploads (#4442)

* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed

* Image selection added

* Forwarded activity result to upload wizard

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Image selection added

* Forwarded activity result to upload wizard

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* fixed merge errors

* Documented the remaining function

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>

* [GSoC] Show uploaded images differently. (#4464)

* uploaded images shown differently

* Loaded images before query

* Handled exceptions, Made ImageLoader injectable, Document and clean code

* [GSoC] Added Uploaded status table in room database. (#4476)

* added Uploaded status table in room database

* Added unique property, minor refractoring

* Database intigrated

* Database integrated

* Handled result null exception

* Exceptions handled and refractored

* Introduced constants

* moved to sealed class

* No database insert on network error

* queried original image

* documented the code

* Updated uploaded status on upload success

* Image Helper test (#4485)

* [GSoC] Adapter Tests (#4488)

* Added FolderAdapterTest

* Image Adapter Test

* merge fix

* rebase fix

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>
Co-authored-by: Brigham Byerly <6891883+byerlyb20@users.noreply.github.com>
Co-authored-by: Jamie Brown <jamiejbrown521@gmail.com>
Co-authored-by: Prince kushwaha <65972015+Prince-kushwaha@users.noreply.github.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
Co-authored-by: Ashar <asharalikhan200@gmail.com>

* [GSoC] Custom Selector Tests (#4494)

* Localisation updates from https://translatewiki.net.

* Fixes #4357  After switching to different account, contributions screen shows pictures of previous account (#4421)

* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>

* Remove unnecessary whitespace from a message (#4439)

* Merge v3.0.1 into master (#4446)

* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>

* Localisation updates from https://translatewiki.net.

* Added a feature for editing coordinates (#4418)

* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed

* Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)

* Localisation updates from https://translatewiki.net.

* Fixes 4344 - Duplicate Uploads (#4442)

* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed

* Fixes #3694 Pre-select places as depictions (#4452)

* WikidataEditService: stop automatically adding WikidataPlace as a depiction

When the user initiates the upload process from Nearby and also manually adds the place as a depiction, the depiction is added twice. Since this behavior is invisible to the user, it is being removed in preparation for auto-selecting the place as a depiction on the DepictsFragment screen.

* DepictsFragment: auto-select place as a depiction

Pass the Place reference from UploadActivity to DepictsFragment and select the corresponding DepictedItem. Using the place id, retrieve the corresponding Entity to create and select a DepictedItem.

* UploadRepository: use Place from UploadItem to obtain a DepictedItem

Instead of passing a Place object from UploadActivity to DepictsFragment and then passing the Place object up the chain to obtain and select a DepictedItem, retrieve the Place object directly within UploadRepository

* DepictsFragment: select Place depiction when fragment becomes visible

* UploadDepictsAdapter: make adapter aware of selection state

Update selection state when recycled list items are automatically selected, preventing automatically selected items from appearing as unselected until they are forced to re-bind (i.e. after scrolling)

* DepictsFragment: pre-select place depictions for all UploadItems

If several images are selected and set to different places, pre-select all place depictions to reinforce the intended upload workflow philosophy (i.e. all images in a set are intended to be from/of the same place). See discussion in commons-app/apps-android-commons#3694

* DepictsFragment: scroll to the top every time list is updated

* Typo fixes (#4461)

* Fixed typo on class documentation of TextUtils

* corrected comma placement in documentation

* Fixed typos in comments

* fix-issue-4424 (#4445)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* fix edit categories ui (#4414)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fix doom version issue (#4463)

* Update db version

* DBOpenHelper version update

* fix :Back Pressed Event not work in Explore tab when user not login (#4404)

* fix :Back Pressed Event not work in Explore tab

* minor changes

* fix :Upload count or number of contribution does not get updated when media  is successful uploaded (#4399)

* * fix:Number of Contributions not updated
 * Add javadocs

* minor changes

* made minor changes

* String was nonsense and untranslatible, fixed (#4466)

* Ability to show captions and descriptions in all entered languages (#4355)

* implement Ability to show captions and descriptions in all entered languages
*Add Javadoc

* handle Back event of fragment(mediaDetailFragment)

* fix minor bugs

* add internationalization

* revert previous changes

* fix visibility bug

* resolve conflict

* Fixes #4437 - Changed indentation on files with 2 spaces to 4 spaces (#4462)

* Edited Project.xml to make indent size 4

* Changed files with 2 space indentation to use 4 space indentation

* Edited Project.xml to make indent size 4

* changed files with 2 space indent to 4 space indent

* fix :Back Pressed Event not work in Explore tab when user not login (#4404)

* fix :Back Pressed Event not work in Explore tab

* minor changes

* fix :Upload count or number of contribution does not get updated when media  is successful uploaded (#4399)

* * fix:Number of Contributions not updated
 * Add javadocs

* minor changes

* made minor changes

* String was nonsense and untranslatible, fixed (#4466)

* Ability to show captions and descriptions in all entered languages (#4355)

* implement Ability to show captions and descriptions in all entered languages
*Add Javadoc

* handle Back event of fragment(mediaDetailFragment)

* fix minor bugs

* add internationalization

* revert previous changes

* fix visibility bug

* resolve conflict

Co-authored-by: Prince kushwaha <65972015+Prince-kushwaha@users.noreply.github.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>

* Use more understandable strings (#4470)

* Fix #3792 Missing Column Issue (#4468)

* Fix Missing Column Issue

* Fix tests

* Add UploadCategoriesFragment Unit Tests (#4473)

* Panorama (#4467)

* panoramic images fixed

* made requested changes

* Minor refactoring

Co-authored-by: Aditya Srivastava <iamaditya2009@gmail.com>

* Localisation updates from https://translatewiki.net.

* Main activity title is sometimes "Contributions", sometimes "Commons" (#4472)

Fixes #4438  Replace == with equals() in onRestoreInstanceState

* Localisation updates from https://translatewiki.net.

* caption and description copyable (#4481)

* Removed next button in quiz (#4382)

* issues resolved

* modification done

* warning fixed

* issues resolved

* Button added

* don't know function added

* Button added

* modification done

* modification done

* Localisation updates from https://translatewiki.net.

* Added option to show and modify location while uploading (#4475)

* initial commit

* Everything done

* minor modification

* minor modification

* Issues fixed

* minor modifications

* issue fixed

* Issues fixed

* Tutorial removed from log out state (#4479)

* tutorial removed from log out state

* Issue removed

* Update changelog.md

* Versioning for v3.0.2

* Fix #4482 (#4484)

* Fix crash when image resolution is very high (#4483)

* Localisation updates from https://translatewiki.net.

* Add Contributions Fragment Unit Tests (#4490)

* Fix Tests Errors (#4491)

* Add UploadMediaDetailFragment Unit Tests (#4492)

* Localisation updates from https://translatewiki.net.

* Folder Fragment test

* Folder Fragment test done

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* [GSoC] Image Selection (#4457)

* Localisation updates from https://translatewiki.net.

* Fixes #4357  After switching to different account, contributions screen shows pictures of previous account (#4421)

* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>

* Remove unnecessary whitespace from a message (#4439)

* Merge v3.0.1 into master (#4446)

* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>

* Localisation updates from https://translatewiki.net.

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Added a feature for editing coordinates (#4418)

* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed

* Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)

* Localisation updates from https://translatewiki.net.

* Fixes 4344 - Duplicate Uploads (#4442)

* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed

* Image selection added

* Forwarded activity result to upload wizard

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Image selection added

* Forwarded activity result to upload wizard

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* fixed merge errors

* Documented the remaining function

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>

* [GSoC] Show uploaded images differently. (#4464)

* uploaded images shown differently

* Loaded images before query

* Handled exceptions, Made ImageLoader injectable, Document and clean code

* [GSoC] Added Uploaded status table in room database. (#4476)

* added Uploaded status table in room database

* Added unique property, minor refractoring

* Database intigrated

* Database integrated

* Handled result null exception

* Exceptions handled and refractored

* Introduced constants

* moved to sealed class

* No database insert on network error

* queried original image

* documented the code

* Updated uploaded status on upload success

* Image Helper test (#4485)

* [GSoC] Adapter Tests (#4488)

* Added FolderAdapterTest

* Image Adapter Test

* Folder Fragment test

* Folder Fragment test done

* Fragment test complete

* Added Custom Selector View Model Test

* ImageFileLoaderTest

* Update strings.xml

* Custom Selector Activiy test

* Image Loader Test

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>
Co-authored-by: Brigham Byerly <6891883+byerlyb20@users.noreply.github.com>
Co-authored-by: Jamie Brown <jamiejbrown521@gmail.com>
Co-authored-by: Prince kushwaha <65972015+Prince-kushwaha@users.noreply.github.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
Co-authored-by: Ashar <asharalikhan200@gmail.com>

* Image Loader Improvements (#4516)

* ImageLoader Test Updated (#4517)

* [GSoC] Improvement and bug Fixes (#4522)

* Improvement and bug Fixes

* fixed ellipsize

* Saving selector state (#4526)

* [GSoC] Saved Image Fragment Scroll State (#4528)

* Saved Image Fragment Scroll State

* Fix delete image

* Fixed Delete bug

* Changed custom selector icon

* rebase fix

* [GSoC] Master rebase. (#4505)

* Localisation updates from https://translatewiki.net.

* Fixes #4357  After switching to different account, contributions screen shows pictures of previous account (#4421)

* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>

* Remove unnecessary whitespace from a message (#4439)

* Merge v3.0.1 into master (#4446)

* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>

* Localisation updates from https://translatewiki.net.

* Added a feature for editing coordinates (#4418)

* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed

* Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)

* Localisation updates from https://translatewiki.net.

* Fixes 4344 - Duplicate Uploads (#4442)

* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed

* Fixes #3694 Pre-select places as depictions (#4452)

* WikidataEditService: stop automatically adding WikidataPlace as a depiction

When the user initiates the upload process from Nearby and also manually adds the place as a depiction, the depiction is added twice. Since this behavior is invisible to the user, it is being removed in preparation for auto-selecting the place as a depiction on the DepictsFragment screen.

* DepictsFragment: auto-select place as a depiction

Pass the Place reference from UploadActivity to DepictsFragment and select the corresponding DepictedItem. Using the place id, retrieve the corresponding Entity to create and select a DepictedItem.

* UploadRepository: use Place from UploadItem to obtain a DepictedItem

Instead of passing a Place object from UploadActivity to DepictsFragment and then passing the Place object up the chain to obtain and select a DepictedItem, retrieve the Place object directly within UploadRepository

* DepictsFragment: select Place depiction when fragment becomes visible

* UploadDepictsAdapter: make adapter aware of selection state

Update selection state when recycled list items are automatically selected, preventing automatically selected items from appearing as unselected until they are forced to re-bind (i.e. after scrolling)

* DepictsFragment: pre-select place depictions for all UploadItems

If several images are selected and set to different places, pre-select all place depictions to reinforce the intended upload workflow philosophy (i.e. all images in a set are intended to be from/of the same place). See discussion in commons-app/apps-android-commons#3694

* DepictsFragment: scroll to the top every time list is updated

* Typo fixes (#4461)

* Fixed typo on class documentation of TextUtils

* corrected comma placement in documentation

* Fixed typos in comments

* fix-issue-4424 (#4445)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* fix edit categories ui (#4414)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fix doom version issue (#4463)

* Update db version

* DBOpenHelper version update

* fix :Back Pressed Event not work in Explore tab when user not login (#4404)

* fix :Back Pressed Event not work in Explore tab

* minor changes

* fix :Upload count or number of contribution does not get updated when media  is successful uploaded (#4399)

* * fix:Number of Contributions not updated
 * Add javadocs

* minor changes

* made minor changes

* String was nonsense and untranslatible, fixed (#4466)

* Ability to show captions and descriptions in all entered languages (#4355)

* implement Ability to show captions and descriptions in all entered languages
*Add Javadoc

* handle Back event of fragment(mediaDetailFragment)

* fix minor bugs

* add internationalization

* revert previous changes

* fix visibility bug

* resolve conflict

* Fixes #4437 - Changed indentation on files with 2 spaces to 4 spaces (#4462)

* Edited Project.xml to make indent size 4

* Changed files with 2 space indentation to use 4 space indentation

* Edited Project.xml to make indent size 4

* changed files with 2 space indent to 4 space indent

* fix :Back Pressed Event not work in Explore tab when user not login (#4404)

* fix :Back Pressed Event not work in Explore tab

* minor changes

* fix :Upload count or number of contribution does not get updated when media  is successful uploaded (#4399)

* * fix:Number of Contributions not updated
 * Add javadocs

* minor changes

* made minor changes

* String was nonsense and untranslatible, fixed (#4466)

* Ability to show captions and descriptions in all entered languages (#4355)

* implement Ability to show captions and descriptions in all entered languages
*Add Javadoc

* handle Back event of fragment(mediaDetailFragment)

* fix minor bugs

* add internationalization

* revert previous changes

* fix visibility bug

* resolve conflict

Co-authored-by: Prince kushwaha <65972015+Prince-kushwaha@users.noreply.github.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>

* Use more understandable strings (#4470)

* Fix #3792 Missing Column Issue (#4468)

* Fix Missing Column Issue

* Fix tests

* Add UploadCategoriesFragment Unit Tests (#4473)

* Panorama (#4467)

* panoramic images fixed

* made requested changes

* Minor refactoring

Co-authored-by: Aditya Srivastava <iamaditya2009@gmail.com>

* Localisation updates from https://translatewiki.net.

* Main activity title is sometimes "Contributions", sometimes "Commons" (#4472)

Fixes #4438  Replace == with equals() in onRestoreInstanceState

* Localisation updates from https://translatewiki.net.

* caption and description copyable (#4481)

* Removed next button in quiz (#4382)

* issues resolved

* modification done

* warning fixed

* issues resolved

* Button added

* don't know function added

* Button added

* modification done

* modification done

* Localisation updates from https://translatewiki.net.

* Added option to show and modify location while uploading (#4475)

* initial commit

* Everything done

* minor modification

* minor modification

* Issues fixed

* minor modifications

* issue fixed

* Issues fixed

* Tutorial removed from log out state (#4479)

* tutorial removed from log out state

* Issue removed

* Update changelog.md

* Versioning for v3.0.2

* Fix #4482 (#4484)

* Fix crash when image resolution is very high (#4483)

* Localisation updates from https://translatewiki.net.

* Add Contributions Fragment Unit Tests (#4490)

* Fix Tests Errors (#4491)

* Add UploadMediaDetailFragment Unit Tests (#4492)

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* [GSoC] Image Selection (#4457)

* Localisation updates from https://translatewiki.net.

* Fixes #4357  After switching to different account, contributions screen shows pictures of previous account (#4421)

* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>

* Remove unnecessary whitespace from a message (#4439)

* Merge v3.0.1 into master (#4446)

* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>

* Localisation updates from https://translatewiki.net.

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Added a feature for editing coordinates (#4418)

* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed

* Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451)

* Localisation updates from https://translatewiki.net.

* Fixes 4344 - Duplicate Uploads (#4442)

* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed

* Image selection added

* Forwarded activity result to upload wizard

* Initialised xmls, made folder and image item.

* xmls done

* xmls completed

* removed unwanted attribute

* Created models, adapters and view models (#4441)

* created models, adapters and view models

* Added Image Fragment

* back button linked

* Documentation and refractor

* spaces

* Butterknife annotation

* DiffUtil

* Added Examples

* Extended Custom selector From Base Activity

* made view model injectable

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* Image selection added

* Forwarded activity result to upload wizard

* [GSOC] Added Image Fetch (#4449)

* Added basic Fetch

* added permission request

* Folder count rectified

* Loaded thumbnail

* disabled overlay

* Added sha1 function

* Documented the code

* fixed merge errors

* Documented the remaining function

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>

* [GSoC] Show uploaded images differently. (#4464)

* uploaded images shown differently

* Loaded images before query

* Handled exceptions, Made ImageLoader injectable, Document and clean code

* [GSoC] Added Uploaded status table in room database. (#4476)

* added Uploaded status table in room database

* Added unique property, minor refractoring

* Database intigrated

* Database integrated

* Handled result null exception

* Exceptions handled and refractored

* Introduced constants

* moved to sealed class

* No database insert on network error

* queried original image

* documented the code

* Updated uploaded status on upload success

* Image Helper test (#4485)

* [GSoC] Adapter Tests (#4488)

* Added FolderAdapterTest

* Image Adapter Test

* merge fix

* rebase fix

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>
Co-authored-by: Brigham Byerly <6891883+byerlyb20@users.noreply.github.com>
Co-authored-by: Jamie Brown <jamiejbrown521@gmail.com>
Co-authored-by: Prince kushwaha <65972015+Prince-kushwaha@users.noreply.github.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
Co-authored-by: Ashar <asharalikhan200@gmail.com>

* Tests updated (#4538)

* orientation fixed (#4540)

* refractoring (#4541)

* refractoring (#4545)

* [GSoC] Welcome Dialog (#4546)

* Welcome Dialog

* Condition Fix

* Orientation, back button Fix

* [GSoC] Image preview (#4559)

* Image preview

* refractor

* update database version

* remove duplicates

Co-authored-by: Aditya Srivastava <iamaditya2009@gmail.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: obsidian-zero <63155026+obsidian-zero@users.noreply.github.com>
Co-authored-by: Obsidian_zero <1198474846@qq.com>
Co-authored-by: Amir E. Aharoni <amir.aharoni@mail.huji.ac.il>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
Co-authored-by: Ayan Sarkar <71203077+Ayan-10@users.noreply.github.com>
Co-authored-by: Brigham Byerly <6891883+byerlyb20@users.noreply.github.com>
Co-authored-by: Jamie Brown <jamiejbrown521@gmail.com>
Co-authored-by: Prince kushwaha <65972015+Prince-kushwaha@users.noreply.github.com>
Co-authored-by: Ashar <asharalikhan200@gmail.com>
2021-08-18 21:11:35 +09:00
Ashish
6588a6fd0e
Fixes #545 - Add support for campaigns (#4423)
* Integrate WLM
- Show monuments in maps along with nearby

* BugFix in Monuments
1. Single preference for monuments and campaigns
2. Expand collapse chips container in nearby
3. Typo fix in Monuments card in Nearby
4. If a nearby place is a monument as well - do not show them separately, show it as a monument instead
5. Bug fix, monument radius, use the same one as that of nearby

* More bug fixes
1. Possible NPE in nearby
2. Added column location_address in BookmarkLocationDao
3. Bug Fix - Display Date in WLM card
4. WLM card on click takes to nearby

* Use lowercase country code in WLM uploads

* Bug-Fix, WLM Campaign Icon

* 1. Updated monuments query to use any of the following properties for monuments - [P1435, P2186, P1459, P1460, P1216, P709, P718, P5694] 2. Append WikiData QID to descriptions template

* Updated WLM Banner String, Handle NPE in contributions callback

* Added nearby-monuments query log lines

* Handle WLM Query exception : - if an exception is thrown in WLM query, continue showing the nearby items if that succeeds

* Fix BookmarkLocationDaoTest

* Added Column Address in BookmarkLocationDaoTest

* Use fallback description as usual nearby pins even for WLM pins, instead of relying on P6375

* Test fix in BookmarkLocationDao

* Updated template for WLM, removed redundant feilds

* Fixed WLM template

* Removed categories from WLM template

* Fixed BookmarkControllerTest

* Fixed BookmarkLocationFragmentUnitTest

* fix ModelFunctions

* Fixed BookmarksDaoLocationTest

* Fixed WLM template
2021-08-18 18:27:26 +10:00
translatewiki.net
67f5b6c271 Localisation updates from https://translatewiki.net. 2021-08-16 13:01:35 +02:00
Nicolas Raoul
344b220ae0 Revert "Removing setText calls which seem prevent text selection (#4520)"
This reverts commit a94a28f743.
2021-08-14 22:11:23 +09:00
translatewiki.net
f482448c7b Localisation updates from https://translatewiki.net. 2021-08-12 13:01:36 +02:00
Madhur Gupta
14efac1000
Add ImageUtils Tests (#4542) 2021-08-12 16:00:34 +10:00
translatewiki.net
9dea5b05d9 Localisation updates from https://translatewiki.net. 2021-08-09 13:01:44 +02:00
neslihanturan
6dff9d674e
Remove unnecessary imports and fix type error (#4535) 2021-08-06 16:32:49 +05:30
gouri-panda
d0df2ffd59
#4005 For images in set removed if user selected one image (#4022)
* #4005 For images in set  removed if user selected one image

* #4005 changed code as suggested

* fixed syntax

* added javadoc

* added more java doc

* refactored to more meaningful documentation

* reverted the Project.xml file

* cleaned  documentations a little bit
2021-08-06 13:18:19 +03:00
benryder1988
a94a28f743
Removing setText calls which seem prevent text selection (#4520) 2021-08-06 11:43:09 +03:00
translatewiki.net
58d25d5fd5 Localisation updates from https://translatewiki.net. 2021-08-05 13:01:19 +02:00
translatewiki.net
3dc36af8f1 Localisation updates from https://translatewiki.net. 2021-08-02 13:01:28 +02:00
neslihanturan
a584c8f239
Add nullcheck (#4530) 2021-08-02 19:25:07 +10:00
Madhur Gupta
3314905cfa
Add ContributionsListFragment Unit Tests (#4533) 2021-08-02 19:23:57 +10:00
translatewiki.net
ebae63de5d Localisation updates from https://translatewiki.net. 2021-07-29 13:01:43 +02:00
translatewiki.net
06dd7e547d Localisation updates from https://translatewiki.net. 2021-07-26 13:01:49 +02:00
neslihanturan
ee81877ebb
This error seemed to occur on compositeDisposable.clear() so null checked there (#4525) 2021-07-26 15:17:34 +10:00
benryder1988
2a9ae73750
Fixes #4455 - Warning when pressing "back" in upload wizard (#4519)
* Overrides the back button during upload with dialog

* Removing unneeded import
2021-07-23 20:40:41 +09:00
translatewiki.net
686dc93257 Localisation updates from https://translatewiki.net. 2021-07-19 13:01:25 +02:00
Madhur Gupta
876e258001
Fix #4496 depiction description not fully visible (#4509) 2021-07-18 16:17:51 +09:00
Ayan Sarkar
3b7aa0376d
Added option for sharing achievements and a back button in ProfileActivity (#4489)
* UI done

* Share added

* Minor modification

* tests added

* tests added

* tests added

* modified

* modifications

* modification

* Entered if

* Entered if

* 97% coverage

* Separate

* Minor modifications

* Minor modifications
2021-07-18 05:40:32 +05:30
translatewiki.net
9643d8d0b8 Localisation updates from https://translatewiki.net. 2021-07-15 13:01:22 +02:00
neslihanturan
ec89a3377a
Add an else case where crash logs are null means there is no crash (#4506) 2021-07-15 01:05:04 +10:00
Madhur Gupta
8793d45f30
Remove duplicate code which was added during merge (#4504) 2021-07-14 16:19:43 +10:00
translatewiki.net
a09da2d59e Localisation updates from https://translatewiki.net. 2021-07-12 13:01:15 +02:00
translatewiki.net
2233fc2e98 Localisation updates from https://translatewiki.net. 2021-07-08 13:01:13 +02:00
translatewiki.net
2fff00c0c7 Localisation updates from https://translatewiki.net. 2021-07-05 13:01:31 +02:00
Madhur Gupta
4be7e7b274
Add UploadMediaDetailFragment Unit Tests (#4492) 2021-07-05 16:11:02 +10:00
Madhur Gupta
93d7ef33ba
Fix Tests Errors (#4491) 2021-07-05 16:10:49 +10:00
Madhur Gupta
07060cf94f
Add Contributions Fragment Unit Tests (#4490) 2021-07-05 16:10:37 +10:00
translatewiki.net
f52b26b77f Localisation updates from https://translatewiki.net. 2021-07-01 13:40:48 +02:00
Madhur Gupta
7d7a1caac1 Fix crash when image resolution is very high (#4483) 2021-06-30 19:44:37 +10:00
Madhur Gupta
1e0d7fb76b Fix #4482 (#4484) 2021-06-30 19:44:10 +10:00
Josephine Lim
bb7843c5df Versioning for v3.0.2 2021-06-30 19:43:32 +10:00
Josephine Lim
26e6138175 Update changelog.md 2021-06-30 19:42:49 +10:00
Ayan Sarkar
51d06c1ef4
Tutorial removed from log out state (#4479)
* tutorial removed from log out state

* Issue removed
2021-06-29 18:12:30 +09:00
Ayan Sarkar
e9a2c32527
Added option to show and modify location while uploading (#4475)
* initial commit

* Everything done

* minor modification

* minor modification

* Issues fixed

* minor modifications

* issue fixed

* Issues fixed
2021-06-29 18:02:20 +09:00
translatewiki.net
2c785f88fa Localisation updates from https://translatewiki.net. 2021-06-28 15:28:16 +02:00
Ayan Sarkar
8db381885b
Removed next button in quiz (#4382)
* issues resolved

* modification done

* warning fixed

* issues resolved

* Button added

* don't know function added

* Button added

* modification done

* modification done
2021-06-27 18:34:33 +09:00
Ayan Sarkar
2ae0cd2c72
caption and description copyable (#4481) 2021-06-27 18:21:55 +09:00
translatewiki.net
f63f2ed8dc Localisation updates from https://translatewiki.net. 2021-06-24 11:56:36 +02:00
Ashar
399d798159
Main activity title is sometimes "Contributions", sometimes "Commons" (#4472)
Fixes #4438  Replace == with equals() in onRestoreInstanceState
2021-06-23 19:15:39 +03:00
translatewiki.net
7b016c7dcf Localisation updates from https://translatewiki.net. 2021-06-21 12:26:56 +02:00
Nicolas Raoul
c8a31a32ea
Panorama (#4467)
* panoramic images fixed

* made requested changes

* Minor refactoring

Co-authored-by: Aditya Srivastava <iamaditya2009@gmail.com>
2021-06-21 14:05:46 +10:00
Madhur Gupta
810c797be2
Add UploadCategoriesFragment Unit Tests (#4473) 2021-06-21 14:02:10 +10:00
Madhur Gupta
7a74549b59
Fix #3792 Missing Column Issue (#4468)
* Fix Missing Column Issue

* Fix tests
2021-06-21 14:01:00 +10:00
neslihanturan
38b6aa6ec8
Use more understandable strings (#4470) 2021-06-21 13:58:36 +10:00
Jamie Brown
ca9f6f5e47
Fixes #4437 - Changed indentation on files with 2 spaces to 4 spaces (#4462)
* Edited Project.xml to make indent size 4

* Changed files with 2 space indentation to use 4 space indentation

* Edited Project.xml to make indent size 4

* changed files with 2 space indent to 4 space indent

* fix :Back Pressed Event not work in Explore tab when user not login (#4404)

* fix :Back Pressed Event not work in Explore tab

* minor changes

* fix :Upload count or number of contribution does not get updated when media  is successful uploaded (#4399)

* * fix:Number of Contributions not updated
 * Add javadocs

* minor changes

* made minor changes

* String was nonsense and untranslatible, fixed (#4466)

* Ability to show captions and descriptions in all entered languages (#4355)

* implement Ability to show captions and descriptions in all entered languages
*Add Javadoc

* handle Back event of fragment(mediaDetailFragment)

* fix minor bugs

* add internationalization

* revert previous changes

* fix visibility bug

* resolve conflict

Co-authored-by: Prince kushwaha <65972015+Prince-kushwaha@users.noreply.github.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
2021-06-21 12:33:11 +09:00
Prince kushwaha
b202f553f0
Ability to show captions and descriptions in all entered languages (#4355)
* implement Ability to show captions and descriptions in all entered languages
*Add Javadoc

* handle Back event of fragment(mediaDetailFragment)

* fix minor bugs

* add internationalization

* revert previous changes

* fix visibility bug

* resolve conflict
2021-06-18 22:30:14 +09:00
neslihanturan
808f21a1f2
String was nonsense and untranslatible, fixed (#4466) 2021-06-18 20:07:35 +09:00
Prince kushwaha
13528bcabd
fix :Upload count or number of contribution does not get updated when media is successful uploaded (#4399)
* * fix:Number of Contributions not updated
 * Add javadocs

* minor changes

* made minor changes
2021-06-18 20:01:37 +09:00
Prince kushwaha
2a2d2879a9
fix :Back Pressed Event not work in Explore tab when user not login (#4404)
* fix :Back Pressed Event not work in Explore tab

* minor changes
2021-06-18 18:42:41 +09:00
neslihanturan
6df35e21a9
Fix doom version issue (#4463)
* Update db version

* DBOpenHelper version update
2021-06-17 23:36:36 +10:00
Pratham Pahariya
22f61195b2
fix edit categories ui (#4414)
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-06-17 21:49:09 +09:00
Pratham Pahariya
3494fd05a2
fix-issue-4424 (#4445)
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-06-17 21:40:32 +09:00
Jamie Brown
a3cbe3659c
Typo fixes (#4461)
* Fixed typo on class documentation of TextUtils

* corrected comma placement in documentation

* Fixed typos in comments
2021-06-17 11:53:17 +09:00
Brigham Byerly
2be828c50e
Fixes #3694 Pre-select places as depictions (#4452)
* WikidataEditService: stop automatically adding WikidataPlace as a depiction

When the user initiates the upload process from Nearby and also manually adds the place as a depiction, the depiction is added twice. Since this behavior is invisible to the user, it is being removed in preparation for auto-selecting the place as a depiction on the DepictsFragment screen.

* DepictsFragment: auto-select place as a depiction

Pass the Place reference from UploadActivity to DepictsFragment and select the corresponding DepictedItem. Using the place id, retrieve the corresponding Entity to create and select a DepictedItem.

* UploadRepository: use Place from UploadItem to obtain a DepictedItem

Instead of passing a Place object from UploadActivity to DepictsFragment and then passing the Place object up the chain to obtain and select a DepictedItem, retrieve the Place object directly within UploadRepository

* DepictsFragment: select Place depiction when fragment becomes visible

* UploadDepictsAdapter: make adapter aware of selection state

Update selection state when recycled list items are automatically selected, preventing automatically selected items from appearing as unselected until they are forced to re-bind (i.e. after scrolling)

* DepictsFragment: pre-select place depictions for all UploadItems

If several images are selected and set to different places, pre-select all place depictions to reinforce the intended upload workflow philosophy (i.e. all images in a set are intended to be from/of the same place). See discussion in commons-app/apps-android-commons#3694

* DepictsFragment: scroll to the top every time list is updated
2021-06-17 10:09:41 +09:00
Ashish
10ed6678b3
Fixes 4344 - Duplicate Uploads (#4442)
* Fixes 4344
- Update the retention policy of the Work Manager to ExistingWorkPolicy.APPEND_OR_REPLACE- which would append the new work to the end of existing one. This helps remove the while loop in UploadWorker which was meant to handle the cases where a new worker would be created for retries. The while loop seemed to have race conditions uploading duplicate entries.

* Update states to IN_PROGRESS before uploads are processed
2021-06-14 14:57:15 +03:00
translatewiki.net
09cacde670 Localisation updates from https://translatewiki.net. 2021-06-14 09:51:11 +02:00
neslihanturan
70851fa155
Some build issues occured merging release v3.0 are fixed. One paranthesis issue is solved, a method about UploadService is removed, since we don't use it anymore. (#4451) 2021-06-14 16:25:37 +10:00
Ayan Sarkar
20f74a90c4
Added a feature for editing coordinates (#4418)
* not

* Place Picker added

* Pick location and API call linked

* minor warnings resolved

* Code conventions followed

* issue fixed

* Wikitext edited properly

* minor modification

* Location Picker added

* Bottom sheet removed

* Location picker fully implemented

* credit added

* credit added

* issues fixed

* issues fixed

* minor issue fixed
2021-06-13 12:36:47 +09:00
translatewiki.net
15e66f5278 Localisation updates from https://translatewiki.net. 2021-06-10 16:38:00 +02:00
Josephine Lim
ca75f616d2
Merge v3.0.1 into master (#4446)
* Versioning and changelog for v3.0.0 (#4152)

* Versioning for v3.0.0

* Update changelog.md

* Handled migration 8-9-10 in BookmarksLocationDao (#4154)

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* #Fixes #4141
- Handled migrations for BookmarkLocationsDao from 8-9-10

* Fixes #4179 (#4180)

* Handled null pointer exception in MainActivity->ContributionsFragment#backButtonClicked()
* Updated >ContributionsFragment#backButtonClicked() to handle back press properly

* Fixes #4179 (#4181)

* Handled possible null check on MediaDetails in BookmarkListRootFragment#backPressed()

* Cherrypick for hotfix3.1 (#4205)

* Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.

* fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)

* fixed bug:app crashes on viewing review in Review Fragment #4135

* Fixed the issue with back button in contribution tab. (#4177)

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>

* Fixed the issue with back navigation button on toolbar in explore tab. (#4175)

* Fix (#4148) Issues on theme change

* fixed themeChange crashes

* fixed comments

* Overlooked the title bar

Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>

* Fixes #4173 (#4396)

* Fix #4147  Pre-fill desc in Nearby uploads with Wikidata item's label + description (#4390)

* Update query to fetch descriptions

* Make description added to NearbyResultItem

* Make string operations to display description and label in a combined way

* Fix reviews, remove long description from list and swap label and description texts

* Fix repeated information issue

* Fix double information issue

* fix style issues

* Remove douplicated information

* Changes made (#4354)

* Remove nonexistent method

* Fix #4283 IllegalStateException (#4440)

* Fix #4283 IllegalStateException

* Fix flickering issue

* Versioning for v3.0.1

* Update changelog.md

Co-authored-by: Ashish <ashishkumar468@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Pratham Pahariya <54663429+Pratham2305@users.noreply.github.com>
Co-authored-by: Shabir Ahmad <56585337+shabar-shab@users.noreply.github.com>
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
Co-authored-by: Aditya-Srivastav <54016427+4D17Y4@users.noreply.github.com>
Co-authored-by: Madhur Gupta <30932899+madhurgupta10@users.noreply.github.com>
Co-authored-by: Vinayak Aggarwal <56196007+vinayak0505@users.noreply.github.com>
2021-06-09 20:19:24 +10:00
Amir E. Aharoni
7823b18db9
Remove unnecessary whitespace from a message (#4439) 2021-06-08 11:50:42 +03:00
obsidian-zero
feb75cbb9f
Fixes #4357 After switching to different account, contributions screen shows pictures of previous account (#4421)
* Update UploadMediaDetailFragment.java

* Update LoginActivity.java

Clear CompositeDisposable after logging in successfully. It may help solve the problem of saving the contribution to the previous account

* Revert "Update UploadMediaDetailFragment.java"

This reverts commit b1b4257f20.

Co-authored-by: Obsidian_zero <1198474846@qq.com>
2021-06-07 18:52:19 +03:00
translatewiki.net
c06756b89d Localisation updates from https://translatewiki.net. 2021-06-07 14:45:46 +02:00
Brigham Byerly
165c375bbd
UploadMediaDetail: replace discreet error toast with more-noticeable dialog (#4433) 2021-06-04 12:34:46 +03:00
Pratham Pahariya
ca18763e4f
Fixes #2815 - Nominating for deletion is cancelled on leaving the media details (#4295)
* fix issue with nominating for deletion

* Fix UI issue

* minor improvements

* fix App crash

* Added Javadoc and other minor improvements

* Updated string name

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-06-04 11:15:39 +09:00
translatewiki.net
76b30678da Localisation updates from https://translatewiki.net. 2021-06-03 15:10:02 +02:00
Madhur Gupta
d400790d9d
Add more tests for Auth (#4436) 2021-06-03 19:07:57 +10:00
Prince kushwaha
4fa18e5e27
In depictions selection screen, suggest recently selected items (#4361)
* implement in depictions selection screen to suggest recently selected items

*use RoomDataBase
* Add Javadoc

* fix an bug

* minar change and remove extra line of code

* minar changes

* improve implemention strategy

* fix unittest

* Add javadoc

* added javadoc
2021-05-31 19:19:55 +09:00
Ayan Sarkar
18cfc89fa4
TextView blank issue fixed (#4416)
* TextView blank issue fixed

* minor issue fixed
2021-05-31 12:44:04 +03:00
translatewiki.net
a524ac7dfe Localisation updates from https://translatewiki.net. 2021-05-31 10:31:24 +02:00
translatewiki.net
143fb7bd82 Localisation updates from https://translatewiki.net. 2021-05-31 10:00:26 +02:00
translatewiki.net
9ddf17248a Localisation updates from https://translatewiki.net. 2021-05-27 15:35:03 +02:00
translatewiki.net
5816311c8e Localisation updates from https://translatewiki.net. 2021-05-24 13:57:49 +02:00
translatewiki.net
7db6f835a0 Localisation updates from https://translatewiki.net. 2021-05-17 13:06:16 +02:00
Ayan Sarkar
b6ffe9ff06
New review layout UI for landscape view (#4412)
* ReviewActivity landscape layout created successfully

* Minor issues fixed

* minor modification

* crash fixed
2021-05-15 23:43:37 +09:00
Ayan Sarkar
1408fe5e53
Made locale non dependent on phone OS settings, but choosable on app settings (#4366)
* setLocale added

* localization added

* test complete

* resolved conflicts

* issues resolved

* minor issues fixed

* Made methods concise

* Issues fixed
2021-05-15 23:30:03 +09:00
Aditya-Srivastav
9562fd1f2c
added bookmarkLocationFragment unit tests (#4407)
* added bookmarkLocationFragment unit tests

* more lines covered
2021-05-15 18:56:01 +05:30
Ayan Sarkar
a78fea09d7
Added an option to Remove a new language description while uploading (#4406)
* implementation done modification required in card & more

* Remove button reversed

* Code beautification done

* Code beautification done

* minor issues fixed

* java docs added
2021-05-15 09:14:29 +09:00
Madhur Gupta
4b7e75c42c
Add more tests for MainActivity (#4410) 2021-05-14 17:21:12 +10:00
Madhur Gupta
48f2bb8863
Add more tests for Quiz (#4411) 2021-05-14 17:20:46 +10:00
Pratham Pahariya
c7f7b39151
Fixes #3380 - "Nearby Place found" despite already Nearby upload (#4408)
* fix issue with "nearby place found" pop up on nearby upload

* added javadoc

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-05-13 23:00:55 +09:00
Pratham Pahariya
2b62d8487b
Fixes #4286 - Contributions didn't appear after logging in again (#4337)
* fix the issue with contributions not appearing after logging in again

* fix old contribution appearing on top

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-05-10 19:28:32 +03:00
finalrepublic
0fb2f1b7be
Fix #4217 Share button color should be changed from white to black in About Activity (#4373)
* a solution to share-icon problem
2021-05-10 19:13:36 +03:00
Prince kushwaha
0c8b92c7aa
Show media details fragment when on clicking image of Peer Review (#4374)
* * show MediaDetailFragment in ReviewActivity on image click
* Add javadoc
* Reformated code of  ReviewActivity xml

* fix typos

* add unit test

* made minor changes
2021-05-10 19:07:28 +03:00
translatewiki.net
e9069d060c Localisation updates from https://translatewiki.net. 2021-05-10 14:01:44 +02:00
Madhur Gupta
48eb140218
Remove dependency which was causing build to fail for Instrumentation Tests (#4369) 2021-05-10 17:38:53 +10:00
Madhur Gupta
2f4c30416d
Update Test Dependency version (#4405)
* Update Version and Unit Test

* fix failing tests

* update robolectric
2021-05-10 17:22:56 +10:00
Vinayak Aggarwal
117a7805ad
Fixes #4300 Limited connection mode banner occupies too much space (#4375)
* done

* fixed

* minor changes made

changed tv, Tv to text_view, TextView, improved comment for toggleDescriptionListener
2021-05-08 18:49:50 +09:00
Pratham Pahariya
845a901604
Fixes #4385 - App crash On categoryDetail activity when click on image after orientation change (#4397)
* fix issue 4385

* fix orientation change issue

* added javadoc

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-05-08 18:45:32 +09:00
translatewiki.net
3577bd9e3e Localisation updates from https://translatewiki.net. 2021-05-07 10:47:57 +02:00
translatewiki.net
6f83accd5f Localisation updates from https://translatewiki.net. 2021-05-03 15:19:21 +02:00
Piyush Goel
cf7583abd4
Login error message is displayed in native phone locale language and not in just English. Fixes #4290 (#4389)
* Login error message is displayed in native phone locale language.

* Login error message is displayed in native phone locale language.
2021-05-03 09:37:14 +09:00
translatewiki.net
f35d6d605b Localisation updates from https://translatewiki.net. 2021-04-30 08:46:14 +02:00
Madhur Gupta
a5154fb7fe
Add few more tests for campaign module (#4384) 2021-04-28 17:12:11 +10:00
Madhur Gupta
cb8a7c22da
Add few more tests for notification module (#4383) 2021-04-28 17:11:52 +10:00
Madhur Gupta
2e0f8e6d68
Add Unit Tests for widget module (#4381) 2021-04-27 11:43:17 +03:00
translatewiki.net
c0c657324e Localisation updates from https://translatewiki.net. 2021-04-26 15:19:05 +02:00
translatewiki.net
950205a2a5 Localisation updates from https://translatewiki.net. 2021-04-22 14:58:11 +02:00
Aditya-Srivastav
f8a8f92070
Fixes #4329 "Back button in edit categories triggers back of media details." (#4346)
* Back button on fragment

* Handled back events

* minor changes

* removed extra lines
2021-04-19 17:19:27 +03:00
translatewiki.net
fd247f6321 Localisation updates from https://translatewiki.net. 2021-04-19 12:42:14 +02:00
Ayan Sarkar
3369d96c49
READ_EXTERNAL_STORAGE permission is not necessary while picking file from gallery (#4356) 2021-04-19 13:31:01 +03:00
Madhur Gupta
a03c04e89c
Add MediaDetailPagerFragment Unit Tests (#4362) 2021-04-19 11:54:34 +03:00
Ashish
8c7954a158
Fixes #4360 (#4363)
* Trigger API call to addDepictionsAndCaptions after succesfull upload from stash
2021-04-18 16:19:26 +09:00
Vinayak Aggarwal
bebc4afae2
Changes made (#4354) 2021-04-15 23:45:10 +09:00
translatewiki.net
eea3f821ae Localisation updates from https://translatewiki.net. 2021-04-15 13:00:04 +02:00
neslihanturan
4bca142321
Revert "Add Unit Tests for Upload Service (#4322)" (#4353)
This reverts commit fba7fb8532.
2021-04-13 02:22:30 +10:00
Madhur Gupta
fba7fb8532
Add Unit Tests for Upload Service (#4322) 2021-04-12 17:38:32 +03:00
translatewiki.net
504408ec8c Localisation updates from https://translatewiki.net. 2021-04-12 15:40:57 +02:00
Pratham Pahariya
58408cf2b0
Fixes #4297 - UI Issue: After changing the system theme from settings (#4332)
* fix UI issue after theme change

* removed unnecessary changes

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-04-08 20:51:07 +03:00
Prince kushwaha
153e57264d
fix:In setting Default description language option is needed to get disable when user is not login (#4342) 2021-04-08 19:37:58 +03:00
Ayan Sarkar
baaec02c83
Make the whole label clickable (#4341) 2021-04-08 18:59:26 +03:00
Ashish
ecbff7e3b8
Fixes #3790- Use WorkManagers to upload contributions (#4298)
* Fixes #3790
Use WorkManagers to process upload contributions
** Removed UploadService and Added UploadWorker to process contributions Upload
** Made nescessary changes to remove the usages of the Service from the classes
** UI Fxies- Minor changes in the retry and cancel uplaod icons to give them a clickable area of 48 dp

* Fixes #3790
Use WorkManagers to process upload contributions
** Removed UploadService and Added UploadWorker to process contributions Upload
** Made nescessary changes to remove the usages of the Service from the classes
** UI Fxies- Minor changes in the retry and cancel uplaod icons to give them a clickable area of 48 dp

* Updated JavaDocs in UploadWorker, Fixed Test cases

* Updated JavaDocs in UploadWorker, Fixed Test cases

* Updated gradle

* Revert "Updated gradle"

This reverts commit c8979fe6dc.

* rolledback to compileSDKVersion 28, fixed tests

* Don't call the show notifications on the main thread

* Bug Fix- Duplicate contributions, handle upload stash errors
2021-04-08 15:59:07 +03:00
Ayan Sarkar
fd2a7a9c56
Fix SearchView is not visible properly in lower API devices (#4333) 2021-04-08 15:57:50 +03:00
translatewiki.net
e2f3d88703 Localisation updates from https://translatewiki.net. 2021-04-08 14:53:15 +02:00
Aditya-Srivastav
0a7ff3e068
Added LocationUtilsTest for LocationUtils (#4319)
* added location utils test

* requested changes
2021-04-08 15:40:28 +03:00
Prince kushwaha
0d23e65e0f
fix:Setting Language list is not an language list which is supported by Commons for caption and description (#4325) 2021-04-07 23:33:47 +09:00
Aditya-Srivastav
049dd7c79a
Fixes #4278 "Media details categories editor: Category not actually added" (#4328)
* rectified category update

* changed class name, added javadoc

* javadoc
2021-04-06 16:56:34 +03:00
Ayan Sarkar
c12ecf881b
Fixed help icon invisible issue. (#4323) 2021-04-06 15:41:12 +03:00
Prince kushwaha
12547fd34a
fix:App should respect device font-size (#4306)
* * Add adjuctFontScale function  to fix issue
* Add Javadoc

* reformed the codechange

* rearrange the codechange

* make metric and wm variable final
2021-04-06 17:47:38 +09:00
translatewiki.net
881239dc59 Localisation updates from https://translatewiki.net. 2021-04-05 15:24:55 +02:00
Madhur Gupta
b939db91e0
Update Tests for Profile Activity (#4324) 2021-04-05 11:30:36 +03:00
Pratham Pahariya
c269693625
Fixes #4296 - "Is this a picture of ...": Not too clear about which image it is asking me about (#4317)
* fix issue 4296

* minor improvements

* minor improvement

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-04-05 17:03:11 +09:00
Aditya-Srivastav
24f61a1142
retain focus on location bookmarks (#4316) 2021-04-03 18:01:11 +09:00
Ayan Sarkar
40b2619ccf
Added Help link in Alert Dialogue (#4315)
* READ MORE button added

* Added link to tips

* Fixed minor issues
2021-04-03 17:55:19 +09:00
Madhur Gupta
5ddbc9e27a
Add More Unit Tests for NotificationActivity (#4314) 2021-04-02 12:44:28 +03:00
Pratham Pahariya
a479dd5bb1
#4048 - "copy to subsequent media" button (#4308)
* added copy to subsequent media button

* minor change

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-04-02 09:12:11 +03:00
Aditya-Srivastav
ff96f5047e
Fixes #4287 "Tapping multiple items in explore should not be allowed" (#4310)
* only one media detail at a time

* requested changes

* disabled multitap on screen

* requested changes
2021-04-01 23:24:48 +09:00
translatewiki.net
4dfad52685 Localisation updates from https://translatewiki.net. 2021-04-01 13:40:35 +02:00
translatewiki.net
d0f895416a Localisation updates from https://translatewiki.net. 2021-03-29 17:53:41 +02:00
Gabriel Lee
7a04a2bf9c
Simplify peer review button text (#3376) (#4303)
* Simplify peer review button text (#3376)

The lengthy button text was not showing correctly, discussions concluded
that the button texts could be simplified to just "yes" or "no". To ensure
code read-ability, the buttons were renamed. Also made slight code style
adjustments to ReviewImageFragment.java and fragment_review_image.md.

Bug: #3376

* Remove string translate file changes from patch
2021-03-24 12:38:53 +03:00
Saumia Singhal
0857eae082
set icon frame visibility to View.GONE for all preferences (#3863) 2021-03-24 12:16:08 +03:00
Madhur Gupta
6449d8f639
Add Grid View Adapter Unit Tests (#4301) 2021-03-23 12:57:24 +03:00
translatewiki.net
e728d71c56 Localisation updates from https://translatewiki.net. 2021-03-22 15:36:40 +01:00
translatewiki.net
1c4c0f18f1 Localisation updates from https://translatewiki.net. 2021-03-18 13:41:56 +01:00
Pratham Pahariya
944225c3a3
Fixes #4260 - Item with P582 (end time) shown as existing (#4292)
* fix issue with item with endtime shown as existing

* Removed destroyed and endtime, Added comments and also fixed the broken tests

* minor fix

* Added comments

* fix no such column location_exists error

* minor improvement

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-03-18 00:05:08 +09:00
translatewiki.net
d00127947c Localisation updates from https://translatewiki.net. 2021-03-15 19:02:06 +01:00
Ankit Bhardwaj
d46fe3f271
- Leaderboard ranking text fixed to show rank in one line only (#4294) 2021-03-15 15:15:11 +03:00
translatewiki.net
d766d6f399 Localisation updates from https://translatewiki.net. 2021-03-12 06:55:13 +01:00
translatewiki.net
783b3858a2 Localisation updates from https://translatewiki.net. 2021-03-08 15:48:37 +01:00
marcosliberal
5e23bb88aa
removed unused strings (#4289)
* removed unused strings

* reverted changes in string files that are automatically managed
2021-03-06 00:35:50 +09:00
Aditya-Srivastav
5c02b2fc0a
changed column name (#4288) 2021-03-04 16:55:21 +03:00
translatewiki.net
c3d28eb81e Localisation updates from https://translatewiki.net. 2021-03-04 13:57:32 +01:00
Aditya-Srivastav
7a5774e479
Fixes #4281 "Wrong language pre-selected in Nearby upload" (#4285)
* location added

* tests

* changes requested

* comments

* Test fixed, minor improvement
2021-03-04 15:51:28 +03:00
Fawziyah Alebiosu
91a5aa1abe
Delete categoryImagesActivity (#3878)
* deleted categoryImagesActivity test & activity

* deleted categoryImagesActivity reference in ActivityBuilderModule

* deleted categoryImages from manifest

* deleted categoryImages import from ActivityBuilderModule

* deleted categoryImagesActivity
2021-03-03 21:17:29 +03:00
積丹尼 Dan Jacobson
593ccdb16a
Reassure user who might have only one image to upload (#4010)
Help fix https://github.com/commons-app/apps-android-commons/issues/4005 .
2021-03-03 21:07:48 +03:00
Prince kushwaha
a4bdd23718
fix:Explore Search: No title bar for item, non-existent menu for item, wrongly-worded menu for category (#4274) 2021-03-03 15:39:42 +03:00
Mrudul Tora
9b91eb9095
Changed label of Limited Connection switch (#4240) 2021-03-03 18:03:38 +09:00
Aditya-Srivastav
9cf59f7801
fixes #4266 'Image Dimensions should be reduced if too large" (#4279)
* height restriction

* requested changes

* removed landscape drawee view

* javadoc
2021-03-01 23:37:44 +09:00
translatewiki.net
9fd6521c40 Localisation updates from https://translatewiki.net. 2021-03-01 14:42:37 +01:00
Pratham Pahariya
e5c89c0b8b
Fixed two item was inaccessable with bottom sheet in landscape mode. (#4187)
scrollview is added so that last options are scrollable.
2021-03-01 16:41:09 +03:00
Pratham Pahariya
93cd89a34b
Fixes #4255 - Media details activity shows depictions in random languages, rather than in the user's locale (#4275)
* fixes issue with depiction names in random languages

* minor change

* using if conditions to check

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-03-01 20:50:09 +10:00
Aditya-Srivastav
0a857974f0
fixes #3440 "Campaign notification is not removed from Home even when disabling it in the setting" (#4231) 2021-02-27 19:27:06 +03:00
Pratham Pahariya
630c2a5dcd
#3732 - Nearby Tab Accessible Without Location Permission (#4259)
* Added ability to access nearby tab without location permissions

* added ability to remember user choice if the permission is denied.

* fixed the issue with permission dialog box in contribution tab.

* changed name for stored variables

* minor change

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-02-26 21:49:11 +09:00
Mrudul Tora
ba000eb26e
Fixes #4129 Resolved App crash on logging out from Contributors Tab (#4257)
* Resolved App crash on logging out from Contributors Tab

* Moved if condition in fetchContributions method
2021-02-26 17:21:16 +09:00
translatewiki.net
5692228c78 Localisation updates from https://translatewiki.net. 2021-02-25 16:16:09 +01:00
Pratham Pahariya
d6dcd43902
Fixed the issue with shortcuts (#4195)
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-02-23 23:39:58 +09:00
Pratham Pahariya
e82fdd0f4f
Fixes #2803 - Cancel nearby upload -> Next upload gets the same title/description 2021-02-23 16:42:41 +03:00
Mrudul Tora
6be9317eac
Hided Peer Review in Limited Connection Mode (#4247) 2021-02-23 16:06:00 +03:00
Mrudul Tora
0ec62170fc
Removed category editing accessibility when user not logged in (#4251) 2021-02-23 18:53:03 +09:00
Mrudul Tora
a83006fc7b
Fixed crashing on setting avatar when not logged in (#4258) 2021-02-23 18:43:32 +09:00
Madhur Gupta
64993dfbc8
Add few more unit tests for AchievementsFragment (#4272) 2021-02-23 19:43:20 +10:00
Prince kushwaha
8fa26bb00c
fixes 4252 (#4267)
* In Appbar add android:background="?attr/mainBackground"
2021-02-23 18:00:00 +09:00
Aditya-Srivastav
f7d1fab566
Fixes #2252 "Tapping on map doesn't close tab in 'nearby'". (#4265)
* closing the list on tap ouside

* minor improvement

* minor changes

* javadoc

* official javadoc

* javadoc error
2021-02-23 17:17:11 +09:00
translatewiki.net
88be88f25c Localisation updates from https://translatewiki.net. 2021-02-22 16:35:19 +01:00
Madhur Gupta
5f1dda146e
Add BookmarkPicturesFragment Unit Tests (#4264) 2021-02-22 21:15:12 +10:00
Pratham Pahariya
d81caf6a42
Fixes #4218 - In-App notifications appear on media detail fragment (#4246)
* Fixed issue with In-App Notification appearing on media detail view.

* Added a comment

* fixed style issues

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-02-22 19:00:28 +09:00
Aditya-Srivastav
7d8ea51c4f
Added bookmark section in not-logged-in version (#4256)
* added bookmark in not-logged-in version

* javadoc

* javadoc update

* spacing

* added unit test
2021-02-22 00:23:41 +09:00
Prince kushwaha
4f130e4dd0
fix:click on skip button in Peer Review after orientation change then app is crashed (#4176)
* #fixes-4143
In ReviewActivity overrides two function-> onResume() and onPause()

* Fixed the Bug-#4143

* reformed the codechange

* reformed the codechange

* Add javadoc

* Add javadoc
2021-02-21 10:58:07 +09:00
Mrudul Tora
9075b65ddf
Fixes #4244 - App crash in WikidataItemDetailsActivity resolved (#4248) 2021-02-20 21:35:28 +09:00
Aditya-Srivastav
68689980ee
fixed #4230 'Opening notifications in "Read" section still marks them read and removes them from the list'. (#4249)
* notifications fixed

* refractored

* javadoc
2021-02-20 10:00:22 +09:00
Pratham Pahariya
b8cdc5a537
Fixes #4229 - App Crashes while trying to nominate an item for deletion, When User is not logged in (#4237)
* Fixes the crash while nominating an item for deletion.

* removed unnecessary code

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-02-19 10:48:39 +09:00
Aditya-Srivastav
850d9411a5
Fixes #4211 "Location not available" while fetching location updates 2021-02-17 22:02:14 +10:00
Aditya-Srivastav
7cb5ff9167
Fixed #4232 App crashes on trying to upload a media from gallery. (#4235)
* ExifFixed

* requested changes

* requested changes

* indentation
2021-02-17 18:38:11 +09:00
Prince kushwaha
6293f90950
fix app crash in CategoryDetailsActivity (#4233)
Thanks Prince kushwaha!
2021-02-17 16:37:29 +09:00
Bbiswabasu Roy
ac297e42f6
view in browser changes to view file page (#4214)
* view in browser changes to view file page

* Capitalization changed to "View file page"
2021-02-16 23:27:39 +09:00
Roshan Prakash Raut
a8bbd416da
Fixes:#4073 Old UI tests related with nav menu and user icon are deleted. (#4213) 2021-02-16 13:31:52 +03:00
Prince kushwaha
2695bbaf4b
fix- #2770 -Incomplete Nearby List shown in Landscape mode (#4188)
* fix-Incomplete Nearby List shown in Landscape mode (#2270)

* fix-Incomplete Nearby List shown in Landscape mode (#2770)

* added the setLayoutParams() method

* reformed the codechange
2021-02-15 21:01:48 +03:00
Pratham Pahariya
37c39ad55f
Fixed the issue with blank screen after changing the theme. (#4220)
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-02-15 23:52:35 +09:00
translatewiki.net
2a68181a90 Localisation updates from https://translatewiki.net. 2021-02-15 14:41:21 +01:00
Taco
38f80687b1
Remove duplicate ViewPagerAdapter (#4222) 2021-02-15 21:50:30 +09:00
Taco
ee50bc8188
Update AndroidX Browser and ExifInterface to latest version (#4223) 2021-02-15 21:35:20 +09:00
Aditya-Srivastav
1a31265770
Fixes #4215 "Swiping on the last item in explore featured tab takes you to uploaded via mobile" (#4227)
* scrolling disabled on media details

* javadoc added

* javadoc modified
2021-02-15 14:41:55 +09:00
Nicolas Raoul
7d5773f235
Updated table of contributors 2021-02-14 23:00:42 +09:00
translatewiki.net
f3efeb5d4b Localisation updates from https://translatewiki.net. 2021-02-11 18:46:12 +01:00
translatewiki.net
5ae0d41a61 Localisation updates from https://translatewiki.net. 2021-02-08 17:16:29 +01:00
Prince kushwaha
944bede42d
fixes - #3559 - Failed to send thanks" notification, but thank actually sent successfully
I create another Model Class->"MwThankPostResponse.java" to store the Result of Post Request POST(MW_API_PREFIX+"action=thank")
2021-02-08 16:50:30 +03:00
Prince kushwaha
8384ad03dc
fixes - #1984 -Upload count does not get updated right away post successful upload
->implements the Callback method to update total number of media uploaded
2021-02-08 15:06:16 +03:00
translatewiki.net
3ad16d120f Localisation updates from https://translatewiki.net. 2021-02-04 08:49:18 +01:00
translatewiki.net
594e644b8b Localisation updates from https://translatewiki.net. 2021-02-01 15:19:42 +01:00
translatewiki.net
65a3b1b73a Localisation updates from https://translatewiki.net. 2021-01-28 18:46:16 +01:00
translatewiki.net
07a8a35da5 Localisation updates from https://translatewiki.net. 2021-01-25 18:02:01 +01:00
maxbetton
5c3bb4fa6e
Fixes Trailling Whitespaces In Strings (#4200) 2021-01-25 17:27:55 +03:00
Adam Jones
89737b2640
#747: Convert action package (ThanksClient and PageEditClient) to Kotlin (#4075) 2021-01-23 14:36:01 +05:30
Pratham Pahariya
36406bad85
Fixed the issue with back button in contribution tab. (#4177)
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-01-22 01:30:25 +10:00
translatewiki.net
bad65e3e12 Localisation updates from https://translatewiki.net. 2021-01-21 15:07:09 +01:00
Aditya-Srivastav
b58d135b4c
Fixes #4178 Bookmarks not Updated in Picture section after remove 2021-01-20 20:35:33 +03:00
Pratham Pahariya
edef23f03d
Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.
Fixes #4159 On Explore Tab, All Available Options on toolbar in media detail view are only targeting the first media in the list.
2021-01-20 20:18:55 +03:00
Shabir Ahmad
e70fea64fb
fixed bug: App crashes on viewing review in Review Fragment #4132 (#4146)
* fixed bug:app crashes on viewing review in Review Fragment #4135
2021-01-20 18:06:08 +03:00
translatewiki.net
9c82ce1db9 Localisation updates from https://translatewiki.net. 2021-01-18 16:43:59 +01:00
KushMehta1511
f3ee74d436
Update comments in ThanksClient.java (#4183) 2021-01-16 17:33:18 +05:30
Pratham Pahariya
ca82addb58
Fixed the issue with back navigation button on toolbar in explore tab. (#4175) 2021-01-15 12:42:43 +05:30
translatewiki.net
a47f763b6a Localisation updates from https://translatewiki.net. 2021-01-14 15:34:44 +01:00
Madhur Gupta
aec563efe9
Added Few more Login Activity Tests (#4164) 2021-01-14 02:41:09 +10:00
Madhur Gupta
c8753e8b38
Added Settings Activity Tests (#4165)
* Added Settings Activity Tests

* Remove extra lines
2021-01-14 02:40:10 +10:00
Madhur Gupta
653a41ce24
Added Notification Activity Tests (#4166) 2021-01-14 02:40:04 +10:00
Madhur Gupta
381f54c5ef
Added Review Activity Tests (#4167)
* Added Review Activity Tests

* Remove Unused Code
2021-01-14 02:39:47 +10:00
Madhur Gupta
9296ef6fbd
Extend About Activity Tests (#4168) 2021-01-14 02:39:27 +10:00
Madhur Gupta
cd3ba67cfb
Add Category Details Activity Unit Tests (#4169) 2021-01-14 02:39:14 +10:00
Madhur Gupta
a62c2f5cf0
Add Main Activity Unit Tests (#4171) 2021-01-14 02:38:51 +10:00
Madhur Gupta
7f2316fe46
Add More Bottom Sheet Fragments Unit Tests (#4172)
* Add More Bottom Sheet Fragment Unit Tests

* Add More Bottom Sheet Logged Out Fragment Unit Tests
2021-01-14 02:38:31 +10:00
KushMehta1511
bd90497936
Updating comments in PageEditClient.java (#4170)
Description (required)

Fixes commons-app#4161
In the comments of the class PageEditClient.java "@param pagetitle" is written in three areas in this file. It should have been "@param pageTitle" with capital T as pageTitle is being passed as an argument rather than pagetitle.

What changes did you make and why?
Changes are made in the comments of fil where the parameters for Observable method are stated. pagetitle has been changed to pageTitle as the correct argument passed. This change would increase the code readability for fellow developers.
2021-01-13 13:36:18 +05:30
Madhur Gupta
57aab1927a
Add Achievements Fragment Tests (#4162) 2021-01-12 00:30:04 +00:00
Madhur Gupta
67a9bd56fb
Add Login Activity Test (#4160) 2021-01-12 00:17:27 +00:00
Aditya-Srivastav
c4bd23f7a1
Fix (#4148) Issues on theme change
* fixed themeChange crashes

* fixed comments

* Overlooked the title bar
2021-01-11 17:21:44 +03:00
Prince kushwaha
2d884b44ca
Repull request of fixes #4081 App is crash when Backbutton is pressed from Favourites Fragment(#4104)
fixes NullPointerexception in Favorities when backButton is pressed
2021-01-11 16:03:02 +03:00
translatewiki.net
8e9b39fa8d Localisation updates from https://translatewiki.net. 2021-01-07 15:17:08 +01:00
Josephine Lim
47b87444a7
Versioning and changelog for v3.0.0 (#4152) (#4153)
* Versioning for v3.0.0

* Update changelog.md
2021-01-06 01:20:18 +10:00
Madhur Gupta
e36640377a
Added Search Activity Unit Tests (#4149) 2021-01-05 03:05:59 +10:00
translatewiki.net
e406b7f54a Localisation updates from https://translatewiki.net. 2021-01-04 14:41:15 +01:00
neslihanturan
d19c183c04
Use blue icon on light theme instead (#4144) 2021-01-02 23:07:03 +10:00
neslihanturan
b06f875812
Fixes #4079 Menu item are not visible (#4145)
* Revert custom stylings of toolbar

* Enable back button on toolbar
2021-01-02 23:06:08 +10:00
Prince kushwaha
86c571ceee
fix app Crash when tapping on the nearbyNotification (#4139)
* bugfix-#4086
-> implement CallBack interface in MainActivity centerMapToPlace() function

* update previous  commit

* reformed the codechanges
2021-01-01 19:33:35 +03:00
Aditya-Srivastav
7730112807
fixed the contribution crash on scroll (#4128)
* fixed the contribution crash on scroll

* Investigation

Just to get the Log of the issue

* fixed null data causing scroll to top

* Removed unneeded log import.
2021-01-01 18:10:10 +03:00
Pratham Pahariya
e1be458821
Fixed issue with notification count. (#4126)
Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2021-01-01 17:09:48 +03:00
ayushijain22
8c3c9cf2a7
Update CONTRIBUTING.md (#4113) 2020-12-31 00:11:09 +09:00
Tim Dillon
e477e7e352
Fix truncated Caption hint text (#4122) 2020-12-31 00:09:38 +09:00
translatewiki.net
f0e354b8ed Localisation updates from https://translatewiki.net. 2020-12-29 08:46:44 +01:00
Prince kushwaha
6286607fc5
fixes In nearby tab when back button is pressed nothing happen(#4096) (#4102)
* fixes #4096

* reformed the codechange

* reformed the codechange
2020-12-29 00:32:55 +09:00
Madhur Gupta
c3700c9234
Added Signup Activity Test (#4134) 2020-12-28 20:23:03 +10:00
Saral Verma
c461f1134c
Fixed 4115 achievement issue (#4138) 2020-12-28 20:16:13 +10:00
Pratham Pahariya
5bdb21cb3e
Fixed issue with "Copy previous captions & descriptions". (#4109)
* Fixed issue with "Copy previous captions & descriptions".

* Added comments and also fixed the styling issue.

Co-authored-by: Pratham2305 <Pratham2305@users.noreply.github.com>
2020-12-27 19:48:57 +09:00
Saral Verma
170ecaa570
Used instance to solve the issue (#4108) 2020-12-27 19:12:47 +09:00
Harsh Maheshwari
1ccb3578e8
issue #3996 solved (#3999) 2020-12-22 21:22:40 +03:00
Saral Verma
b2823514ed
solved issue 4043 : overlapping (#4117) 2020-12-22 19:42:21 +03:00
Prince kushwaha
e2af11da0b
fixes #4101 (#4103)
->remove android:background="@color/white"
->add android:background="?attr/mainBackground"
2020-12-22 15:53:15 +03:00
積丹尼 Dan Jacobson
ca5585860d
Ask for location permission != Display location permission (#4008)
Making the title and body finally agree with each other.
2020-12-22 15:29:12 +03:00
FliegendeWurst
174db88ae8
Fix category links in media detail (#3957) 2020-12-22 14:34:31 +03:00
Adam Jones
5b526c6c27
Revert: Gradle dependency bump in "Add CI with GitHub Actions" (#4121)
* Revert "Add CI with GitHub Actions (#4078)"

This reverts commit 52ab160d38.

* Downgrade ubuntu version
2020-12-22 18:11:30 +10:00
Adam Jones
52ab160d38
Add CI with GitHub Actions (#4078)
* Create android.yml

* Bump ABT and Gradle versions

* Update android.yml
2020-12-22 05:04:41 +10:00
Aditya-Srivastav
a0af174d72
Erroneous data fixed (#4119) 2020-12-22 04:49:47 +10:00
Aditya-Srivastav
b1a691a4fa
Author name in Dark theme fixed. (#4110) 2020-12-18 22:20:08 +03:00
translatewiki.net
e454cfd98f Localisation updates from https://translatewiki.net. 2020-12-17 15:11:21 +01:00
Aditya-Srivastav
ae18b24e92
flickering fixed (#4095) 2020-12-17 03:19:12 +10:00
neslihanturan
9e92c95d42
Remove individual remove and add metods, use only setItems for setting items instead (#4107) 2020-12-16 01:10:05 +10:00
translatewiki.net
58cd7b85a1 Localisation updates from https://translatewiki.net. 2020-12-14 15:03:14 +01:00
Vivek Maskara
5c6e777b37
Fix issue where upload notification shows up on app start (#4099) 2020-12-14 22:55:17 +10:00
Saral Verma
0415a57d34
Regarding issue 4042: bordering (#4071) 2020-12-13 00:27:06 +05:30
neslihanturan
7d8e09f708
Adds more obvious display for limited connection mode (#4094)
* Limited connection is enabled layout is added

* Add a layout to indicate limited connection is active

* fix string
2020-12-12 02:11:53 +10:00
Prince kushwaha
e581318fc6
fixes #4072 (#4074)
->add an function->setSupportActionBar()
->add some attributes
2020-12-11 01:28:03 +10:00
translatewiki.net
7e482d7883 Localisation updates from https://translatewiki.net. 2020-12-10 13:44:21 +01:00
Adam Jones
86eb2f6ca7
Revert build changes (#4087)
* Revert "#171: Bump Triple-T gradle-play-publisher (#4083)"

This reverts commit c19858069b.

* Revert "Bump ABT and Gradle versions (#4076)"

This reverts commit 356aa87f84.
2020-12-10 03:20:55 +10:00
neslihanturan
3aa7a13ec5
Make sure exif is added if exists and not addet if null or 0.0 (#4082)
* Make sure exif is added if exists and not addet if null or 0.0

* Move boolean to bottom to cover both cases
2020-12-10 03:18:10 +10:00
Adam Jones
c19858069b
#171: Bump Triple-T gradle-play-publisher (#4083)
For alpha builds we use the gradle-play-publisher to automatically package and publish the app. In older versions there was a compatibility bug with Gradle 6.3 (https://github.com/Triple-T/gradle-play-publisher/issues/797). Using the updated version (2.8.1) should fix the problem.

There is version 3.0.0, however I've stuck to 2.8.1 as the breaking change of 3.0.0 is that it no longer supports PKCS keys (.p12 files) which we use.
2020-12-07 23:25:55 +00:00
translatewiki.net
dc3e0665bf Localisation updates from https://translatewiki.net. 2020-12-07 15:40:02 +01:00
Adam Jones
356aa87f84
Bump ABT and Gradle versions (#4076) 2020-12-07 21:28:28 +10:00
Kaartic Sivaraam
b24ed1cf6c
Rename Mapbox telemetry setting (#3995)
Fixes #3946

"Telemetry Opt Out" is a contradictory name for the telemetry setting
as it contradicts the option description by conveying that enabling
the setting means the user has opted out of telemetry while that is
not the case. Enabling the setting means telemetry would be sent
to Mapbox.

So, use a better name that conveys the meaning in a better way without
any contradiction.
2020-12-05 18:52:54 +00:00
Madhur Gupta
c1659f2bc0
Added Tests for Profile Activity (#4062) 2020-12-05 18:49:25 +00:00
translatewiki.net
4ac1b2d338 Localisation updates from https://translatewiki.net. 2020-12-03 15:41:49 +01:00
Ashish
d720750ab4
Fixes invalid authorname in explore (#4054)
* Fixes #3341, #4018
* Defined two feild author and user in Media and used them at the corresponding places
Minor bug fixes
-displaying userName in uploadedBy.
-modified HTML parsing in getArtist.
-Replaced creator with author.

* Fixes #3341, #4018
* Defined two feild author and user in Media and used them at the corresponding places
Minor bug fixes
-displaying userName in uploadedBy.
-modified HTML parsing in getArtist.
-Replaced creator with author.
2020-12-01 23:56:41 +10:00
Ashish
f1b40728b2
Fixes #343 (#4057)
Removed the quantity item zero from string plural contributions_subtitle
Handled zero uplaod count from MainActivity
2020-12-01 21:08:30 +10:00
translatewiki.net
2c5a45760f Localisation updates from https://translatewiki.net. 2020-11-30 17:01:28 +01:00
Ashish
0f9d462e6e
Fixes #4051 (#4052)
* null check on mediaDetails
2020-11-28 11:22:00 -07:00
Ashish
8a860345fe
Fixes 4019 (#4050)
Passed application context to adapter instead of the activity context
2020-11-28 11:17:22 -07:00
translatewiki.net
9202c3ac09 Localisation updates from https://translatewiki.net. 2020-11-26 17:49:21 +01:00
Anadi Kashyap
cbca290e4d
upload: made duplicate picture dialog more informative and added checkbox to never show again (#4045) 2020-11-25 20:03:37 +10:00
neslihanturan
0b5f56b682
Fixes theme change issue (#4029)
Catch Service Unregistered exception in Activity's onDestroy
2020-11-25 10:32:12 +05:30
Prince kushwaha
9375a8ba11
fixes Progress Bar Visibility change with Orientation Change and login process terminated (#4001) (#4028)
* fixes #4001
* Overrides the onSaveInstanceState method and onRestoreInstanceState method in LoginActivity.java
* In onSaveInstanceState save  ProgressDailog state or visiblity and text of TextView(errorMessage)
* In onRestoreInstanceState restore All saved Data

* Update the commit -1a92b17e37

* formatting the codechanges

* reformated the codechange
2020-11-24 03:41:02 +10:00
translatewiki.net
f7af27bfa1 Localisation updates from https://translatewiki.net. 2020-11-23 15:18:59 +01:00
Prince kushwaha
ecd19e389c
fixes #4026 (#4041)
* TextInputLayout does not support multiple line textView
* Add the TextView to show the @string/depicts_search_text_hint
2020-11-23 21:29:22 +10:00
translatewiki.net
e39ace5d95 Localisation updates from https://translatewiki.net. 2020-11-19 15:45:46 +01:00
neslihanturan
ffdfb05d5f
Fix black map issue (#4040) 2020-11-18 05:11:34 +10:00
Anadi Kashyap
c93ab86d65
upload: added titles for each step of upload with a tooltip for futher explanation (#4030) 2020-11-17 19:14:16 +10:00
translatewiki.net
d2b6c7002b Localisation updates from https://translatewiki.net. 2020-11-16 15:13:31 +01:00
Madhur Gupta
2ed5a74b4d
Added Test for BookmarksPagerAdapter (#4027) 2020-11-10 20:25:01 +10:00
translatewiki.net
1baea1ef74 Localisation updates from https://translatewiki.net. 2020-11-09 12:34:51 +01:00
Vivek Maskara
6fa8cc627a
Increase chunk size to 1MB (#4011)
* Increase chunk size to 1MB

* Increase timeouts

* Add logs

* Enable HTTP logging

* Encode file name

* Update chunk size

* Add toast
2020-11-09 19:41:49 +10:00
neslihanturan
71d200ee41
Fixes #2843 New main screen UI in v3.0 (#3891)
* Add additional classes from 2019 hackathon implementation

* Make first tab work

* Make explore tab work

* Handle back button for contrib and nearby

* Fix framelayout and nav bar allignment

* Fix nav bar tint

* Fix nearby card layout

* Make contributions number visible

* Change menu icon according to fragment

* Make notification icon work and remove drawer

* Make favourites accessible from nav bar

* Turn bookmark and explore activities into fragments

* Use bottom sheet instead of more fragment

* Add actions

* Remove unused classes

* Fix indentation

* remove more fragment title

* Fix explore fragment indentation

* Make toolbar settings as we wanted

* Set card view styles

* Make colors for explore actiivty

* Remove drawer from achievements activity

* Add back button to achievements activity

* remove drawer from review activity

* Remove drawer from settings activity

* Remove drawer from about activity

* Fix dagger injection of fragment

* Implement skip login version

* Add theme missing colors

* Add style to moresheet

* refactor name

* call login with button

* Remove all old bookmarks activity dependency

* Make explore tab items clickable

* Do nothing if same tab is selected

* Fix notification icon color for dark theme

* Fix wrong drawable colors

* Handle back button after media details is visible from contrib and explore fragments

* make favourites open media details

* Fix profile icon

* Make user name visible instead

* Move user back to contrib fragment

* Remove NavigationBaseAvticity

* Fix typo in bookmark fragment

* Fix menu button colors

* Remove explore activity

* remove drawer and dependencies

* Make bookmark media details visible

* Cleanup code

* Code cleanup

* Remove unused layout

* Make contriblist UI look like in mockups

* Change limited connecton toggle

* Move list menu item to nearby fragment

* Fix search button crash

* Make media detail appear

* Back button added

* Fix back button npe

* Change bookmark list view

* Fix always the firs item displayed issue

* Allign contrib list bottom line to simple drawee bottom

* fix fragment string

* Fix back button for mobile uploads

* Make lists appear

* Make fav item selected

* Make favourites clickable

* Add back button to media details

* Add toolbar of notification activity

* Change contributions icon

* Fix card UI

* Fix back button in explore

* Make card views look similar to mockups

* Solve campaign bug visible issue

* Make borders a little softer
2020-11-07 02:04:04 +10:00
translatewiki.net
5d82629109 Localisation updates from https://translatewiki.net. 2020-11-05 13:18:19 +01:00
積丹尼 Dan Jacobson
d4b73fad7f
Make "Save Pictures" option clear (#4006) 2020-11-03 00:31:17 +05:30
translatewiki.net
203d44e099 Localisation updates from https://translatewiki.net. 2020-11-02 12:38:44 +01:00
積丹尼 Dan Jacobson
ee2f7e51b6
"Tapping" misleading for switch (#4009)
This is a switch. "Tapping" shouldn't be mentioned here.
2020-11-01 22:12:32 +05:30
Mugurell
c793827c5c
For #3997 - Add new FOREGROUND_SERVICE permission for AndroidP+ (#4002)
On Android 28+ this is required for starting foreground services.
It is a normal permission, automatically granted by Android.
2020-10-30 08:54:02 +09:00
translatewiki.net
585304190f Localisation updates from https://translatewiki.net. 2020-10-29 13:15:26 +01:00
Josephine Lim
9d99c2598f
Update target SDK to 29 (#3940) 2020-10-28 22:56:07 +05:30
Rebecca Rothschild
ee3e52d0c6
#3980 Hitting "My Rank" button from a list position below your rank on leaderboard takes you to the person ranked below you (#3990)
* Refactored scrollToUserRank to account for users scrolling from below their rank

* Refactored my change to use a similar method

* Added comments to change

* Removed leftover cruft

* Reverted package updates

* Added tests for the LeaderBoard UI
2020-10-28 23:21:58 +09:00
Ashish
39221f5365
Fixes #3767 (#3965)
*Set a default value of 0 to avoid invisibility, before calling the API.
2020-10-27 21:01:22 +03:00
Prince kushwaha
3fa391f8ef
Losing filled data when screen rotate (#3973) (#3982)
Fixes #3973

* Add an attribute android:configChanges="screenSiz orientation|screenLayout" in  auth.SignupActivity Manifes.xml
2020-10-27 23:28:00 +05:30
translatewiki.net
ebaf9bf6bd Localisation updates from https://translatewiki.net. 2020-10-26 15:55:05 +01:00
Ashish
285422e23d
Fixes #3788 (#3966)
*Distinctively show quality images and featured images in Achievements
2020-10-26 17:03:10 +10:00
Ashish
2ea966ab09
Fixes #3981 (#3983)
* Start the upload service when needed and not in the MainActivity directly
2020-10-25 22:50:20 -07:00
Vivek Maskara
6c55525a43
Handle failures in chunk uploads (#3916)
* Handle failures in chunk uploads

* Fix failures

* Upload fixed

* Handle multiple file upload

* Increase request timeout
2020-10-25 12:26:48 +05:30
Madhur Gupta
0d5fa048a5
Added Unit Test for About Activity Class (#3978) 2020-10-24 11:02:23 +05:30
translatewiki.net
f36561f0c7 Localisation updates from https://translatewiki.net. 2020-10-22 12:57:24 +02:00
Kaartic Sivaraam
409e43c3ae
README: use F-droid badge with surrounding space (#3979)
* README: use F-droid badge with surrounding space

The F-droid badge in Commons has a newer revision that doesn't have
the surrounding blank space thus resulting in it being rendered bigger
than the play store badge.

Link to the older version of the image with surrounding blank space
to ensure both badges are of the same size.

* REDAME: bring back alt text for F-droid badge

Re-add the unintentionally removed F-droid badge alt text.
2020-10-21 22:22:41 +03:00
Ashish
1fc8c15c08
Fixes #3547 *Catch possible SqliteException while deleting ContributionsDao's entries (#3964) 2020-10-20 17:54:44 -07:00
Ashish
b8ba89d077
Fixes #3923 (Back" does nothing in Nearby in particular circumstance) (#3961)
* Fixes #3923
* Handled possible missing backpress cases in MainActivity-nearby

* Fixes #3923
* Handled possible missing backpress cases in MainActivity-nearby
2020-10-20 12:41:17 -07:00
translatewiki.net
6e8e4f7a41 Localisation updates from https://translatewiki.net. 2020-10-19 14:51:26 +02:00
translatewiki.net
2f2e948a46 Localisation updates from https://translatewiki.net. 2020-10-12 15:47:21 +02:00
Ashish
f6963c8d47
Fixes #3845 (Contributions list starts at the last uploaded pic, not the currently uploading one) (#3962)
* Fixes #3845

* Fixes #3845
*Scroll to the top when a new upload item is added in a contribution list
2020-10-12 19:32:16 +10:00
Ashish
4571b76b82
Fixes #3943 (#3963)
* Fix telemetry opt-out preference toggler
2020-10-12 19:31:48 +10:00
Ashish
a85bd032a3
Fixes #3920 Send Log File" does not collect updated logs (#3958)
* Fixes #3920
* Delete stale log files post the zip file's size reaches 1000kb

* Fixes #3920
* Delete stale log files (if the size reaches more than 1000kb) on App startup to make room for fresh logs
2020-10-11 22:47:34 +10:00
translatewiki.net
7c5fafa4aa Localisation updates from https://translatewiki.net. 2020-10-08 15:51:12 +02:00
neslihanturan
2001da5471
Add tests for LatLng class (#3955) 2020-10-07 21:49:41 +10:00
neslihanturan
b9de8dc145
Add tests for FilePicker public methods (#3948) 2020-10-07 01:34:39 +10:00
Madhur Gupta
67c0004062
Added Test for Quiz Classes (#3953) 2020-10-06 16:36:20 +03:00
translatewiki.net
cb3de85646 Localisation updates from https://translatewiki.net. 2020-10-05 15:54:59 +02:00
translatewiki.net
b3d9bd6883 Localisation updates from https://translatewiki.net. 2020-10-02 09:03:58 +02:00
neslihanturan
44fb1534bb
Add bookmark location controller test (#3947) 2020-10-01 19:21:33 -07:00
neslihanturan
257e8c57dd
Add MediaConverterTest (#3945) 2020-09-30 12:00:43 -07:00
translatewiki.net
6ddc15a535 Localisation updates from https://translatewiki.net. 2020-09-28 17:13:51 +02:00
Vivek Maskara
66f6e2e648
With changes for limited connection mode (#3934)
* With changed for limited connection mode

* Java docs

* With minor fix

* Fix cosmetic issues

* Fix ANR

* Add Unit test
2020-09-25 22:57:22 +10:00
translatewiki.net
59ee7b8df2 Localisation updates from https://translatewiki.net. 2020-09-24 15:53:25 +02:00
translatewiki.net
4dc59aef12 Localisation updates from https://translatewiki.net. 2020-09-21 16:01:05 +02:00
Madhur Gupta
66469e006a
Added Unit Tests for WelcomeActivity Class (#3933) 2020-09-19 01:05:42 +10:00
translatewiki.net
93225149d8 Localisation updates from https://translatewiki.net. 2020-09-17 16:38:59 +02:00
translatewiki.net
fbe68e12c5 Localisation updates from https://translatewiki.net. 2020-09-14 17:00:16 +02:00
Ashish
ddd3e1212a
Sync master with release (#3922)
* #3624 DateTimeFormat wrong - match pattern returned from servers (#3625)

* Revert "Fixes: #3179 Make category search non case-sensitive (#3326)" (#3636)

Simply lower casing the name of the category sent to the server
doesn't result in the server doing a case insensitive category
search. In fact, it reduces the category search space as only
categories that has a lower case character is searched even
if the search text contains upper case characters.

The test case did not catch this issue as the first character
of the title is case insensitive[1].

So, revert the changes done in commit afdeaae075.

See further disucssion in the issue thread of #3179 starting
from [2].

[1]: https://www.mediawiki.org/wiki/Manual:Page_title
[2]: https://github.com/commons-app/apps-android-commons/issues/3179#issuecomment-605462140

* Bugfix/security exception (#3627)

* Fixes #3626
* Check is file is actually created before writing to file, file picker android

* Handle Security exception

* Fixes #3436 and #2881: Media Detail design Overhaul (#3505)

* ic_map_dark_24dp: map icon for white background

* ic_info_outline_dark_24dp: info icon for dark background

* MediaDetailFragment: update the spacer as per image aspect ratio

* fragment_media_detail: design overhaul

* fragment_media_detail: remove redundant background color statements

* make requested changes

* add dark mode support

* minor ui tweak

* white map icon in dark mode

* make rquested changes

* make requested changes to layout

* fix misalignment of category list

* subtle amendments

* convert comments to javadocs

* minor amendments

* minor changes

* add styles for media detail

* Media detail fragment refactored

* make suggested changes

* minor name fix

* fix the delete button border

* Fixes #3639 (Fix Save State implementation of CheckBoxTriState ) (#3686)

* Add #3723 and #3721 to 2.13 release, fix conflicts

Conflicts were caused by merging #3723 before #3721 , so I just rolled both into one commit.

* Fix NullPointer when clicking on image in MediaDetailFragment (#3730)… (#3739)

* Update changelog.md

* Versioning for v2.13

* Fixes #3705 (Crash when viewing pic I just uploaded) (#3782)

* Fixes #3705
* Let the MediaDetailPager fragment know when the contributions have been updated

* Handle NPE, null check on adapter in MediaDetailPagerFragment

* Fixed BookmarkLocationsDao DB migration (#3793)

* Fixes #3725 (#3795)

* Downgraded okhttp version to support Api 19 devices

* Handled null CompoundDrawable[2] in etTitle-> UploadMediaDetailsFragment (#3828)

* DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception (#3830)

* Fixes #3829
* DownSample Upload image to be shown in UploadMediaDetailFragment to handle OOM, Bitmap Too large exception

* removed unused imports, handled possible exceptions

* Let Fresco handle the downsampling of image

* invalidate in onTransformEnd

* Expose an interface TransformationListener in ZoomableDraweeView to listen to transformation change end

* removed photoView dependency

* removed unused imports in ZoomableActivity

* Bugfix, expand/collapse

* changed functio name

* Bugfix/p18 uploads (#3869)

* updated gradle plugin version

* BugFix #3856
* Do not use preference for deciding acceptable lat long for nearby uploads, instead save the corresponding location in the Contribution via UploadItem

* Marshall contribution's hasInvalidLocation

* reset un-related changes

* Fixed test cases

* Minor code formatting and docs

* Fixes #3882 (#3883)

* Make hasInvalidLocation non-null integer with default value 0

Co-authored-by: Ashish Kumar <ashish@Ashishs-MacBook-Air.local>

* Fixes #3766, Added OPENSTREET attribution (#3889)

* Fixes #3766
* Added OPENSTREET attribution in nearby

* Added custom text attribution in Nearby

* Deleted unused class CustomBorderTextView

* review suggested changes

* modified telemetry summary string

* Versioning and changelog for v2.13.1 (#3908)

* Update changelog.md

* Versioning for v2.13.1

* Fixes #3914 (#3915)

* Verify user login before setting upload count

* fixed compile-time error

* fix erros

* delete emptied files

* remove empty file CategoriesModel.java

Co-authored-by: Seán Mac Gillicuddy <seantheappdev@gmail.com>
Co-authored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Co-authored-by: Kshitij Bhardwaj <44129798+kbhardwaj123@users.noreply.github.com>
Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Josephine Lim <josephinelim86@gmail.com>
Co-authored-by: Ashish Kumar <ashish@Ashishs-MacBook-Air.local>
2020-09-14 21:11:46 +10:00
Madhur Gupta
abdd16c063
Added Test for LevelInfo Class (#3930) 2020-09-13 18:31:25 -07:00
translatewiki.net
3f23ea0723 Localisation updates from https://translatewiki.net. 2020-09-10 18:35:27 +02:00
translatewiki.net
c7a53af4f6 Localisation updates from https://translatewiki.net. 2020-09-07 16:38:37 +02:00
translatewiki.net
3b24dd12ab Localisation updates from https://translatewiki.net. 2020-09-03 16:37:36 +02:00
Ashish
4109d23023
Bugfix/categories search (#3913)
* Fixes #3734
* Donot ignore case while searching categories

* Fixed test-cases to ensure search terms are passed as it is to the CategoryClient

* Used a First_Char_Caps title list term just to ensure test case tests as intended

* Fixed searchAll with empty term test case
2020-09-01 02:00:36 +10:00
translatewiki.net
7f90361ffd Localisation updates from https://translatewiki.net. 2020-08-31 16:05:20 +02:00
Madhur Gupta
df209e752d
Added Auto Scroll (#3912)
* Fixed #3910 Truncated Spinners

* Added AutoScroll for Leaderboard Rank

* Revert Irrelevant Change

* Fixed Bounce Back Issue

* Fixed Incorrect UserRank Issue on Rotation

* Fixed Overlapping issue

* As per java convention
2020-08-28 21:00:37 +09:00
Madhur Gupta
01531de156
Fixed #3910 Truncated Spinners (#3911)
Wonderful, it works great in all screen sizes :-)
2020-08-28 08:53:38 +09:00
Madhur Gupta
eb816b4536
[GSoC] Merge Leaderboard branch with master (#3905)
* [GSoC] Fixes #3789 Updated UI of achievements activity to display level in first tab & Leaderboard in the second tab (#3794)

* Updated UI of achievements activity to display level in first tab and Leaderboard in the second tab

* Removed hardcoded string

* Fixes #3861 Use the APIs to fetch leaderboard’s based on uploads via mobile app (all time) and display it in the Leaderboard screen. (#3865)

* [GSoC] Added Unit Tests and Fixed Landscape Mode Bug (#3872)

* Fixes #3861 Use the APIs to fetch leaderboard’s based on uploads via mobile app (all time) and display it in the Leaderboard screen.

* Fixed Bug - missing data in landscape mode

* Added Unit Tests for Leaderboard

* Added JavaDocs

* Updated JavaDocs

* [GSoC] Added Pagination to Leaderboard (#3881)

* Fixes #3861 Use the APIs to fetch leaderboard’s based on uploads via mobile app (all time) and display it in the Leaderboard screen.

* Fixed Bug - missing data in landscape mode

* Added Unit Tests for Leaderboard

* Added JavaDocs

* Updated JavaDocs

* Added Pagination

* Added Merge Adapter

* Fixed Test Case

* Added Smooth Scroll

* Added Progress Bar for Paging

* Fixed Gradle

* [GSoC] Added option to set a new avatar (#3892)

* Fixes #3861 Use the APIs to fetch leaderboard’s based on uploads via mobile app (all time) and display it in the Leaderboard screen.

* Added option to set a new avatar

* [GSoC] Added Click to open user profile for leaderboard (#3887)

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* #3749 Improve MediaClient UnitTests  (#3846)

* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchDepictionsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace UploadCategoryDepictionsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - update BaseAdapter to be easier to use

* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchImagesRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchCategoriesRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace NotificationRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace UploadDepictsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace PlaceRenderer

* #3756 Convert SearchDepictionsFragment to use Pagination - convert SearchDepictionsFragment

* #3756 Convert SearchDepictionsFragment to use Pagination - fix presenter unit tests now that view is not nullable - fix Category prefix imports

* #3756 Convert SearchDepictionsFragment to use Pagination - test DataSource related classes

* #3756 Convert SearchDepictionsFragment to use Pagination - reset rx scheduler - ignore failing test

* #3760 Convert SearchCategoriesFragment to use Pagination - extract functionality of pagination to base classes - add category pagination

* #3772 Convert SearchImagesFragment to use Pagination  - convert SearchImagesFragment - tidy up showing the empty view - make search fragments show snackbar with appropriate text

* #3772 Convert SearchImagesFragment to use Pagination  - allow viewpager to load more data

* #3760 remove test that got re-added by merge

* #3760 remove duplicate dependency

* #3772 fix compilation

* #3780 Create media using a combination of Entities & MwQueryResult - construct media with an entity - move fields from media down to contribution - move dynamic fields outside of media - remove unused constructors - remove all unnecessary fetching of captions/descriptions - bump database version

* #3808 Construct media objects that depict an item id correctly - use generator to construct media for DepictedImages

* #3810 Convert DepictedImagesFragment to use Pagination - extract common media paging methods - convert to DepictedImages to use pagination

* #3810 Convert DepictedImagesFragment to use Pagination - rename base classes to better reflect usage

* #3810 Convert DepictedImagesFragment to use Pagination - map to empty result with no pages

* #3810 Convert DepictedImagesFragment to use Pagination - align test with returned values

* #3780 Create media using a combination of Entities & MwQueryResult - update wikicode to align with expected behaviour

* #3780 Create media using a combination of Entities & MwQueryResult - replace old site of thumbnail title with most relevant caption

* #3818 Convert SubDepictionListFragment to use Pagination - replace SubDepictionList with Child and Parent Fragments - replace contracts with simple presenter declarations - move classes to appropriate packages - delete unused network models - delete duplicated paging classes

* #3820 Convert CategoryImagesListFragment to use Pagination - replace CategoryImagesListFragment with CategoriesMediaFragment - disallow the construction of media objects without imageinfo

* #3822 Convert SubCategoryImagesListFragment to use Pagination - convert subcategories - add continuation support in category client - rely on interfaces for callbacks of PageableMediaFragments

* #3822 Convert SubCategoryImagesListFragment to use Pagination - convert parent categories - delete list fragment - creat base class to support continuation requests in clients

* #3822 Convert SubCategoryImagesListFragment to use Pagination - add tests for ParentCategoriesDataSource

* #3822 Convert SubCategoryImagesListFragment to use Pagination - remove no longer applicable test

* #3749 Improve MediaClient UnitTests - test rewrite

* #3749 Improve MediaClient UnitTests - align with buildConfig property

* With pause and resume for uploads (#3858)

* With pause and resume for uploads

* Dispose current upload

* Make pause and resume work

* Check stash validity

* With java docs

* minor

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Add nearby presenter unit tests  (#3615)

* init the test file

* Add tests to check if searchthisarea button action and checkbox actions are added after initialize test

* Add tests to locked unlocked nearby cases

* Add tests for null cases in updateMapAndList method

* Add test to check which locations are used to populate places, depending to LocationChangeType

* Add tests to test users position is not followed if blue dot (current location marker) is not visible

* Add tests to decide search this area method visibility on camera move

* Add tests for multi filteirng of placetypes

* add tests for single place type selection too

* Add tests to tests search view focus gain and bottom sheet visibilities

* Add tests for SearchCloseToCurrentLocation

* Remove two unneeded getter and setter for isNearbyLocked, use @VisibleForTesting annotation instead

* Add VisibleForTesting annotation to initializeNearbyOperations method so that it will be private by default

* Add missing tests

* Add tests for map updated case and add missing lines those are being tested

* Add some missind method verifications

* Create real latlang objects isntead of spying them

* Use a real presenter object instead of a spy

* Revert nonneeded @VisibleForTest annotations, instead reach via lockUnlock method

* Reduce code repetitions

* Do not call a test from another test method

* Add some more tests

* Fix minor issues

* Hidden categories are not showed in suggested categories (#3853)

* Localisation updates from https://translatewiki.net.

* Clarify that the caption would also be used as the image title (#3876)

The app uses the fist caption as the file title. This should also
be communicated to the user via the info box as they would not be
aware of it otherwise.

* Localisation updates from https://translatewiki.net.

* Added Click event for leaderboard, Fixed #3886

* Fixed Travis

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: Seán Mac Gillicuddy <seantheappdev@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Paulina <63326136+PaulinaQuintero@users.noreply.github.com>
Co-authored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>

* [GSoC] Added Leaderboard Filters (#3902)

* Attempt to add filters

* Basic Filter Working

* Filter Improved

* Filter Completed

* Add JavaDocs

* Added Test for Update Avatar

* Decreased Margin of Filter

* [GSoC] Updated leaderboard string (#3897)

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* #3749 Improve MediaClient UnitTests  (#3846)

* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchDepictionsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace UploadCategoryDepictionsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - update BaseAdapter to be easier to use

* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchImagesRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchCategoriesRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace NotificationRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace UploadDepictsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace PlaceRenderer

* #3756 Convert SearchDepictionsFragment to use Pagination - convert SearchDepictionsFragment

* #3756 Convert SearchDepictionsFragment to use Pagination - fix presenter unit tests now that view is not nullable - fix Category prefix imports

* #3756 Convert SearchDepictionsFragment to use Pagination - test DataSource related classes

* #3756 Convert SearchDepictionsFragment to use Pagination - reset rx scheduler - ignore failing test

* #3760 Convert SearchCategoriesFragment to use Pagination - extract functionality of pagination to base classes - add category pagination

* #3772 Convert SearchImagesFragment to use Pagination  - convert SearchImagesFragment - tidy up showing the empty view - make search fragments show snackbar with appropriate text

* #3772 Convert SearchImagesFragment to use Pagination  - allow viewpager to load more data

* #3760 remove test that got re-added by merge

* #3760 remove duplicate dependency

* #3772 fix compilation

* #3780 Create media using a combination of Entities & MwQueryResult - construct media with an entity - move fields from media down to contribution - move dynamic fields outside of media - remove unused constructors - remove all unnecessary fetching of captions/descriptions - bump database version

* #3808 Construct media objects that depict an item id correctly - use generator to construct media for DepictedImages

* #3810 Convert DepictedImagesFragment to use Pagination - extract common media paging methods - convert to DepictedImages to use pagination

* #3810 Convert DepictedImagesFragment to use Pagination - rename base classes to better reflect usage

* #3810 Convert DepictedImagesFragment to use Pagination - map to empty result with no pages

* #3810 Convert DepictedImagesFragment to use Pagination - align test with returned values

* #3780 Create media using a combination of Entities & MwQueryResult - update wikicode to align with expected behaviour

* #3780 Create media using a combination of Entities & MwQueryResult - replace old site of thumbnail title with most relevant caption

* #3818 Convert SubDepictionListFragment to use Pagination - replace SubDepictionList with Child and Parent Fragments - replace contracts with simple presenter declarations - move classes to appropriate packages - delete unused network models - delete duplicated paging classes

* #3820 Convert CategoryImagesListFragment to use Pagination - replace CategoryImagesListFragment with CategoriesMediaFragment - disallow the construction of media objects without imageinfo

* #3822 Convert SubCategoryImagesListFragment to use Pagination - convert subcategories - add continuation support in category client - rely on interfaces for callbacks of PageableMediaFragments

* #3822 Convert SubCategoryImagesListFragment to use Pagination - convert parent categories - delete list fragment - creat base class to support continuation requests in clients

* #3822 Convert SubCategoryImagesListFragment to use Pagination - add tests for ParentCategoriesDataSource

* #3822 Convert SubCategoryImagesListFragment to use Pagination - remove no longer applicable test

* #3749 Improve MediaClient UnitTests - test rewrite

* #3749 Improve MediaClient UnitTests - align with buildConfig property

* With pause and resume for uploads (#3858)

* With pause and resume for uploads

* Dispose current upload

* Make pause and resume work

* Check stash validity

* With java docs

* minor

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Add nearby presenter unit tests  (#3615)

* init the test file

* Add tests to check if searchthisarea button action and checkbox actions are added after initialize test

* Add tests to locked unlocked nearby cases

* Add tests for null cases in updateMapAndList method

* Add test to check which locations are used to populate places, depending to LocationChangeType

* Add tests to test users position is not followed if blue dot (current location marker) is not visible

* Add tests to decide search this area method visibility on camera move

* Add tests for multi filteirng of placetypes

* add tests for single place type selection too

* Add tests to tests search view focus gain and bottom sheet visibilities

* Add tests for SearchCloseToCurrentLocation

* Remove two unneeded getter and setter for isNearbyLocked, use @VisibleForTesting annotation instead

* Add VisibleForTesting annotation to initializeNearbyOperations method so that it will be private by default

* Add missing tests

* Add tests for map updated case and add missing lines those are being tested

* Add some missind method verifications

* Create real latlang objects isntead of spying them

* Use a real presenter object instead of a spy

* Revert nonneeded @VisibleForTest annotations, instead reach via lockUnlock method

* Reduce code repetitions

* Do not call a test from another test method

* Add some more tests

* Fix minor issues

* Hidden categories are not showed in suggested categories (#3853)

* Localisation updates from https://translatewiki.net.

* Clarify that the caption would also be used as the image title (#3876)

The app uses the fist caption as the file title. This should also
be communicated to the user via the info box as they would not be
aware of it otherwise.

* Localisation updates from https://translatewiki.net.

* Delete NearbyMapFragment & NearbyListFragment (#3885)

* Fixes #3884
* Delete NearbyMapFragment & NearbyListFragment

* Fixed NearbyParentFragmentPresenterTest

* Localisation updates from https://translatewiki.net.

* Localisation updates from https://translatewiki.net.

* Add more nearby tests (#3877)

* more nearby tests added

* Add tests for Label class

* Add checkbox test javadocs

* Add javadocs for label

* Localisation updates from https://translatewiki.net.

* Updated strings.xml

Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: Seán Mac Gillicuddy <seantheappdev@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Paulina <63326136+PaulinaQuintero@users.noreply.github.com>
Co-authored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>

* Updated Strings

* Added JavaDocs for all methods and classes

* Added JavaDocs for all methods and classes

* Added More JavaDocs

* Revert string.xml

* Revert "Revert string.xml"

This reverts commit 00019b598a.

* Added protected

* Fixed strings.xml extra changes

* Revert codeStyle change

* Fixed extra string change

Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: translatewiki.net <l10n-bot@translatewiki.net>
Co-authored-by: Seán Mac Gillicuddy <seantheappdev@gmail.com>
Co-authored-by: neslihanturan <tur.neslihan@gmail.com>
Co-authored-by: Paulina <63326136+PaulinaQuintero@users.noreply.github.com>
Co-authored-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
2020-08-27 23:50:58 +10:00
translatewiki.net
50bcaab15d Localisation updates from https://translatewiki.net. 2020-08-27 15:48:09 +02:00
translatewiki.net
36954db62d Localisation updates from https://translatewiki.net. 2020-08-24 15:22:08 +02:00
translatewiki.net
f0aad31f7e Localisation updates from https://translatewiki.net. 2020-08-21 17:19:03 +02:00
translatewiki.net
4e4ed71c68 Localisation updates from https://translatewiki.net. 2020-08-17 19:15:27 +02:00
Vivek Maskara
74720aac19
Handle errors in chunk uploads (#3899) 2020-08-17 21:43:36 +10:00
neslihanturan
1856196851
Todo for user (#3851)
* Add a simple message

* Categories are edited

* Display categories

* read whole page

* Revert wrong changes

* Add newly added category field

* Doesnt displaey alreasy added categories

* add strings for notifications

* clean code

* Readd accidentally removed imports

* Fix edit layout style

* Fix category update messages

* Pass isWikipediaButtonDisplayed information to fragment

* Remove unused class

* Fix strings

* Fix string

* Add exeption for uncategorised images too

* Revert project.xml changes

* fix update buttonvisibility issue

* Make sure it works for auto added categories too

* make the button visible

* Make the button appear when categories are entered

* Include cancel button

* Make view updated too

* Make category view edited

* Update categories in an hacky way

* Fix unnecessary method call

* Add notes for short term fix to display added category

* Fix tests

* Fix strings

* Fix click issue
2020-08-17 21:30:46 +10:00
translatewiki.net
f5e28834fc Localisation updates from https://translatewiki.net. 2020-08-13 19:13:57 +02:00
translatewiki.net
8f84be4d03 Localisation updates from https://translatewiki.net. 2020-08-07 09:37:37 +02:00
neslihanturan
e7f54a97e5
Add more nearby tests (#3877)
* more nearby tests added

* Add tests for Label class

* Add checkbox test javadocs

* Add javadocs for label
2020-08-06 01:06:03 +10:00
translatewiki.net
fb4af37418 Localisation updates from https://translatewiki.net. 2020-08-03 19:39:17 +02:00
translatewiki.net
baebb7bc5d Localisation updates from https://translatewiki.net. 2020-07-30 15:26:08 +02:00
Ashish Kumar
edfdbc2da3
Delete NearbyMapFragment & NearbyListFragment (#3885)
* Fixes #3884
* Delete NearbyMapFragment & NearbyListFragment

* Fixed NearbyParentFragmentPresenterTest
2020-07-29 11:28:12 -07:00
translatewiki.net
4126fce97d Localisation updates from https://translatewiki.net. 2020-07-27 18:20:00 +02:00
Kaartic Sivaraam
28b8fd2923
Clarify that the caption would also be used as the image title (#3876)
The app uses the fist caption as the file title. This should also
be communicated to the user via the info box as they would not be
aware of it otherwise.
2020-07-23 19:30:05 +10:00
translatewiki.net
a51007de2f Localisation updates from https://translatewiki.net. 2020-07-20 19:44:07 +02:00
Paulina
67beb947c5
Hidden categories are not showed in suggested categories (#3853) 2020-07-19 20:59:29 +05:30
neslihanturan
8630ba8025
Add nearby presenter unit tests (#3615)
* init the test file

* Add tests to check if searchthisarea button action and checkbox actions are added after initialize test

* Add tests to locked unlocked nearby cases

* Add tests for null cases in updateMapAndList method

* Add test to check which locations are used to populate places, depending to LocationChangeType

* Add tests to test users position is not followed if blue dot (current location marker) is not visible

* Add tests to decide search this area method visibility on camera move

* Add tests for multi filteirng of placetypes

* add tests for single place type selection too

* Add tests to tests search view focus gain and bottom sheet visibilities

* Add tests for SearchCloseToCurrentLocation

* Remove two unneeded getter and setter for isNearbyLocked, use @VisibleForTesting annotation instead

* Add VisibleForTesting annotation to initializeNearbyOperations method so that it will be private by default

* Add missing tests

* Add tests for map updated case and add missing lines those are being tested

* Add some missind method verifications

* Create real latlang objects isntead of spying them

* Use a real presenter object instead of a spy

* Revert nonneeded @VisibleForTest annotations, instead reach via lockUnlock method

* Reduce code repetitions

* Do not call a test from another test method

* Add some more tests

* Fix minor issues
2020-07-17 19:32:16 +10:00
translatewiki.net
5f7ac19d49 Localisation updates from https://translatewiki.net. 2020-07-14 10:14:27 +02:00
translatewiki.net
eae564ba69 Localisation updates from https://translatewiki.net. 2020-07-10 11:29:36 +02:00
Vivek Maskara
6f4c60b5ff
With pause and resume for uploads (#3858)
* With pause and resume for uploads

* Dispose current upload

* Make pause and resume work

* Check stash validity

* With java docs

* minor
2020-07-08 00:32:41 +10:00
Seán Mac Gillicuddy
e40e9690dd
#3749 Improve MediaClient UnitTests (#3846)
* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchDepictionsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace UploadCategoryDepictionsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - update BaseAdapter to be easier to use

* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchImagesRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchCategoriesRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace NotificationRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace UploadDepictsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace PlaceRenderer

* #3756 Convert SearchDepictionsFragment to use Pagination - convert SearchDepictionsFragment

* #3756 Convert SearchDepictionsFragment to use Pagination - fix presenter unit tests now that view is not nullable - fix Category prefix imports

* #3756 Convert SearchDepictionsFragment to use Pagination - test DataSource related classes

* #3756 Convert SearchDepictionsFragment to use Pagination - reset rx scheduler - ignore failing test

* #3760 Convert SearchCategoriesFragment to use Pagination - extract functionality of pagination to base classes - add category pagination

* #3772 Convert SearchImagesFragment to use Pagination  - convert SearchImagesFragment - tidy up showing the empty view - make search fragments show snackbar with appropriate text

* #3772 Convert SearchImagesFragment to use Pagination  - allow viewpager to load more data

* #3760 remove test that got re-added by merge

* #3760 remove duplicate dependency

* #3772 fix compilation

* #3780 Create media using a combination of Entities & MwQueryResult - construct media with an entity - move fields from media down to contribution - move dynamic fields outside of media - remove unused constructors - remove all unnecessary fetching of captions/descriptions - bump database version

* #3808 Construct media objects that depict an item id correctly - use generator to construct media for DepictedImages

* #3810 Convert DepictedImagesFragment to use Pagination - extract common media paging methods - convert to DepictedImages to use pagination

* #3810 Convert DepictedImagesFragment to use Pagination - rename base classes to better reflect usage

* #3810 Convert DepictedImagesFragment to use Pagination - map to empty result with no pages

* #3810 Convert DepictedImagesFragment to use Pagination - align test with returned values

* #3780 Create media using a combination of Entities & MwQueryResult - update wikicode to align with expected behaviour

* #3780 Create media using a combination of Entities & MwQueryResult - replace old site of thumbnail title with most relevant caption

* #3818 Convert SubDepictionListFragment to use Pagination - replace SubDepictionList with Child and Parent Fragments - replace contracts with simple presenter declarations - move classes to appropriate packages - delete unused network models - delete duplicated paging classes

* #3820 Convert CategoryImagesListFragment to use Pagination - replace CategoryImagesListFragment with CategoriesMediaFragment - disallow the construction of media objects without imageinfo

* #3822 Convert SubCategoryImagesListFragment to use Pagination - convert subcategories - add continuation support in category client - rely on interfaces for callbacks of PageableMediaFragments

* #3822 Convert SubCategoryImagesListFragment to use Pagination - convert parent categories - delete list fragment - creat base class to support continuation requests in clients

* #3822 Convert SubCategoryImagesListFragment to use Pagination - add tests for ParentCategoriesDataSource

* #3822 Convert SubCategoryImagesListFragment to use Pagination - remove no longer applicable test

* #3749 Improve MediaClient UnitTests - test rewrite

* #3749 Improve MediaClient UnitTests - align with buildConfig property
2020-07-06 11:17:23 -07:00
translatewiki.net
82d8d40b4f Localisation updates from https://translatewiki.net. 2020-07-06 18:43:42 +02:00
translatewiki.net
c1b838e116 Localisation updates from https://translatewiki.net. 2020-07-02 17:43:11 +02:00
Saumia Singhal
764f9281e8
remove nested scroll view in fragment_upload_media_detail_fragment (#3859) 2020-07-01 10:15:08 -07:00
Vivek Maskara
96cf57711e
Fix build (#3857) 2020-06-30 12:48:25 -07:00
Seán Mac Gillicuddy
cc2f14dab8
#3847 Convert Media and Contribution to Kotlin Data Classes - convert to data classes - compose a contribution with a media (#3848)
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
2020-06-30 12:41:56 -07:00
Vivek Maskara
3361155fad
With chunked uploads (#3855) 2020-06-30 22:01:25 +05:30
Vivek Maskara
f26784e9c3
Set Media legend for wikidata entity (#3838)
* Set media legends and P18

* Minor

* Make media legends work

* Add test cases

* Use statement partial

* With minor refactoring

* Fix build
2020-06-30 22:11:27 +10:00
Mike Hurtado
7caf73fb4b
Fix compilation errors while trying to run instrumentation tests. (#3850) 2020-06-30 02:42:47 +10:00
Bryan Hauser
dea629c2c4
#3726 Add map legend (#3839)
* strings: add strings for map legend

* nearby: split description into a layout and add legend

* nearby: add newline at end of file
2020-06-30 02:11:26 +10:00
translatewiki.net
a14bbf5725 Localisation updates from https://translatewiki.net. 2020-06-29 16:17:25 +02:00
Josephine Lim
799369d6b8
Add Sean to credits 2020-06-26 18:05:21 +10:00
Seán Mac Gillicuddy
542d321acc
#3841 Unit Test DepictsClient (#3842)
* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchDepictionsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace UploadCategoryDepictionsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - update BaseAdapter to be easier to use

* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchImagesRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchCategoriesRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace NotificationRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace UploadDepictsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace PlaceRenderer

* #3756 Convert SearchDepictionsFragment to use Pagination - convert SearchDepictionsFragment

* #3756 Convert SearchDepictionsFragment to use Pagination - fix presenter unit tests now that view is not nullable - fix Category prefix imports

* #3756 Convert SearchDepictionsFragment to use Pagination - test DataSource related classes

* #3756 Convert SearchDepictionsFragment to use Pagination - reset rx scheduler - ignore failing test

* #3760 Convert SearchCategoriesFragment to use Pagination - extract functionality of pagination to base classes - add category pagination

* #3772 Convert SearchImagesFragment to use Pagination  - convert SearchImagesFragment - tidy up showing the empty view - make search fragments show snackbar with appropriate text

* #3772 Convert SearchImagesFragment to use Pagination  - allow viewpager to load more data

* #3760 remove test that got re-added by merge

* #3760 remove duplicate dependency

* #3772 fix compilation

* #3780 Create media using a combination of Entities & MwQueryResult - construct media with an entity - move fields from media down to contribution - move dynamic fields outside of media - remove unused constructors - remove all unnecessary fetching of captions/descriptions - bump database version

* #3808 Construct media objects that depict an item id correctly - use generator to construct media for DepictedImages

* #3810 Convert DepictedImagesFragment to use Pagination - extract common media paging methods - convert to DepictedImages to use pagination

* #3810 Convert DepictedImagesFragment to use Pagination - rename base classes to better reflect usage

* #3810 Convert DepictedImagesFragment to use Pagination - map to empty result with no pages

* #3810 Convert DepictedImagesFragment to use Pagination - align test with returned values

* #3780 Create media using a combination of Entities & MwQueryResult - update wikicode to align with expected behaviour

* #3780 Create media using a combination of Entities & MwQueryResult - replace old site of thumbnail title with most relevant caption

* #3818 Convert SubDepictionListFragment to use Pagination - replace SubDepictionList with Child and Parent Fragments - replace contracts with simple presenter declarations - move classes to appropriate packages - delete unused network models - delete duplicated paging classes

* #3820 Convert CategoryImagesListFragment to use Pagination - replace CategoryImagesListFragment with CategoriesMediaFragment - disallow the construction of media objects without imageinfo

* #3822 Convert SubCategoryImagesListFragment to use Pagination - convert subcategories - add continuation support in category client - rely on interfaces for callbacks of PageableMediaFragments

* #3822 Convert SubCategoryImagesListFragment to use Pagination - convert parent categories - delete list fragment - creat base class to support continuation requests in clients

* #3822 Convert SubCategoryImagesListFragment to use Pagination - add tests for ParentCategoriesDataSource

* #3822 Convert SubCategoryImagesListFragment to use Pagination - remove no longer applicable test

* #3841 Unit Test DepictsClient - add tests

* #3841 Unit Test DepictsClient - fix return types
2020-06-26 17:54:26 +10:00
Seán Mac Gillicuddy
9d59915459
#3822 Convert SubCategoryImagesListFragment to use Pagination (#3824) 2020-06-25 15:40:02 +03:00
Seán Mac Gillicuddy
7817518462
#3820 Convert CategoryImagesListFragment to use Pagination (#3821) 2020-06-25 12:38:58 +03:00
Seán Mac Gillicuddy
0e5ba98c2e
#3818 Convert SubDepictionListFragment to use Pagination (#3819) 2020-06-25 12:08:15 +03:00
Seán Mac Gillicuddy
34ab6f581b
#3810 Convert DepictedImagesFragment to use Pagination (#3815)
* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchDepictionsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace UploadCategoryDepictionsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - update BaseAdapter to be easier to use

* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchImagesRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchCategoriesRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace NotificationRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace UploadDepictsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace PlaceRenderer

* #3756 Convert SearchDepictionsFragment to use Pagination - convert SearchDepictionsFragment

* #3756 Convert SearchDepictionsFragment to use Pagination - fix presenter unit tests now that view is not nullable - fix Category prefix imports

* #3756 Convert SearchDepictionsFragment to use Pagination - test DataSource related classes

* #3756 Convert SearchDepictionsFragment to use Pagination - reset rx scheduler - ignore failing test

* #3760 Convert SearchCategoriesFragment to use Pagination - extract functionality of pagination to base classes - add category pagination

* #3772 Convert SearchImagesFragment to use Pagination  - convert SearchImagesFragment - tidy up showing the empty view - make search fragments show snackbar with appropriate text

* #3772 Convert SearchImagesFragment to use Pagination  - allow viewpager to load more data

* #3760 remove test that got re-added by merge

* #3760 remove duplicate dependency

* #3772 fix compilation

* #3780 Create media using a combination of Entities & MwQueryResult - construct media with an entity - move fields from media down to contribution - move dynamic fields outside of media - remove unused constructors - remove all unnecessary fetching of captions/descriptions - bump database version

* #3808 Construct media objects that depict an item id correctly - use generator to construct media for DepictedImages

* #3810 Convert DepictedImagesFragment to use Pagination - extract common media paging methods - convert to DepictedImages to use pagination

* #3810 Convert DepictedImagesFragment to use Pagination - rename base classes to better reflect usage

* #3810 Convert DepictedImagesFragment to use Pagination - map to empty result with no pages

* #3810 Convert DepictedImagesFragment to use Pagination - align test with returned values

* #3780 Create media using a combination of Entities & MwQueryResult - update wikicode to align with expected behaviour

* #3780 Create media using a combination of Entities & MwQueryResult - replace old site of thumbnail title with most relevant caption
2020-06-25 18:02:51 +10:00
Seán Mac Gillicuddy
4b22583b60
#3780 Create media using a combination of Entities & MwQueryResult (#3786)
* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchDepictionsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace UploadCategoryDepictionsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - update BaseAdapter to be easier to use

* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchImagesRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchCategoriesRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace NotificationRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace UploadDepictsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace PlaceRenderer

* #3756 Convert SearchDepictionsFragment to use Pagination - convert SearchDepictionsFragment

* #3756 Convert SearchDepictionsFragment to use Pagination - fix presenter unit tests now that view is not nullable - fix Category prefix imports

* #3756 Convert SearchDepictionsFragment to use Pagination - test DataSource related classes

* #3756 Convert SearchDepictionsFragment to use Pagination - reset rx scheduler - ignore failing test

* #3760 Convert SearchCategoriesFragment to use Pagination - extract functionality of pagination to base classes - add category pagination

* #3772 Convert SearchImagesFragment to use Pagination  - convert SearchImagesFragment - tidy up showing the empty view - make search fragments show snackbar with appropriate text

* #3772 Convert SearchImagesFragment to use Pagination  - allow viewpager to load more data

* #3760 remove test that got re-added by merge

* #3760 remove duplicate dependency

* #3772 fix compilation

* #3780 Create media using a combination of Entities & MwQueryResult - construct media with an entity - move fields from media down to contribution - move dynamic fields outside of media - remove unused constructors - remove all unnecessary fetching of captions/descriptions - bump database version

* #3808 Construct media objects that depict an item id correctly - use generator to construct media for DepictedImages

* #3780 Create media using a combination of Entities & MwQueryResult - update wikicode to align with expected behaviour

* #3780 Create media using a combination of Entities & MwQueryResult - replace old site of thumbnail title with most relevant caption
2020-06-25 17:20:01 +10:00
Seán Mac Gillicuddy
bf4b7e2efc
#3843 Unit Test DepictedItem - add tests (#3844) 2020-06-25 16:59:50 +10:00
Seán Mac Gillicuddy
7cfa8078f4
#3600 [structured-commons] From Nearby, "Next" button greyed out until modifying caption - set textwatcher first (#3809) 2020-06-24 23:49:08 +10:00
Seán Mac Gillicuddy
54498e4525
#3836 Fix button attributes on "Next" in Depiction Uploads - make text white (#3837) 2020-06-24 00:15:38 +10:00
translatewiki.net
5c1d1b9263 Localisation updates from https://translatewiki.net. 2020-06-22 17:18:23 +02:00
Seán Mac Gillicuddy
dd5a1ba5f2
#3834 Fix broken uploads without a place - delete log (#3835) 2020-06-22 16:51:18 +05:30
translatewiki.net
c7d73e167a Localisation updates from https://translatewiki.net. 2020-06-18 21:13:30 +02:00
Seán Mac Gillicuddy
43b753dfe9
#3811 Convert MediaDataExtractor to Kotlin - convert (#3812) 2020-06-17 09:38:43 -07:00
Seán Mac Gillicuddy
422890cac4
#3813 Convert MediaClient to Kotlin (#3814)
* #3813 Convert MediaClient to Kotlin - convert

* #3813 Convert MediaClient to Kotlin - update tests

* #3813 Convert MediaClient to Kotlin - fix List typing

* #3813 Convert MediaClient to Kotlin - fix mock injecting
2020-06-17 09:38:17 -07:00
Seán Mac Gillicuddy
e3213aa5bd
#3816 Update Android Gradle Plugin to 4.0.0 (#3817)
* #3816 Update Android Gradle Plugin to 4.0.0 - upgrade AGP - remove explicit buildToolsVersion

* #3816 Update Android Gradle Plugin to 4.0.0 - remove extraneous multiDexEnabled

* #3816 Update Android Gradle Plugin to 4.0.0 - update Travis to use bundled build tools
2020-06-17 09:37:43 -07:00
Seán Mac Gillicuddy
c77ed747fe
#3772 Convert SearchImagesFragment to use Pagination (#3779) 2020-06-16 16:58:48 +03:00
Vivek Maskara
e4190f3f7d
With option for associating image with wikipedia article (#3783) 2020-06-16 16:51:06 +03:00
translatewiki.net
a4379fde02 Localisation updates from https://translatewiki.net. 2020-06-15 22:10:45 +02:00
translatewiki.net
b7ba1f0f57 Localisation updates from https://translatewiki.net. 2020-06-11 19:22:24 +02:00
Seán Mac Gillicuddy
f4d81eb4ca
#3760 Convert SearchCategoriesFragment to use Pagination (#3770) 2020-06-10 15:57:13 +03:00
translatewiki.net
63ab4a25aa Localisation updates from https://translatewiki.net. 2020-06-08 17:02:27 +02:00
Ashish Kumar
27cc41069f
Fixes #3784 (#3787)
* Added empty constructor in ContributionsListFragment
* Initialise ContributionsListFragment's callaback in onAttach
2020-06-05 13:51:08 +03:00
translatewiki.net
884e34887e Localisation updates from https://translatewiki.net. 2020-06-04 17:44:58 +02:00
translatewiki.net
0882516d6e Localisation updates from https://translatewiki.net. 2020-06-01 22:29:08 +02:00
Vivek Maskara
d863a404f1
With lazy loading of contributions (#3566) 2020-05-28 14:54:41 +03:00
Seán Mac Gillicuddy
c216fdf0d4
#3756 Convert SearchDepictionsFragment to use Pagination (#3758) 2020-05-28 14:10:04 +03:00
Sotirios Siamandouras
0ebd59a223
Fixes #3712 Changed button attributes (#3718)
* Fixes #3712 Changed Widget.AppCompat.Button.Borderless to Widget.AppCompat.Button

* Update upload_depicts_fragment.xml

* Update upload_depicts_fragment.xml

Removed unnecessary line
2020-05-28 09:00:09 +01:00
V Bhavna Haritsa
cda4a8fa76
updated the readme with new links (#3773) 2020-05-27 15:30:23 +05:30
Seán Mac Gillicuddy
b063d6bdfd #3468 Switch from RvRenderer to AdapterDelegates (#3750)
* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchDepictionsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace UploadCategoryDepictionsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - update BaseAdapter to be easier to use

* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchImagesRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace SearchCategoriesRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace NotificationRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace UploadDepictsRenderer

* #3468 Switch from RvRenderer to AdapterDelegates - replace PlaceRenderer

* #3468 fix constant import

* #3468 Switch from RvRenderer to AdapterDelegates - resolve id conflict
2020-05-27 19:44:21 +10:00
Vaibhav
82d662c8ef Add destroyed column to BookmarkLocation table (##3729) (#3774)
* Add destroyed column to BookmarkLocation table (##3729)

* switch with fall through for migrations
2020-05-27 10:10:00 +01:00
translatewiki.net
7a49ca12a4 Localisation updates from https://translatewiki.net. 2020-05-26 17:04:25 +02:00
Seán Mac Gillicuddy
df76aef070
#3763 IllegalArgumentException at fetchImagesForDepictedItem - pass entityId in (#3764) 2020-05-22 01:50:49 +10:00
Seán Mac Gillicuddy
618ace707b
#3752 Media details do not show depiction - make request return all languages available and choose preferred or first (#3761) 2020-05-21 21:51:20 +09:00
neslihanturan
3f31c3eded
Add bookmarks to Nearby map (#3728)
* Remove bookmark button from row button set and put to upper level list item

* Fix npe caused by lookinf for parent fragment, we don't have one anymore

* style

* Add new icons for bookmarked places

* Change bookmarked info when bookmarked

* Add pic field to bookmark dao so that we can retrieve them later

* Put bookmarks as the first item of list

* Add bookmark as a label

* Add logic to filter nearby

* remove unneeded changes

* fix word

* Remove logs

* Remove unused part of code

* Fix tests

* Remove logs

* simplify icon picking

* remove redundant margin left

* Remove non needed map and swap

* Add main thread annotation

* Fix tests
2020-05-21 20:58:27 +10:00
Seán Mac Gillicuddy
384afa6c44
#3753 Item label/description: Fall back to non-empty language - attempt to read labels by language or the first one in the list (#3759) 2020-05-21 08:54:09 +09:00
Seán Mac Gillicuddy
de3377c0fe
#3120 Suggest categories based on depictions (#3736) 2020-05-20 17:26:16 +03:00
Cloe Riva
01839dec6e
Adding multidex to support more method references (#3755)
* adding multidex to support more method references

* add multidex version to gradle properties
2020-05-19 14:32:33 +01:00
Cloe Riva
7084fd2535
Nearby: make list resize and display message when empty (#3746)
* Nearby: make list resize and display message when empty

* refactored and renamed for clarity

* refactoring and simplifying based on comments

* refactoring and simplifying based on comments

* removing vertical orientation
2020-05-19 13:43:49 +01:00
translatewiki.net
fbd057b87e Localisation updates from https://translatewiki.net. 2020-05-18 16:02:30 +02:00
Seán Mac Gillicuddy
4690925cf5
#3734 Refactor and convert CategoryPresenter to kotlin (#3735) 2020-05-15 16:17:26 +03:00
Seán Mac Gillicuddy
e597a7c96f
#3745 Upload depiction suggestions not following text input - on upstream error emit empty list (#3751) 2020-05-14 23:32:51 +09:00
Seán Mac Gillicuddy
affcd8a6d7
#3733 On first view of DepictionUpload suggestions don't show - remove zip which was only taking 1 value from the processor (#3737) 2020-05-12 16:38:45 +03:00
Seán Mac Gillicuddy
057d11a0e0
#3077 Hide disambiguation items from depiction search - when fetching depictions get the entity instead of the search result (#3741) 2020-05-12 13:44:17 +03:00
translatewiki.net
34f02499e4 Localisation updates from https://translatewiki.net. 2020-05-11 17:35:27 +02:00
Seán Mac Gillicuddy
4443810823
#3699 Multiple upload: Only one file's caption is used for all files, others ignored - share model data with the UI - inline and remove Remote/LocalDataSource (#3707) 2020-05-08 20:21:17 +10:00
Vaibhav
11ff5fb055
Fix NullPointer when clicking on image in MediaDetailFragment (#3730) (#3738)
Uri.parse would throw NullPointerException if the image in MediaDetailFragment was clicked before the image URL is available
2020-05-08 09:37:00 +05:30
translatewiki.net
dc6a3e507b Localisation updates from https://translatewiki.net. 2020-05-07 17:07:32 +02:00
Seán Mac Gillicuddy
77f75a4627
#3716 Depiction search does not return any results - clear so CompositeDisposable can be reused (#3731) 2020-05-06 20:07:40 +10:00
Seán Mac Gillicuddy
953f09d683
#3448 CategoryImagesListFragment.handleError never succeeds (#3710)
* #3448 CategoryImagesListFragment.handleError never succeeds - remove timeouts, rely on default timeout params

* #3448 CategoryImagesListFragment.handleError never succeeds - fix compilation
2020-05-05 12:00:42 -07:00
Vitaly V. Pinchuk
6d687c3efb
Fixes #3720: None of the filters work on Nearby list (#3723) 2020-05-04 17:15:08 +03:00
translatewiki.net
70f28b1dcf Localisation updates from https://translatewiki.net. 2020-05-04 15:49:51 +02:00
Vitaly V. Pinchuk
ff9f4f20e7
Fixes #3704: Green pins seen on initial "Nearby" map, despite "Needs Photos" selected (#3721) 2020-05-04 16:43:08 +03:00
translatewiki.net
ccdf2646b9 Localisation updates from https://translatewiki.net. 2020-04-30 16:47:25 +02:00
translatewiki.net
83790a6f1f Localisation updates from https://translatewiki.net. 2020-04-27 16:43:48 +02:00
Madhur Gupta
0e0d404d89
Updated Navigation Base Activity Unit Tests (#2725)
* Updated Navigation Base Activity Unit Tests

* Standardise function call

* Standardise function call

Co-authored-by: Adam Jones <jones_adam@rocketmail.com>
2020-04-26 19:08:48 -07:00
Raj Bapat
95372f33b5
There were 2 issues combined into one: (#3643)
1. The languages were shown with the characters of the given language (i.e. Mandarin was displayed with Chinese characters).
2. The languages were not sorted
How I fixed them:
1. I changed the list that was called from AppLanguageLookUpTable from localized to cannonical.
2. I imported List and Collections and I sorted said list in lexicographical order.
2020-04-26 00:23:00 -07:00
Vitaly V. Pinchuk
1fea1bbf49
Get rid of HandlerService #3555 (#3671)
* [WIP] Removed HandlerService

* [WIP] Added PublishProcessor for managing queue

* Resolved conflicts after merge
2020-04-25 23:17:57 -07:00
Seán Mac Gillicuddy
ce089d3f73
#3457 Permissions in Manifest only granted to system apps - remove system app only permissions (#3708) 2020-04-25 13:23:11 -07:00
Seán Mac Gillicuddy
36a31a96dc
#3451 Delete CompatTextView - remove all references to CompatTextView (#3709) 2020-04-25 13:21:19 -07:00
Kshitij Bhardwaj
82bf2d757f
Fixes #3679: Issues with new media details UI (#3697) 2020-04-25 12:34:28 +03:00
Seán Mac Gillicuddy
707e3145c2
#3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading (#3696)
* #3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - fix imageview rendering code

* #3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - show selected depictions at the top - ensure updates to nearby places are reflected

* #3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - don't set imageUrl when the url is none

* #3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - rewrite unit tests

* #3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - minor cleanup

* #3601 [structured-commons] Wrong thumbnails at the "depictions" step when uploading - fix erroneous cache access
2020-04-25 12:27:21 +03:00
Seán Mac Gillicuddy
67faa40d8c
Structured data (#3695)
* #3222 Merge master into Structured Data branch, fix conflicts (#3447)

* [WIP] Fixes #2942. Set 'depicts' automatically for images uploaded via 'Nearby'

* Feature/refractor uploads [WIP] (#2887)

* Fix duplicate param information (#2515)

* Bug fix issue #2476 (#2526)

* Added wikidataEntityID in all db versions, handled db.execSql via method runQuery

* Versioning and changelog for v2.10.2 (#2531)

* Update changelog.md

* Versioning for v2.10.2

* Update changelog.md

* Bugfix/issue 2580 (#2584)

* Corrected string placedholders in certain string files

* Corrected string placedholders in certain string files[Bug fix #2580]

* Bug Fix #2585 (#2647)

* Bug Fix #2585
* Added null checks on view in SearchImageFragment when updating views from external sources
* Disposed the disposables in SearchActivity and SearchImageFragment when no longer in active lifecycle

* use FragmentUtils to verify fragment active state

* Bug Fix issue #2648 (#2678)

* Bug Fix issue #2648
* Handled external storage permission before file download

* * Removed redudant check for permission in MediaDetailPagerFragment (Dexter already does that)
* Removed duplicate code in PermissionUtil$checkPermissionsAndPerformAction, used the existing function with conditional extra parameters

* string name typo correction

* BugFix issue #2652 (#2706)

* Addded null check on bookmark before operating on it

* BugFix issue #2711 (#2712)

* Added null checks in OkHttpJsonApiClient$searchImages MwQueryResponse

* BugFix #2718 (#2719)

* Handled null auth cookies

* Fix #2791: NPE when nominating for deletion and leaving screen (#2792)

* Bug Fix issue #2789 (#2790)

* Handled Illegal State Exception for non existent appropriate view parents in ViewUtils$showShortSnackbar

* BugFix #2720 (#2831)

BugFix deprecated licenes #2720

* ui fixes, wip, upload

* *Issue #2886, BugFix #2832[wip]
* updated UploadActivity code
* modified ui
* Updated UploadPresenterTest

* * updated interfaces names to follow names suffixed with Contract
* added test cases

* card view elevation

* view pager disabled swipe

* bug fix, duplicate image

* used existing non-swipable view pager

* Avoid image view resize with keyboard, added adjustPan and stateVisible as softinputMode for UploadActivity

* retain UploadBaseFragment instances on orientation changes

* * Added test cases for UploadMediaPresenter
* Injected io and main thread schedulers

* categories presenter test cased wip

* Added CategoriesPresenter test

* * Added the logic to show open map (with to be uploaded image's coordinates while uploading image)

* codacy suggested changes * added java docs

* Added travis_wait fot android-wait-for-emulator

* ranamed interface onResponseCallback to Callback

* * Added api to delete picture in UploadModel
* cleanUp in UploadModel. once upload has been initiated
* Removed unused methods from UploadModel and the corresponding test class

* * Added tests for UploadPresenter
* Travis suggested changes
* Addded copy previous title and description

* * Made the upload add descriptions visible when keyboard visible
* add description request focus only when user manually requests it

* Added JavaDocs, review suggested changes

* Fix dagger injection

* use DialogUtil to show info in descriptions

* use activity context for DialogUtil

* Minor changes

* refactored title

* ui for depicts

* bug fix

* basic architecture for depicts

* adde architecture components for depicts

* [WIP] ApacheHttpClientMediaWikiApi.wikidataEditEntity: JSON param creation uses object instead of string

* resolved dagger errors

* multilingual captions and next button error resolved

* fixed next button issues in depicts fragment

* captions and depicts

* resolved previous button click issues

* fixed bindview error and added multi-captions

* replaced description and caption with uploadmediadetail

* refactored few classes

* modified ui of depicts

* minor fixes

* Bug fix, reduced the add description edit text clickable bound (#2973)

* moved depicts before categories

* replaced previous filename with captions

* removed time from filename

* added depicts suggestions

* [WIP] Wikidata Sandbox (Q4115189) test

* changes layout of layout_upload_depicts

* changed layout of upload_depicts

* code stuck at IO_SCHEDULER

* labels and description for depicts activity

* Bugfix/uploads (#3000)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Fix memory leak (#3001)

* Bugfix/uploads (#3002)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Bugfix/uploads (#3011)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* bugfix/uploads (#3012)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* BugFix Illegal State Exception in ViewpPagerAdapter

* Remove irrelevant comment

* merge conflict with strings (#3016)

* [WIP] Fixed duplicated subscriprion for 'addPropertyP180'

* added documentation

* fixed issue #3006

* resolved issue #3004

* fixed issue with categoryPresenterTest.kt

* send captions as labels

* fixed issue with the captions

* optimised imports

* added upload for captions

* minor changes

* resolved issue with uploading captions

* resolved issue with api call

* uploading captions to wikibase

* added some tests and documentation

* undo formatting changes

* uploaded captions as labels to wikibase

* minor changes

* resolved error with spinner adpater

* adding captions to local database

* Fixed issue #3035

* fixed issue #3033

* fixed issue #3005

* fixed issue #3005

* added search for depicts

* fixed issue with compile time

* fixe issue with project build

* fixed issue #3044

* merged uploading depicts into branch

* uploading depicts

* rebased branch

* fixed crash due to depicts

* modified depicts interface

* Resolve merge conflicts

* Fix issues with API calls

* Use wikidata token

* searching depictions from depicts activity

* added some documentation and other changes

* fixed crash on selecting depictions

* sending wikidataentity id to upload depictions

* added changes after review

* Fixed issue with next button diabling in media detail activity

* added tests for depictions

* added all the unit tests and fixed few more issues

* showing captions in media details

* show captions in media details

* added documentations and worked upon review comments

* parsing response for depictions

* displaying captions and depiction QID in media detail

* added documentation

* fetching labels from QIDs

* captions working perfectly

* added documentations and code cleaning

* minor changes

* minor changes

* Showing items in explore

* added search via depicts in explore

* Added setOffscreenPageLimit in ViewPager

* show captions in explore

* show captions in home

* showing depict images under items

* added documentation and code refactoring

* enabled pagination in depiction search

* added some tests and media deatils in depiction detail activity

* fixed bug with back button in media

* fixed issue #3100

* fixed issue #3098

* fixed issue #3099

* fixed issue #3104 and #3098

* showing captions in place of title in home and explore:media

* show captions in explore:depiction image list activity

* showing depictions in media details

* showing depictions in media details in production flavor

* fixed issue #3108 and #3107

* fix isse #3108

* fixed issue #3110 and #3112

* fixed issue #3113

* added documentations

* fixed issue #3076 and #3109

* added depiction search test

* fixed issue #3113

* fixed issue #3111

* fixed issue #3106

* Showing items in explore

* minor change

* fixed issue #3118 and some other changes

* added MVP in searchdepictionsfragment

* added mvp architecture

* added MVP architecture to DepictedImagesDetailsActivity

* added documentation and some minor changes

* added image to depicted item in search depictions

* * Use callbacks from renderer to fetch thumbnails

* adding fresco to load image in depictions

* adding thumbnail image for depictions in upload and explore

* pagination issues

* fixed issue --(showing previous depiction thumbnail in explore)

* Fixed the logic for pagination

* hide progress on success of last page

* adding sub-items and parent items to search in explore

* minor changes for review comments

* fixed issue #3119

* fixed issue #3130

* changes after review comments

* showing child classes for depictions

* Showing child items

* showing parent classes for depicted items

* adding localised search for parent and child items

* clicking on any child class or parent class should call the corresponding class items

* fixed issue of showing wrong thumbnail for P18 item

* fixed issue #3132

* added test for DepictedImagesPresenter.java

* added unit tests for depicted items parent and child classes

* removed unused imports and code formatting

* fixed issue in search test

* deleting unnecessary .attach_pid9313 file

* deleting unnecessary .attach_pid9655 file

* added SearchDepictionsPresenterTest

* changes after review comments

* updates for review comments

* added more documentations

* removed unused code and classes and addressed spacing changes

* changes after review

* fixed build issues in the app

* worked on some review comments

* fixed issue:wrong thumbnail appears on wikidata item

* minor change

* worked on some review changes

* worked on review comments

* minor change

* addressed remaining review comments

* replaced hardcoded jpgs with pageIds to fetch captions

* added documentation

* removed hardcoded extensions and worked on review comments

* review comments

* [WIP] Added Depicts values for flavors

* [WIP] Minor fix

* [WIP] Minor fixes

* [WIP] Fixed URL

* [WIP] Fixed URLs and tokens

* Fixed MediaClient: added check for null in continuation store

* Fixed Media::from, changed return from null to new Media()

* [WIP] Merged with master

* Fix #3254 Displays a proper message in explore section when no result for caption

* Updated Mockito to org.mockito:mockito-inline:2.13.0

* [WIP] Fixed tests after merging

* [WIP] Fixed some JUnit tests

* Fixed 'accessing from wrong thread' error

* #3222 Delete manifest declaration of activity as fragment - stop casting MainActivity to CatgoryImagesCallback - fix tests

* Remove unit test not associated with any class - make CategoryPresenterTest more idiomatic

* fix compilation errors

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
Co-authored-by: vanshikaarora <vanshikaa937@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: Vanshika Arora <34261945+vanshikaarora@users.noreply.github.com>
Co-authored-by: Somanshu and Himanshu <somanshS14@gmail.com>

* #3482 Use Room in Structured Data branch - remove unused code (#3483)

* #3482 Use Room in Structured Data branch - remove unused code

* #3482 Use Room in Structured Data branch - fix unit test compilation

* #3482 Use Room in Structured Data branch - add kdoc

* #3490 Depiction Search in upload shows No Results before it gets results (#3491)

* #3482 Use Room in Structured Data branch - remove unused code

* #3482 Use Room in Structured Data branch - fix unit test compilation

* #3490 Depiction Search in upload shows No Results before it gets results - stop showing error on subscription

* #3490 Depiction Search in upload shows No Results before it gets results - update test cases

* make labels nullable too

* fix unit test compilation

* #3222 remove lingering reference to depiction content provider

* Fix Crash

* #3222 Merge master into Structured Data branch, fix conflicts - review fixes

* Fix method invocations

* #3529 Captions/depictions are not saved to Commons (#3574)

* #3529 Captions/depictions are not saved to Commons - make copy of list of depictionEntityIds - uncomment editBaseDepictsProperty - refactor upload related classes

* #3529 Captions/depictions are not saved to Commons - fix wrong ArrayList usage

* #3529 Captions/depictions are not saved to Commons - fix test

* #3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs  (#3578)

* #3529 Captions/depictions are not saved to Commons - make copy of list of depictionEntityIds - uncomment editBaseDepictsProperty - refactor upload related classes

* #3529 Captions/depictions are not saved to Commons - fix wrong ArrayList usage

* #3529 Captions/depictions are not saved to Commons - fix test

* #3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - replace title with the first MediaDetail

* #3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - restore button disabling

* #3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - fix nearby place

* fix thumbnail issue 3526 (#3617)

* #3222 Merge master into Structured Data branch, fix conflicts - fix bad merge

* #3529 Captions/depictions are not saved to Commons (#3588)

* #3529 Captions/depictions are not saved to Commons - update flow to update appropriate data

* #3529 Captions/depictions are not saved to Commons - fix invoking of setlabel

* #3529 Captions/depictions are not saved to Commons - fix unit tests

* #3529 Captions/depictions are not saved to Commons - use constant for @Named

* #3529 Captions/depictions are not saved to Commons - remove captions interface

* #3529 Captions/depictions are not saved to Commons - delete unused Contribution fields - enforce Single Responsibility by using PageContentsCreator

* #3529 Captions/depictions are not saved to Commons - prefix id with M - remove language from url and only add from Field

* #3529 Captions/depictions are not saved to Commons - make edits of depictions and captions sequential

* #3529 Captions/depictions are not saved to Commons - remove unused model fields

* #3529 Captions/depictions are not saved to Commons - weaken type of categories - copy list on Contribution creation

* #3529 Captions/depictions are not saved to Commons - mark Media fields private - weaken types - remove partly implemented fields

* #3529 Captions/depictions are not saved to Commons - add semi colon

* #3529 Captions/depictions are not saved to Commons - fix test

* Fix issue 3526 Unlike "Items" tab, "child classes" tab does not display description nor image thumbnail (#3619)

* fix thumbnail issue 3526

* Fix Description issue 3526

* revert changes on this file, not finished with it yet

* Fix Description for Child and Parent classes - issue 3526

* Remove conflict text in file

* Remove retrofit.HEAD import

* Incorporated review comments

* Fix issue 3137 (#3637)

* Fix issue 3137

* Remove import Timber

* Remove unnecessary space

* #3222 Merge master into Structured Data branch, fix conflicts - revert logging

* Fix build

* #3661 No Depictions Selected Dialog has reversed buttons - fix button order

* Revert "#3661 No Depictions Selected Dialog has reversed buttons - fix button order"

This reverts commit d8f9809584.

* #3222 Merge master into Structured Data branch, fix conflicts - remove unused methods/fields

* #3661 No Depictions Selected Dialog has reversed buttons - fix button order (#3662)

* #3653 Many Mnull requests - stop requesting captions for null ids (#3657)

* #3653 Many Mnull requests - stop requesting captions for null ids

* #3653 Many Mnull requests - move log line

* #3633 [structured-data branch] In depictions selection screen, suggest nearby items  (#3650)

* #3633 [structured-data branch] In depictions selection screen, suggest nearby items - for empty search terms show nearby items for depictions

* #3633 [structured-data branch] In depictions selection screen, suggest nearby items - use linear radii progression to search for places

* #3666 Crash when uploading on structured-data branch - revert cleanup of UploadController (#3670)

* #3222 Merge Structured Data branch into master - fix caption rendering in new UI

* #3222 Merge Structured Data branch into master - upgrade retrofit + okhttp

* #3664 Stop using JsonObject on StructuredData (#3672)

* #3664 Stop using JsonObject on StructuredData - remove usage in Media classes - remove from depicts client - create partial network models

* #3664 Stop using JsonObject on StructuredData - allow partial mapping of polymorphic models by returning null in typeadapter

* #3664 Stop using JsonObject on StructuredData - use models for editing depicts property

* #3664 Stop using JsonObject on StructuredData - use models for sparql parent query

* #3664 Stop using JsonObject on StructuredData - fix unit test compilation

* #3664 Stop using JsonObject on StructuredData - unify sparql responses

* #3664 Stop using JsonObject on StructuredData - minor cleanup of misnamed/unused/too broad visibility

* #3664 Stop using JsonObject on StructuredData - share variable names and logic for the Sarql queries

* #3664 Stop using JsonObject on StructuredData - add error logging

* #228 Overwrite happens - fix extension of filename (#3689)

* #3675 Rename buttons of the dialog box shown when no depiction is selected - remove "yes, submit" and "no, go back" (#3688)

* #3680 Tip appears even when not tapping the (i) icon - use TextInputLayout EndIcons (#3683)

* #3680 Tip appears even when not tapping the (i) icon - use TextInputLayout EndIcons

* #3680 Tip appears even when not tapping the (i) icon - reaorder endIcon mode call so tinting is applied

* structured data - fix compilation

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
Co-authored-by: vanshikaarora <vanshikaa937@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: Vanshika Arora <34261945+vanshikaarora@users.noreply.github.com>
Co-authored-by: Somanshu and Himanshu <somanshS14@gmail.com>
Co-authored-by: vvijayalakshmi21 <34595292+vvijayalakshmi21@users.noreply.github.com>
2020-04-22 11:59:23 +01:00
Kshitij Bhardwaj
840e126652
Fixes #3687 : Media needs refactoring to remove code that has been rendered useless (#3693) 2020-04-22 10:59:48 +03:00
Seán Mac Gillicuddy
0f906b20c9
#3222 Merge Structured Data branch into master (#3553)
* #3222 Merge master into Structured Data branch, fix conflicts (#3447)

* [WIP] Fixes #2942. Set 'depicts' automatically for images uploaded via 'Nearby'

* Feature/refractor uploads [WIP] (#2887)

* Fix duplicate param information (#2515)

* Bug fix issue #2476 (#2526)

* Added wikidataEntityID in all db versions, handled db.execSql via method runQuery

* Versioning and changelog for v2.10.2 (#2531)

* Update changelog.md

* Versioning for v2.10.2

* Update changelog.md

* Bugfix/issue 2580 (#2584)

* Corrected string placedholders in certain string files

* Corrected string placedholders in certain string files[Bug fix #2580]

* Bug Fix #2585 (#2647)

* Bug Fix #2585
* Added null checks on view in SearchImageFragment when updating views from external sources
* Disposed the disposables in SearchActivity and SearchImageFragment when no longer in active lifecycle

* use FragmentUtils to verify fragment active state

* Bug Fix issue #2648 (#2678)

* Bug Fix issue #2648
* Handled external storage permission before file download

* * Removed redudant check for permission in MediaDetailPagerFragment (Dexter already does that)
* Removed duplicate code in PermissionUtil$checkPermissionsAndPerformAction, used the existing function with conditional extra parameters

* string name typo correction

* BugFix issue #2652 (#2706)

* Addded null check on bookmark before operating on it

* BugFix issue #2711 (#2712)

* Added null checks in OkHttpJsonApiClient$searchImages MwQueryResponse

* BugFix #2718 (#2719)

* Handled null auth cookies

* Fix #2791: NPE when nominating for deletion and leaving screen (#2792)

* Bug Fix issue #2789 (#2790)

* Handled Illegal State Exception for non existent appropriate view parents in ViewUtils$showShortSnackbar

* BugFix #2720 (#2831)

BugFix deprecated licenes #2720

* ui fixes, wip, upload

* *Issue #2886, BugFix #2832[wip]
* updated UploadActivity code
* modified ui
* Updated UploadPresenterTest

* * updated interfaces names to follow names suffixed with Contract
* added test cases

* card view elevation

* view pager disabled swipe

* bug fix, duplicate image

* used existing non-swipable view pager

* Avoid image view resize with keyboard, added adjustPan and stateVisible as softinputMode for UploadActivity

* retain UploadBaseFragment instances on orientation changes

* * Added test cases for UploadMediaPresenter
* Injected io and main thread schedulers

* categories presenter test cased wip

* Added CategoriesPresenter test

* * Added the logic to show open map (with to be uploaded image's coordinates while uploading image)

* codacy suggested changes * added java docs

* Added travis_wait fot android-wait-for-emulator

* ranamed interface onResponseCallback to Callback

* * Added api to delete picture in UploadModel
* cleanUp in UploadModel. once upload has been initiated
* Removed unused methods from UploadModel and the corresponding test class

* * Added tests for UploadPresenter
* Travis suggested changes
* Addded copy previous title and description

* * Made the upload add descriptions visible when keyboard visible
* add description request focus only when user manually requests it

* Added JavaDocs, review suggested changes

* Fix dagger injection

* use DialogUtil to show info in descriptions

* use activity context for DialogUtil

* Minor changes

* refactored title

* ui for depicts

* bug fix

* basic architecture for depicts

* adde architecture components for depicts

* [WIP] ApacheHttpClientMediaWikiApi.wikidataEditEntity: JSON param creation uses object instead of string

* resolved dagger errors

* multilingual captions and next button error resolved

* fixed next button issues in depicts fragment

* captions and depicts

* resolved previous button click issues

* fixed bindview error and added multi-captions

* replaced description and caption with uploadmediadetail

* refactored few classes

* modified ui of depicts

* minor fixes

* Bug fix, reduced the add description edit text clickable bound (#2973)

* moved depicts before categories

* replaced previous filename with captions

* removed time from filename

* added depicts suggestions

* [WIP] Wikidata Sandbox (Q4115189) test

* changes layout of layout_upload_depicts

* changed layout of upload_depicts

* code stuck at IO_SCHEDULER

* labels and description for depicts activity

* Bugfix/uploads (#3000)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Fix memory leak (#3001)

* Bugfix/uploads (#3002)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Bugfix/uploads (#3011)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* bugfix/uploads (#3012)

* merged with master

* BugFix IllegalStateException
* setRetainState(true), not required with FragmentStatePagerAdapter
* Increase the ViewPager's Offscreen Limit, we want all the fragments to be active

* BugFix, clear selected categoris for previous upload session
* Clear Selected Categories
* Addded JavaDocs for CategoriesModel

* Code Formatting in app/src/main/java/fr/free/nrw/commons/upload/UploadModel.java

* Added class level JavaDoc UploadRemoteDataSource

* Added class level JavaDoc for UploadRepository

* Added JavaDocs for ThumbnailsAdapter

* Added JavaDocs for MediaLicensePresenter, CategoriesPresenter

* Removed null check on category query
* Show default catgeories based on image title and gps location when category text empty
* Allow search for empty category search

* Attached image scale listener to upload media image

* Bug fix, reduced the add description edit text clickable bound

* Added tooltip in Title in UploadMediaFragment

* BugFix recent categories

* Updated test methods

* Avoid memory leak, free the adpater in MediaLicenseFragment.onDestroyView

* BugFix Illegal State Exception in ViewpPagerAdapter

* Remove irrelevant comment

* merge conflict with strings (#3016)

* [WIP] Fixed duplicated subscriprion for 'addPropertyP180'

* added documentation

* fixed issue #3006

* resolved issue #3004

* fixed issue with categoryPresenterTest.kt

* send captions as labels

* fixed issue with the captions

* optimised imports

* added upload for captions

* minor changes

* resolved issue with uploading captions

* resolved issue with api call

* uploading captions to wikibase

* added some tests and documentation

* undo formatting changes

* uploaded captions as labels to wikibase

* minor changes

* resolved error with spinner adpater

* adding captions to local database

* Fixed issue #3035

* fixed issue #3033

* fixed issue #3005

* fixed issue #3005

* added search for depicts

* fixed issue with compile time

* fixe issue with project build

* fixed issue #3044

* merged uploading depicts into branch

* uploading depicts

* rebased branch

* fixed crash due to depicts

* modified depicts interface

* Resolve merge conflicts

* Fix issues with API calls

* Use wikidata token

* searching depictions from depicts activity

* added some documentation and other changes

* fixed crash on selecting depictions

* sending wikidataentity id to upload depictions

* added changes after review

* Fixed issue with next button diabling in media detail activity

* added tests for depictions

* added all the unit tests and fixed few more issues

* showing captions in media details

* show captions in media details

* added documentations and worked upon review comments

* parsing response for depictions

* displaying captions and depiction QID in media detail

* added documentation

* fetching labels from QIDs

* captions working perfectly

* added documentations and code cleaning

* minor changes

* minor changes

* Showing items in explore

* added search via depicts in explore

* Added setOffscreenPageLimit in ViewPager

* show captions in explore

* show captions in home

* showing depict images under items

* added documentation and code refactoring

* enabled pagination in depiction search

* added some tests and media deatils in depiction detail activity

* fixed bug with back button in media

* fixed issue #3100

* fixed issue #3098

* fixed issue #3099

* fixed issue #3104 and #3098

* showing captions in place of title in home and explore:media

* show captions in explore:depiction image list activity

* showing depictions in media details

* showing depictions in media details in production flavor

* fixed issue #3108 and #3107

* fix isse #3108

* fixed issue #3110 and #3112

* fixed issue #3113

* added documentations

* fixed issue #3076 and #3109

* added depiction search test

* fixed issue #3113

* fixed issue #3111

* fixed issue #3106

* Showing items in explore

* minor change

* fixed issue #3118 and some other changes

* added MVP in searchdepictionsfragment

* added mvp architecture

* added MVP architecture to DepictedImagesDetailsActivity

* added documentation and some minor changes

* added image to depicted item in search depictions

* * Use callbacks from renderer to fetch thumbnails

* adding fresco to load image in depictions

* adding thumbnail image for depictions in upload and explore

* pagination issues

* fixed issue --(showing previous depiction thumbnail in explore)

* Fixed the logic for pagination

* hide progress on success of last page

* adding sub-items and parent items to search in explore

* minor changes for review comments

* fixed issue #3119

* fixed issue #3130

* changes after review comments

* showing child classes for depictions

* Showing child items

* showing parent classes for depicted items

* adding localised search for parent and child items

* clicking on any child class or parent class should call the corresponding class items

* fixed issue of showing wrong thumbnail for P18 item

* fixed issue #3132

* added test for DepictedImagesPresenter.java

* added unit tests for depicted items parent and child classes

* removed unused imports and code formatting

* fixed issue in search test

* deleting unnecessary .attach_pid9313 file

* deleting unnecessary .attach_pid9655 file

* added SearchDepictionsPresenterTest

* changes after review comments

* updates for review comments

* added more documentations

* removed unused code and classes and addressed spacing changes

* changes after review

* fixed build issues in the app

* worked on some review comments

* fixed issue:wrong thumbnail appears on wikidata item

* minor change

* worked on some review changes

* worked on review comments

* minor change

* addressed remaining review comments

* replaced hardcoded jpgs with pageIds to fetch captions

* added documentation

* removed hardcoded extensions and worked on review comments

* review comments

* [WIP] Added Depicts values for flavors

* [WIP] Minor fix

* [WIP] Minor fixes

* [WIP] Fixed URL

* [WIP] Fixed URLs and tokens

* Fixed MediaClient: added check for null in continuation store

* Fixed Media::from, changed return from null to new Media()

* [WIP] Merged with master

* Fix #3254 Displays a proper message in explore section when no result for caption

* Updated Mockito to org.mockito:mockito-inline:2.13.0

* [WIP] Fixed tests after merging

* [WIP] Fixed some JUnit tests

* Fixed 'accessing from wrong thread' error

* #3222 Delete manifest declaration of activity as fragment - stop casting MainActivity to CatgoryImagesCallback - fix tests

* Remove unit test not associated with any class - make CategoryPresenterTest more idiomatic

* fix compilation errors

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
Co-authored-by: vanshikaarora <vanshikaa937@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: Vanshika Arora <34261945+vanshikaarora@users.noreply.github.com>
Co-authored-by: Somanshu and Himanshu <somanshS14@gmail.com>

* #3482 Use Room in Structured Data branch - remove unused code (#3483)

* #3482 Use Room in Structured Data branch - remove unused code

* #3482 Use Room in Structured Data branch - fix unit test compilation

* #3482 Use Room in Structured Data branch - add kdoc

* #3490 Depiction Search in upload shows No Results before it gets results (#3491)

* #3482 Use Room in Structured Data branch - remove unused code

* #3482 Use Room in Structured Data branch - fix unit test compilation

* #3490 Depiction Search in upload shows No Results before it gets results - stop showing error on subscription

* #3490 Depiction Search in upload shows No Results before it gets results - update test cases

* make labels nullable too

* fix unit test compilation

* #3222 remove lingering reference to depiction content provider

* Fix Crash

* #3222 Merge master into Structured Data branch, fix conflicts - review fixes

* Fix method invocations

* #3529 Captions/depictions are not saved to Commons (#3574)

* #3529 Captions/depictions are not saved to Commons - make copy of list of depictionEntityIds - uncomment editBaseDepictsProperty - refactor upload related classes

* #3529 Captions/depictions are not saved to Commons - fix wrong ArrayList usage

* #3529 Captions/depictions are not saved to Commons - fix test

* #3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs  (#3578)

* #3529 Captions/depictions are not saved to Commons - make copy of list of depictionEntityIds - uncomment editBaseDepictsProperty - refactor upload related classes

* #3529 Captions/depictions are not saved to Commons - fix wrong ArrayList usage

* #3529 Captions/depictions are not saved to Commons - fix test

* #3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - replace title with the first MediaDetail

* #3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - restore button disabling

* #3503 Remove Title/Caption From MediaUploadDetail and only use Caption/Description pairs - fix nearby place

* fix thumbnail issue 3526 (#3617)

* #3222 Merge master into Structured Data branch, fix conflicts - fix bad merge

* #3529 Captions/depictions are not saved to Commons (#3588)

* #3529 Captions/depictions are not saved to Commons - update flow to update appropriate data

* #3529 Captions/depictions are not saved to Commons - fix invoking of setlabel

* #3529 Captions/depictions are not saved to Commons - fix unit tests

* #3529 Captions/depictions are not saved to Commons - use constant for @Named

* #3529 Captions/depictions are not saved to Commons - remove captions interface

* #3529 Captions/depictions are not saved to Commons - delete unused Contribution fields - enforce Single Responsibility by using PageContentsCreator

* #3529 Captions/depictions are not saved to Commons - prefix id with M - remove language from url and only add from Field

* #3529 Captions/depictions are not saved to Commons - make edits of depictions and captions sequential

* #3529 Captions/depictions are not saved to Commons - remove unused model fields

* #3529 Captions/depictions are not saved to Commons - weaken type of categories - copy list on Contribution creation

* #3529 Captions/depictions are not saved to Commons - mark Media fields private - weaken types - remove partly implemented fields

* #3529 Captions/depictions are not saved to Commons - add semi colon

* #3529 Captions/depictions are not saved to Commons - fix test

* Fix issue 3526 Unlike "Items" tab, "child classes" tab does not display description nor image thumbnail (#3619)

* fix thumbnail issue 3526

* Fix Description issue 3526

* revert changes on this file, not finished with it yet

* Fix Description for Child and Parent classes - issue 3526

* Remove conflict text in file

* Remove retrofit.HEAD import

* Incorporated review comments

* Fix issue 3137 (#3637)

* Fix issue 3137

* Remove import Timber

* Remove unnecessary space

* #3222 Merge master into Structured Data branch, fix conflicts - revert logging

* Fix build

* #3661 No Depictions Selected Dialog has reversed buttons - fix button order

* Revert "#3661 No Depictions Selected Dialog has reversed buttons - fix button order"

This reverts commit d8f9809584.

* #3222 Merge master into Structured Data branch, fix conflicts - remove unused methods/fields

* #3661 No Depictions Selected Dialog has reversed buttons - fix button order (#3662)

* #3653 Many Mnull requests - stop requesting captions for null ids (#3657)

* #3653 Many Mnull requests - stop requesting captions for null ids

* #3653 Many Mnull requests - move log line

* #3633 [structured-data branch] In depictions selection screen, suggest nearby items  (#3650)

* #3633 [structured-data branch] In depictions selection screen, suggest nearby items - for empty search terms show nearby items for depictions

* #3633 [structured-data branch] In depictions selection screen, suggest nearby items - use linear radii progression to search for places

* #3666 Crash when uploading on structured-data branch - revert cleanup of UploadController (#3670)

* #3222 Merge Structured Data branch into master - fix caption rendering in new UI

* #3222 Merge Structured Data branch into master - upgrade retrofit + okhttp

* #3664 Stop using JsonObject on StructuredData (#3672)

* #3664 Stop using JsonObject on StructuredData - remove usage in Media classes - remove from depicts client - create partial network models

* #3664 Stop using JsonObject on StructuredData - allow partial mapping of polymorphic models by returning null in typeadapter

* #3664 Stop using JsonObject on StructuredData - use models for editing depicts property

* #3664 Stop using JsonObject on StructuredData - use models for sparql parent query

* #3664 Stop using JsonObject on StructuredData - fix unit test compilation

* #3664 Stop using JsonObject on StructuredData - unify sparql responses

* #3664 Stop using JsonObject on StructuredData - minor cleanup of misnamed/unused/too broad visibility

* #3664 Stop using JsonObject on StructuredData - share variable names and logic for the Sarql queries

* #3664 Stop using JsonObject on StructuredData - add error logging

Co-authored-by: Vitaly V. Pinchuk <vetal.978@gmail.com>
Co-authored-by: Ashish Kumar <ashishkumar468@gmail.com>
Co-authored-by: vanshikaarora <vanshikaa937@gmail.com>
Co-authored-by: Vivek Maskara <maskaravivek@gmail.com>
Co-authored-by: Vanshika Arora <34261945+vanshikaarora@users.noreply.github.com>
Co-authored-by: Somanshu and Himanshu <somanshS14@gmail.com>
Co-authored-by: vvijayalakshmi21 <34595292+vvijayalakshmi21@users.noreply.github.com>
2020-04-21 09:34:53 -07:00
Madhur Gupta
22c20687f3
Converted Config Utils to Kotlin (#3674)
* Converted Config Utils to Kotlin

* Changes made as per suggestion

* Omitted this
2020-04-21 13:23:02 +01:00
translatewiki.net
6e60bbf8f5 Localisation updates from https://translatewiki.net. 2020-04-20 16:51:08 +02:00
Seán Mac Gillicuddy
bd9807bd1d
#3676 Update Gradle Plugin - bump version (#3677) 2020-04-20 13:39:04 +03:00
Kshitij Bhardwaj
81e12a9e1f
Fixes #3436 and #2881: Media Detail design Overhaul (#3505)
* ic_map_dark_24dp: map icon for white background

* ic_info_outline_dark_24dp: info icon for dark background

* MediaDetailFragment: update the spacer as per image aspect ratio

* fragment_media_detail: design overhaul

* fragment_media_detail: remove redundant background color statements

* make requested changes

* add dark mode support

* minor ui tweak

* white map icon in dark mode

* make rquested changes

* make requested changes to layout

* fix misalignment of category list

* subtle amendments

* convert comments to javadocs

* minor amendments

* minor changes

* add styles for media detail

* Media detail fragment refactored

* make suggested changes

* minor name fix

* fix the delete button border
2020-04-19 15:24:17 -07:00
Vivek Maskara
fcd2867d26
Address code review comments (#3669) 2020-04-17 09:39:10 +01:00
Seán Mac Gillicuddy
ff310e43e2
#3658 Throw exception instead of allowing nullable network models onError - peek response body and throw error (#3659)
* #3658 Throw exception instead of allowing nullable network models onError - peek response body and throw error

* #3658 Throw exception instead of allowing nullable network models onError - allow for more general error response catching
2020-04-17 00:25:00 -07:00
Vivek Maskara
07f19c470d
Remove unused constructor (#3668) 2020-04-16 22:19:56 -07:00
Vivek Maskara
55c5b1abf5
Convert download code to kotlin (#3665) 2020-04-16 15:07:12 -07:00
Seán Mac Gillicuddy
0d6a79e91a
#3630 [Library Discussion] Core-ktx (#3660) 2020-04-16 10:35:02 -07:00
translatewiki.net
773412f90e Localisation updates from https://translatewiki.net. 2020-04-16 17:05:53 +02:00
Madhur Gupta
743e24cd71
Fixed username visible after logout bug (#3648) 2020-04-15 13:40:37 +01:00
Vivek Maskara
32ee0b4f9a
With data-client added as library module (#3656)
* With data-client added as library module

* Fix build
2020-04-15 11:00:13 +01:00
Kshitij Bhardwaj
9ee04f3df4
ReviewController: remove call to review category notif builder while sending thanks (#3655) 2020-04-15 09:58:01 +01:00
Madhur Gupta
e341e77c8e
Converted DialogUtil to Kotlin (#3621)
* Converted DialogUtil to Kotlin

* Kotlin syntax and standard changes

* Removed ;

* Added missing null

* Added missing null

* Removed unnecessary code

* Reduced functions

* added let to customView

* reverted "let" changes

* reverted "let" changes

* removed if-statements

* replaced with "it"

* fixed overflow error

* Function rename

* Used named arguments

* Fix Typo

* single lined

* Update DialogUtil.kt

* changed default value
2020-04-15 09:34:34 +01:00
318anushka
75fe4ae5c1
Fast scroll issue fixed (#3593)
* fast scroll fixed in explore activity

* fast scroll fixed in explore activity

* fast scroll issue in explore

* fastscroll removed from explore
2020-04-14 11:34:35 +01:00
gouri-panda
5308c29240
Fixed logout problem #3547 (#3649)
* fixed logout problem

fixed logout problem

fixed logout problem

fixed logout problem

fixed logout problem

* added error handling on logout
2020-04-14 11:34:07 +01:00
Anmol Gupta
a0f8790d8f
Copy place name on long click (#3609)
* Copy place name on long click

* Remove hard coded string
2020-04-14 10:54:49 +01:00
translatewiki.net
e859c71905 Localisation updates from https://translatewiki.net. 2020-04-14 05:21:28 +02:00
translatewiki.net
241b54d008 Localisation updates from https://translatewiki.net. 2020-04-09 15:59:25 +02:00
Seán Mac Gillicuddy
d7a42b2f89
#3624 DateTimeFormat wrong - match pattern returned from servers (#3625) 2020-04-09 02:39:41 +10:00
Seán Mac Gillicuddy
6b075d9124
#3628 Update Gradle Plugin - bump version (#3629) 2020-04-08 16:10:19 +03:00
Seán Mac Gillicuddy
df16f98acd
#3492 Add inspections to git - add inspection profile (#3631) 2020-04-08 15:50:41 +03:00
Kshitij Bhardwaj
c82283a014
Fixes #3506: Image height remains zero for some time on bad network (#3513)
* optimise width loading

* amending as per the reviews

* aspect ratio updates after layout completion

* MediaDetailFragment: update aspect ratio using onGlobalLayoutListener

* remove unnecessary imports
2020-04-08 00:30:24 +10:00
Josephine Lim
c53fcb53cb Merge branch '2.13-release' 2020-04-07 04:59:41 +10:00
Josephine Lim
b028d1489b Merge branch '2.13-release' 2020-04-07 04:58:41 +10:00
Kaartic Sivaraam
93d6c52eb0
Update wiki page links (#3608)
We've moved the documentation to a separate repo.

So, change the old links to point to the corresponding
places in the documentation repo.
2020-04-07 04:57:31 +10:00
Prince Amankwah
bc8ce94d76 Fixed issue #3195 ordering contribution list (#3589)
* issue-#3195: order contribution list refactored

* issue-#3195: ordered contribution list
2020-04-07 03:46:35 +10:00
neslihanturan
b6df5f2a66
Fixes #3466 No crash information in crash email (Gmail) (#3605)
* Send ACRA logs as file instead

* no need to set it true, default is true
2020-04-07 03:17:26 +10:00
318anushka
577fb02c78
exit app on back pressed in tutorial (#3597)
* exit app on back pressed in tutorial

* exit app from ongoing tutorial

* exit app on back press in tutorial
2020-04-06 15:15:51 +01:00
Prince Amankwah
80530663a1
Fixed issue #3195 ordering contribution list (#3589)
* issue-#3195: order contribution list refactored

* issue-#3195: ordered contribution list
2020-04-06 14:54:51 +03:00
translatewiki.net
eb88e58ec0 Localisation updates from https://translatewiki.net. 2020-03-31 15:50:35 +02:00
Prince Amankwah
f0a37d3369
issue-#3606: cancel in translate goes back to about screen (#3610) 2020-03-31 01:56:59 -07:00
Ashish Kumar
4f5f0da4c6
Fixes #3611 (#3613)
* Properly generate Parcealables for Media & Contribution
2020-03-31 01:47:26 -07:00
Ashish Kumar
6416314dda
Fixes #3575 (#3602)
* Donot show random colors as placeholders for contributions items
* Theme contributionsItem background as mainBackground from attributes
2020-03-30 12:42:47 +03:00
Kshitij Bhardwaj
3d1ffbb4bc
Fixes #3479: Implement Progress Bar for Zoom Activity (#3481)
* ZoomableActivity: add hierarchy to view for displaying progress bar

* CircularProgressBar: circular progress bar for ZoomableDraweeView

* ZoomableActivity: add indeterministic loading spinner

* activity_zoomable: add inderterministic Progressbar

* remove circular progressbar and make changes to controller listener
2020-03-29 22:55:47 +03:00
Prince Amankwah
8a5944dd87
issue-#3567: logos in about activity visible (#3592) 2020-03-29 22:29:51 +03:00
318anushka
5c4eea3cc1
swipe away failed notification (#3598) 2020-03-29 22:17:30 +03:00
Kaartic Sivaraam
38635d0f43
PULL_REQUEST_TEMPLATE: clarify that issue number needs to be replaced (#3599)
Some contributors seem to be missing the fact that they have to mention
the issue number right after `Fixes ` to ensure the corresponding issue
gets closed[1] when the PR gets merged.

Clarify this by using a better phrase that clearly states that they
have to replace the placeholder text with the issue number.

[1]: https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
2020-03-29 21:42:17 +03:00
translatewiki.net
b085091c2b Localisation updates from https://translatewiki.net. 2020-03-26 16:03:48 +01:00
neslihanturan
e7efd7e162
Fix auto zoom issue #3391 Zoom level gets reset at every second. (#3564)
* Add method to check if curr location marker is vsible or not

* Recenter map if users see their current location marker

* Add new methods to Contract
2020-03-27 00:53:11 +10:00
hudlerr
350e95b56a
Fixes #3494 (#3519)
* better names for the upload warning dialog buttons #3494

* Dialog button pt2

* dialog buttons pt3

* round 4..

Co-authored-by: Hdot <a.hudaa@hotmail.com>
2020-03-25 13:38:12 +00:00
Seán Mac Gillicuddy
7ed911808d
#3579 p18Value causes NPE in WikidataEditService createClaimWithLogging - add null check (#3580) 2020-03-25 00:59:44 +10:00
318anushka
8cb4e28a97
Wiki itemname displaying in toast (#3569)
* Wiki itemname displaying in toast

* Wikidata label displaying in toast

* Wikidata label displaying in toast

* wikiItemName added to parcelable methods

* Wikidata label displayed in toast

* Wikidata label displayed in toast
2020-03-24 12:54:37 +00:00
Vivek Maskara
f7efa0e20a
Fix title/desc not getting filled for nearby picture (#3577) 2020-03-24 07:56:44 +00:00
Kaartic Sivaraam
1899d92cdf
PULL_REQUEST_TEMPLATE: request only issue number (#3545)
For some time now, GitHub is showing cards when we hover over an issue
number which gives us a quick summary of the issue. The issue title is
shown in the card among other things.

Given that and the fact that we already require the issue number to be
specified in the pull request description, it's now moot to
ask the contributors to include the issue title in the pull request
description. So, let's remove this unnecessary burden from them.
2020-03-23 12:33:52 -07:00
translatewiki.net
a31499b11f Localisation updates from https://translatewiki.net. 2020-03-23 14:57:26 +01:00
Anmol Gupta
839a61bba4
Change BiMap to HashMap (#3572)
* Change BiMap to HashMap

* Change containsKey to containsValue and delete BiMap.java
2020-03-23 13:21:28 +00:00
Kaartic Sivaraam
630f0a1dff
Fix hardcoded string in similar image dialog (#3563)
Fixes #3557
2020-03-22 11:23:00 -07:00
Anmol Gupta
a63a3580de
Change "Archived" notifications to "Read" notifications (#3554)
* Change archived to read

* Change string names
2020-03-20 14:20:20 +00:00
Seán Mac Gillicuddy
fb51fc618a
#3408 Refactoring the FileProcessor and GPSExtractor classes (#3543)
* #3408 Refactoring the FileProcessor and GPSExtractor classes - refactor FileProcessor

* #3408 Refactoring the FileProcessor and GPSExtractor classes - refactor and rename GpsExtractor

* #3408 Refactoring the FileProcessor and GPSExtractor classes - convert ImageCoordinates to kotlin

* #3408 Refactoring the FileProcessor and GPSExtractor classes - convert FileProcessor to kotlin

* #3408 Refactoring the FileProcessor and GPSExtractor classes - minor reformatting

* #3408 Refactoring the FileProcessor and GPSExtractor classes - fix compilation and naming issues

* #3408 Refactoring the FileProcessor and GPSExtractor classes - remove empty test

* #3408 Refactoring the FileProcessor and GPSExtractor classes - set coordinates for upload item if user chooses it
2020-03-20 17:18:14 +03:00
Madhur Gupta
efc6fa6211
Fixes #3473 Changed Names and Order or Theme Options (#3556) 2020-03-20 13:30:28 +00:00
Seán Mac Gillicuddy
c972f74fad
#3532 Issue with gitignore - synchronise section with default plugin state (#3535) 2020-03-20 20:34:41 +10:00
Fawziyah Alebiosu
d3bc0721c6
Issue #3428: Swapped text in dialog buttons (#3496)
* Issue #3428: Swapped text in dialog buttons because, according to Android Convention, they were opposite each other

* Fixed Issue #3428 so it actually works correctly now: Swapped text in dialog buttons because, according to Android Convention, they were opposite each other

* Made sure that all of the places where the two types of showAlertDialog accurately match up with the new position of positive and negative text on the dialog box
Also removed occurences of empty lambda expressions and used null instead

* modified deletThisPicture to be accurate lambda call

* reverted mistake where ellipses replaced the three dots
2020-03-20 07:26:34 +00:00
translatewiki.net
d028cf189c Localisation updates from https://translatewiki.net. 2020-03-19 15:02:56 +01:00
Anmol Gupta
a0309d955a
Modify PR template (#3548) 2020-03-19 11:52:22 +00:00
Aryan Tyagi
4e51492de6
Removed the focus change listener of the username edittext (#3538) 2020-03-19 08:54:23 +00:00
Madhur Gupta
0ad269d3d6
Fixes 3536 (#3537) 2020-03-19 08:39:59 +00:00
Ashish Kumar
efdb00b5ee
Fixes #3359 Duplicate Photos in Contributions Page (#3515)
* Fixes #3359
* Cache thumb url & imageUrl in local db
* Use Fresco's ImageRequest to show images in ContributionViewHolder[this was the issue, we should have always used this to show the image]
* Deleted DisplayableContribution (not needed anymore)
* Exposed abstract function in ContributionDao to updateContribution

* * Make position private in ContributionViewHolder
* Remove MediaDataExtractor from ContributionsFragment

* * Show placeholder image for Contributions while the image loads
* setHasStableId's ContributionsAdapter

* make Random variable private in ContributionViewHolder

* replace local variable-if-with ternary operator in ContributionViewHolder

* Fix indentation/formatting of ternary operator in ContributionViewHolder

* I might revert this commit[I have reasons]

* Create in-memory drawables in CVH's onBind, caches are bad, add mental overhead

* Revert "I might revert this commit[I have reasons]"

This reverts commit 627ac91517.

* minor formatting changes, reverted 627ac91517

* uh-oh missed semicolon, java

* minor formatting changes
2020-03-18 13:47:51 +03:00
Aryan Tyagi
021105ac4d
Add a dialog to prompt user if location is off in Nearby when L… (#3438) 2020-03-18 15:50:00 +05:30
Madhur Gupta
15bccdf650
Fixes #3465 Use AndroidX Pref (#3521)
* [WIP] Fixes #3465 Use AndroidX Pref

* Deleted Unused Files

* Added singleLineTitle

* Updated Gradle Properties

* Migrated to Androidx

* Inline Variable change

* optimise imports

* Fixed Crash on empty input
2020-03-17 13:10:26 +00:00
Vitaly V. Pinchuk
e55b5495a1
Fixes #3464, App posts deletion request notifications ({{subst:idw}}) on the wrong user's talk page (#3495)
* Fixed #3464: App posts deletion request notifications ({{subst:idw}}) on the wrong user's talk page

* Fixed DeleteHelperTest.kt

* Fixed DeleteHelper tests and null-pointer exception

* Modified DeleteHelper makeDeletion() test

* Reverted unintentionally modified Project.xml

* Raising exception when nominating for deletion with empty creator name

* Fixed code style

* Fixed code style
2020-03-17 14:39:28 +03:00
Seán Mac Gillicuddy
cd2d530175
#3524 Convert SpinnerLanguagesAdapter to kotlin - converted to kotlin (#3528)
* #3524 Convert SpinnerLanguagesAdapter to kotlin - converted to kotlin

* #3524 Convert SpinnerLanguagesAdapter to kotlin - add KDoc - rework logic - format
2020-03-17 21:06:56 +10:00
neslihanturan
e5d5a7af92
Fix p18 issue For an item with P18 item, do not add another one (#3527)
* Add p18value variable to contrib

* set place.pic to candidate contribution

* Add p18 value to contrib

* Passes p18 value to wikidata upload service

* Checks if pic parameter of the wikidata item is empty or not. If not, it does not overrides the existing image, it is just a regular commons upload.

* Make public var private

* Make current tests pass

* Add test case for p18 value is not empty

* Fix wrong log message

* Add nonnul annotation and fix method javadoc
2020-03-17 10:35:21 +00:00
318anushka
bdb61dfda6
Fixes #2238 scalebar added in map (#3511)
* scalebar added in map

* changes reverted in .idea/Project.xml

* magic numbers replaced with constants for scalebar

* Default setting for scaling unit

* Default setting for scalebar refresh interval

* Reformatted code for adding scalebar

* dimen values for scalebar params
2020-03-17 08:41:31 +00:00
translatewiki.net
af131a9792 Localisation updates from https://translatewiki.net. 2020-03-16 15:40:49 +01:00
taakanksha
9cb81fce8c
author not shown bug (#3525) 2020-03-16 13:46:36 +00:00
gouri-panda
1fd748f8e7
solved crashing problem in nomination button (#3522)
solved crashing problem in nomination button

solved crashing problem in nomination button
2020-03-16 11:14:06 +00:00
Anmol Gupta
34a016d49d
Change item background according to the theme (#3480)
* Change item  background according to the theme

* Change background colour of item on being selected

* Change background colors using XML selectors
2020-03-16 10:13:20 +00:00
Seán Mac Gillicuddy
81c7281d3a
#3471 Remove android.enableUnitTestBinaryResources - remove line (#3478) 2020-03-16 19:38:58 +10:00
Kshitij Bhardwaj
668b5896a2
Chek if getContext() is instanceOf CategoryImagesCallback and only then request more images 2020-03-14 15:00:33 +05:30
Kaartic Sivaraam
a78e167676
Revert stopgaps related to beta server cert issue (#3396)
* Revert stopgaps related to beta server cert issue

The upstream issue with Commons beta server has been
fixed now[1]. So, there's no point in stopgapping
the issue anymore. So, revert the related changes.

This reverts fa87eb5661
and df426f7c42 which
correspond to PRs #3350 and #3349 respectively.

[1]: https://phabricator.wikimedia.org/T243881#5861983

* Test-fix: fix the failing CI test
2020-03-13 14:58:43 +00:00
Seán Mac Gillicuddy
4bd7a5b1e2
#3493 App freezes for 15 seconds when you press Next in UploadMediaDetailsFragment (#3499)
* #3493 App freezes for 15 seconds when you press Next in UploadMediaDetailsFragment - add apropriate schedulers and convert justs to fromCallable

* #3493 App freezes for 15 seconds when you press Next in UploadMediaDetailsFragment - remove test for removed functionality

* #3493 App freezes for 15 seconds when you press Next in UploadMediaDetailsFragment - replace kotlin with java
2020-03-13 23:47:20 +10:00
translatewiki.net
ed5f8efa6b Localisation updates from https://translatewiki.net. 2020-03-12 19:19:15 +01:00
Madhur Gupta
d925e32d2f
Added AboutActivityTest (#3475)
* Added AboutActivityTest

* Changes made as per suggestions

* Removed File to resolve conflict

* Removed hardcoded packagename

* Changes as per suggestion

* Removed Unrelated changes

* Fixed Build Issues
2020-03-11 15:02:30 -07:00
Seán Mac Gillicuddy
57ddc6af10
#3488 Delete app/prod folder - deleted (#3489) 2020-03-11 22:58:59 +05:30
Seán Mac Gillicuddy
80ea11f7d8
#3445 Add codestyle to git - import google java code style, use predefined styles for kotlin/xml (#3486) 2020-03-11 22:41:29 +10:00
taakanksha
61a3f45512
openStreetMap attribution enabled (#3485) 2020-03-11 09:51:38 +00:00
Vivek Maskara
bd668182b5
[WIP] Implemented Espresso tests for upload with multilingual descriptions (#2830)
* With more upload tests

* Fix tests

* Fix tests
2020-03-10 12:01:22 -07:00
Ashish Kumar
99c6f5f105
Shift contributions to use Room DB (#3324)
* Part of #3127
* Added Room Dependency
* Shifted ContributionsDao to use RoomDB

* Save and Fetch contributions via RoomDAO

* Bugfixes, fixed test cases, injected schedulers for ContributionsPresenter

* removed stetho

* Fixed ReviewHelperTest cases

* Fixed test cases in DeleteHelperTest

* Fetch all contributions [TODO add pagination to use this, maybe later in a seperate PR]

* Update Schema false in AppDatabase

* removed parameter from fetchControbutions

* Added logs for fetch contributions

* Fixed test case ContributionsPresenter

* Added an autogenerate primary key, submit save contributions on executor

* fixed getItemAtPosition

* MainActivity Config changes +=orientation

* BugFixes
* Make AppDataBase Singleton
* Set _id as autogenerate primary key [replacing the previously used filename, seems like they are not unique]
* Replace Execxutor Utils with Subscribers on Singles in UploadService
* BugFix, Upload Progress

* Remove un-nescessary null check on contributions in ContributionsListAdapter

* removed ContributionsListFragment [not-implemeted]

* Review suggested changes
* removed un-nescessary null checks
* provide ContributionsDao
* Minor bug fixes

* wip

* delete existing contributions table (from the existing db) on upgrade

* remove un-nescessary null checks in test classes

* shifted media to be a local variable in ReviewHelperTest

* removed captured folder

* Dispose composite disposables in UploadService

* replaced size check with isEmpty ContributionsPresenter

* transform saveContributions to a Completable

* Addressed comments in review
* Typo in Contributions
* ReasonBuilderTest (create media object instead of mocking)
* Use global Gson object instead of creating a new one in Converters

* Provide Gson to Converters from the CommonsApplicationComponent

* use static method instead of field instead of static field to provide GSON in Converters

* Modified gitignore to exclude captures/*
2020-03-10 00:13:20 +03:00
Kshitij Bhardwaj
642ed51c8c
Fixes #3414: For v2.13, Handle zoom in media details view (#3422)
* MediaDetailFragment: add zoom feature

* fragment_media_detail: add SimpleDrawee for Scroll picture

* ZoomableActivity: activity which facilitates zoom in

* activity_zoomable: xml for zoom activity

* zoomControllers: controllers for handling gesture and zooming

* MediaDetailFragment: fixing name of image variable

* MediaDetailFragment: display as per the aspect ratio of image

* add zoom activity to AndroidManifest

* fix travis ci faliure

* fix resizing of image
2020-03-09 21:07:48 +03:00
translatewiki.net
5fd88ef1a8 Localisation updates from https://translatewiki.net. 2020-03-09 16:34:48 +01:00
Seán Mac Gillicuddy
64179d0073
#3476 Use individual test commands on CI instead of check (#3477)
* #3476 Use individual test commands on CI instead of check - use individual commands and narrow scope

* #3476 Use individual test commands on CI instead of check - fix indentation
2020-03-09 12:16:28 +00:00
Kshitij Bhardwaj
7450b44ab7
Fixes #3295: Ultimate achievement: Too many contributions (#3378) 2020-03-08 17:09:38 +00:00
Anmol Gupta
16f1ba8640
About page: Update logos (#3472) 2020-03-08 13:31:12 +00:00
Vivek Maskara
11e878eb89 Comment out application id from default config 2020-03-06 20:56:53 -07:00
Seán Mac Gillicuddy
49ef5619a6
#3469 Update Gradle Play Publisher to resolve issues with travis build (#3470)
* #3469 Update Gradle Play Publisher to resolve issues with travis build - update GPP/Gradle and use jacoco-android fork with gradle 6.0 support

* #3469 Update Gradle Play Publisher to resolve issues with travis build - remove extraneous space
2020-03-06 23:07:53 +10:00
translatewiki.net
fa1d8bc20b Localisation updates from https://translatewiki.net. 2020-03-05 17:27:56 +01:00
Seán Mac Gillicuddy
1584ffe0e2
Added Support for System Wide Dark Theme (#3460)
* Added Support for System Wide Dark Theme

* changed methods to private

* Moved Strings to strings.xml

* Used Dagger to reduce code repetition

* Changes made as per review suggestions

* Minor Changes

* Fixes as per suggestions

* Minor Fixes as per suggestion

* made the variables static

* removed irrelevant code
2020-03-05 14:33:57 +00:00
Vivek Maskara
65ec071493
Fix existing Espresso tests (#3450)
* Fix existing Espresso tests

* Convert class to kotlin
2020-03-02 15:17:24 -07:00
translatewiki.net
36cafd7c39 Localisation updates from https://translatewiki.net. 2020-03-02 14:43:37 +01:00
Adam Jones
6a5afefbf5
Update mapbox, gradle and android plugin versions (#3443) 2020-03-02 13:17:36 +00:00
Kaartic Sivaraam
48b6745349
Open external links in same activity (#3395)
It's common for users to expect that re-opening the app would
allow them to "continue where they left off". This also applies
for the case where they leave the app after opening an
external link. It's natural for them to expect that they would
see the webpage they left open when they re-open the app. This
doesn't happen for our app as we open custom tabs in a separate
activity. As a consequence, this makes the experience
un-intuitive.

Fix this by opening custom tabs in the same activity.

Fixes: #2944

Co-authored-by: Adam Jones <jones_adam@rocketmail.com>
2020-03-02 19:59:26 +10:00
Madhur Gupta
e68751f0b9
Moved some Java files to kotlin (#3439)
* Converted NetworkConnectionType.java to Kotlin

* Converted Urls.java to Kotlin and Updated AboutActivity

* Improved code quality
2020-03-01 16:13:08 -07:00
Aristos Pasalidis
78057b6a8a
Fix #3091: Remove odd code in CategoryImagesListFragment (#3133) 2020-03-01 15:30:58 +00:00
Veyndan Stuart
7da5d130b7
Replace functions in FileUtilsTest with ones from kotlin-stdlib (#2943) 2020-03-01 13:32:29 +00:00
translatewiki.net
e3034918e7 Localisation updates from https://translatewiki.net. 2020-02-27 17:11:09 +01:00
Madhur Gupta
584fa2c778
Fixes #814 Added App Shortcuts (#3381)
* Fixes #814 Added App Shortcuts

* removed Review app shortcut

* Added Adaptive icons
2020-02-25 15:05:00 -07:00
Aryan Tyagi
fffff62f5c
Fixed a type in NearbyParentFragment.java where significantly was written instead of slightly while adding a log using Timber (#3432) 2020-02-25 13:56:50 +02:00
translatewiki.net
47155d1f55 Localisation updates from https://translatewiki.net. 2020-02-24 15:38:45 +01:00
Madhur Gupta
3d0048a771
Added progress dialog for setting wallpaper (#3427)
* Added progress dialog for setting wallpaper

* Updated dialog strings
2020-02-23 16:51:15 -07:00
Yash Khare
39cb190571
Fix #3416 Add snackbar on clicking add/remove from bookmarks (#3419) 2020-02-21 20:01:28 +10:00
translatewiki.net
d423dbb0be Localisation updates from https://translatewiki.net. 2020-02-20 15:57:46 +01:00
Kshitij Bhardwaj
96f4a5c08f
Fixes #3355 : Do not display pins at all when "Needs Photo" is selected (#3407)
* ic_custom_greyed_out_marker: removing grey marker

* NearbyParentFragment: changing function name and description

* change method name to hideAllMarkers
2020-02-19 20:43:19 +02:00
translatewiki.net
af97e40c13 Localisation updates from https://translatewiki.net. 2020-02-17 14:53:42 +01:00
gouri-panda
fd706cf3fd
fix typo #3417 (#3418) 2020-02-17 17:30:08 +09:00
Aastha Bist
4038519012
code-quality: remove CDATA and <u> tags from string.xml (#3310)
Remove CDATA and <u> tags from string resources. Instead use setUnderlinedText() method added in Utils to create underlined string resources.
2020-02-17 00:34:46 -07:00
Yash Khare
75d489128c
Fixes #3403 Add padding between privacy policy button and bottom of the screen (#3404)
Fixes #3403 Add padding between privacy policy button and bottom of the screen
2020-02-15 01:12:02 +10:00
translatewiki.net
bc602371ec Localisation updates from https://translatewiki.net. 2020-02-13 12:31:30 +01:00
Yash Khare
69e7161c61
Fixes #3197 Replace hardcoded dimensions with dimen resource values (#3402) 2020-02-11 21:26:33 -07:00
Animesh Kumar
9b3f3e9d3c
Fixed minor Login Bug (#3373) 2020-02-11 11:35:57 -07:00
Kaartic Sivaraam
6683ea40ec
Don't show the quiz pop-up twice (#3398)
* Avoid showing the quiz pop-up twice to the user

Due to the current flow of code it's possible that in
some cases the quiz pop-up is shown to the user twice.
This is unnecessary and unintentional.

So, change the logic in such a way that the quiz pop-up
would be never be shown twice to the user.

Fixes: #3281

* Quiz: remove unused parameters from methods

Some methods don't seem to be using the parameters that
they receive. So, just remove the unused parameters.
2020-02-11 11:28:07 -07:00
Yash Khare
b65e4a1841
Fix #3191 Make the username along with the rewards icon clickable in the Navigation Drawer (#3401) 2020-02-11 19:27:54 +02:00
translatewiki.net
eb400515ca Localisation updates from https://translatewiki.net. 2020-02-10 14:50:03 +01:00
Kaartic Sivaraam
e387e9a8d3
Hide Review for logged out users (#3390)
It makes sense to not show the review activity for logged
out users for the same reasons that we don't allow users
to upload images.

We're even considering to limit the review activity to users
with a particular level of achievement[1]. So, it's valid to
not show review activity for logged out users who don't
have achievements levels at all.

[1]: https://github.com/commons-app/apps-android-commons/issues/2852
2020-02-10 04:41:33 +10:00
Madhur Gupta
0049c8ba44 Fixes #3392 Fixed Nearby List Item Icon's Background (#3393) 2020-02-08 17:55:09 +02:00
Mudit Jain
81bb46f067
changing background color of conditions in nearby as uniform (according to chip state) (#3365)
Signed-off-by: Mudit Jain <ciphereck@gmail.com>
2020-02-07 15:39:47 +02:00
Madhur Gupta
3c93d801a1
Fixes #3382 Fixed Notification Message Icon Background (#3383) 2020-02-07 15:32:47 +02:00
translatewiki.net
b13d88837e Localisation updates from https://translatewiki.net. 2020-02-06 14:53:47 +01:00
Ashish Kumar
fdbe53d1e5
Fixes #3371 (#3372)
* Is UserBrowsing should first check if last known location is non-null before checkig if last location and current locations are close
2020-02-05 01:00:57 +10:00
Ashish Kumar
05e98307be
Fixes #3303 (#3322)
* Fixes #3303
* Refactor Nearby to alig lifecycle methods

* Pass updated place list to listfragment

* Added default zoom rate to mapbox

* Removed NearbyListFragmet and added the ui login to handle the same in NearbyParentFragment

* More code refactor
* Make BottomSheetList hideable
* onFragmentHide, hide the bottom sheets

* BigFix, Fragmet visibility, register/un-register camera move based on fragments lifecycke

* More code refactor
* Let the ExecutorUtil have non-ui thread
* Add Location Marker on non-ui thread (the non-ui stuffs)

* BugFixes
* Removed configchanges "orientation" from MainActivity in Manifest (That was messing with the fragment lifecycle)
* Some null checks
* Initialise lastknown location in onMapReady

* UI Fixes
* Adjusted UI to support dark and no-dark themes both (in nearby)
* Do not update map on Location Slightly changed

* Fix failing test case, let TestCommonsApplication extend Application instead of CommonsApplication

* start map view when nearby is visible

* start the map when NearbyFragmet is visible

* More bugfixes
* Added DUMMY view for NearbyPresenter's onDetach State
* Added a wrapper frame layout parent for MapView to preven it from drawing above other views

* More bugfixes (Fixes #3287)
* Gray out the un-selected markers from the nearby filter list

* BugFix, search this area should search the nearby places for the current camera position

* More BugFixes
* Handle null primitives with proxy
* Current location marker flow via permission flow

* onCameraMove should have null-check on NearbyController.latestSearchLocation instead of currentLocation

* Search for places around last focus location

* Handle location updates
* If the user is browsing the map, donot update the map with current location
2020-02-04 11:05:29 +02:00
Kshitij Bhardwaj
a6d2523588
Adds a Test for Method A categories search (#3366)
* CategoriesModelTest: add methodA test for categories search

* CategoriesModelTest: use lateinit wherever possible

* CategoriesModelTest: make method name meaningful
2020-02-03 08:33:40 -07:00
translatewiki.net
8e88b2de8a Localisation updates from https://translatewiki.net. 2020-02-03 15:39:00 +01:00
animeshk08
bfb6dfdeaf
Fix: Issue #3367 Bug: SoftKeyboard showing even after switching from nearby tab to contribution tab (#3368)
Hide keyboard when switched back from NearbyFragment to ContributionsListFragment
2020-02-03 01:54:00 +05:30
translatewiki.net
61bfe84594 Localisation updates from https://translatewiki.net. 2020-01-30 15:48:34 +01:00
Josephine Lim
0068820ac2 Merge branch '2.12-release' 2020-01-30 02:31:59 +10:00
Josephine Lim
5e3760a899
Update changelog.md 2020-01-30 02:18:04 +10:00
Josephine Lim
dc08a5e883 Versioning for v2.12.3 2020-01-30 02:16:55 +10:00
Vivek Maskara
2290545bc9
Suggest and auto fill title and description based on image location (#3323)
* Suggest and auto fill title and description based on image location

* with java docs
2020-01-29 13:24:37 +03:00
Kshitij Bhardwaj
afdeaae075
Fixes: #3179 Make category search non case-sensitive (#3326)
* CategoryClient: fix category search case-sensitivity by converting to lower case as MW api is inherently case-sensitive, the results obtained will be same

* CategoryItem: reverting javadoc changes

* CategoriesModel: make category search case-insensitive

* CategoryItem: fix whitespaces

* Add tests for case-insensitivity

* CategoryClientTest: add more test cases

* CategoryClientTest: fix travis ci test

* CategoriesModelTest: changes mage to CategoriesModel and tested
2020-01-28 20:38:07 -07:00
Kshitij Bhardwaj
0affe71745 Fixes: #3278: Add java docs to methods which have it missing (#3351)
* achievements/: add Javadocs

* actions/: add Javadocs

* WikiAccountAuthenticator: add Javadocs

* ReasonBuilder: add Javadocs

* di: Add javadocs to DI files

* bookmarks: add Javadocs to bookmarks files

* di: Added more Javadocs

* file: add Javadocs for file picker

* actions: add proper decription to the classes
2020-01-28 11:45:15 -07:00
Kshitij Bhardwaj
803bed43d7 Fixes: #3343 TextUtils.isEmpty creates problems when unit testing with Mockito (#3344)
* TextUtils: add mock textUtils for tests

* TextUtils: add more methods to mock for testing

* UploadControllerTest: fix the test resulting travis ci to fail
2020-01-27 22:02:14 -07:00
Somanshu
d235e5a85b Fixes #3327: Trim whitespaces from title on upload (#3348)
Trim WhiteSpaces from Image-Title while upload
2020-01-28 10:15:09 +05:30
translatewiki.net
d86fe5d8c5 Localisation updates from https://translatewiki.net. 2020-01-27 17:36:50 +01:00
Ashish Kumar
721d2feb45 Fixes #3336 Hotfix: Coordinates of picture are not uploaded (#3339)
* Fixes #3336
 * Donot redact locatio by default

* Correction inn default tag save

* Use same key across application for managedExifTags

* Updated key name to avoid class cast in existing build
2020-01-27 15:48:11 +03:00
Ashish Kumar
fa87eb5661 Fixes #3345 (#3350)
* Fixes #3345
* Trust all hosts for beta
* Added a custom NetworkFetcger for Fresco when on beta

* removed unused assets

* make TestCommonsApplication extend Application instead of Commons Application
2020-01-26 22:13:18 -07:00
Ashish Kumar
df426f7c42 Fixes #3320 (#3349)
* Fixes #3320
* Added SSL certificate for commons beta
* Asked OKHTTP client to use SSLContext from beta certificate
* Probable Fix of #3345

* Use ConfigUtils to verify flavor
2020-01-26 12:31:14 -07:00
translatewiki.net
fe56cefdbc Localisation updates from https://translatewiki.net. 2020-01-23 16:07:34 +01:00
Josephine Lim
0fb8f97b50 Merge branch 'master' of https://github.com/commons-app/apps-android-commons 2020-01-22 22:57:10 +10:00
Josephine Lim
095d047370 Merge branch '2.12-release' 2020-01-22 22:57:02 +10:00
Josephine Lim
f7adbf7b4d
Update changelog.md 2020-01-22 22:49:10 +10:00
Josephine Lim
ba8efb5aaa Versioning for v2.12.2 2020-01-22 22:47:51 +10:00
Alicia
f9eb320a5d Issue 3236: Change nearby search text to white (#3331)
* Clear parent from customView if parent is not null

* Apply white search bar theme to nearby search

* Undo changes from bad merge

* Fix up tag formatting
2020-01-22 13:25:47 +03:00
Ashish Kumar
bae3fa8bbf Fixes #3335 (#3337)
Handled sqlitexception for adding existig column in app versions which already have COLUMN location_pic
2020-01-22 03:22:35 +10:00
Malcolm Smith
14ea6c0cba Change tempalte character case from EXIF to Exif (#3330) 2020-01-20 12:42:49 -07:00
Kshitij Bhardwaj
cd4fc2cdf0 CategoryItem: add javadocs to the file (#3332) 2020-01-20 12:39:31 -07:00
translatewiki.net
c682ba83d7 Localisation updates from https://translatewiki.net. 2020-01-20 11:30:54 +01:00
Josephine Lim
ef9e2986b2 Versioning and changelog for v2.12.1 2020-01-20 00:21:24 +10:00
Josephine Lim
53d3c37180
Update changelog.md 2020-01-20 00:03:05 +10:00
translatewiki.net
59cb157754 Localisation updates from https://translatewiki.net. 2020-01-16 15:28:57 +01:00
translatewiki.net
8824076c1a Localisation updates from https://translatewiki.net. 2020-01-13 16:07:10 +01:00
Amir E. Aharoni
d26b4368a7 Remove unnecessary space before colon (#3317) 2020-01-10 23:27:49 +03:00
Amir E. Aharoni
b55e68378b More natural language instead of a slash (#3318) 2020-01-10 23:26:41 +03:00
translatewiki.net
56c4018326 Localisation updates from https://translatewiki.net. 2020-01-09 20:06:26 +01:00
translatewiki.net
173dcd2c6a Localisation updates from https://translatewiki.net. 2020-01-06 17:40:33 +01:00
translatewiki.net
85366aaf83 Localisation updates from https://translatewiki.net. 2020-01-02 14:31:31 +01:00
translatewiki.net
e56adc6b41 Localisation updates from https://translatewiki.net. 2019-12-31 07:24:24 +01:00
translatewiki.net
b591fdd8a2 Localisation updates from https://translatewiki.net. 2019-12-26 12:32:07 +01:00
translatewiki.net
846e04f677 Localisation updates from https://translatewiki.net. 2019-12-23 15:46:00 +01:00
translatewiki.net
8fc8113cad Localisation updates from https://translatewiki.net. 2019-12-19 15:05:28 +01:00
Vivek Maskara
a8ee5bd201 Fix UI tests (#3297) 2019-12-17 14:24:41 +03:00
translatewiki.net
458b497a6c Localisation updates from https://translatewiki.net. 2019-12-16 15:52:39 +01:00
ANKIT
ecf6bd930c color accent changed tto blue in dark theme (#3234) 2019-12-16 13:56:20 +05:30
translatewiki.net
28e96eb54c Localisation updates from https://translatewiki.net. 2019-12-12 15:20:00 +01:00
Zoran Dori
b4c4691348 Update strings.xml (#3285)
Improve share_text string for #3192.
2019-12-11 00:02:50 +10:00
Josephine Lim
e23b80dfcd Merge branch '2.12-release' 2019-12-10 23:52:22 +10:00
translatewiki.net
3d923afcfc Localisation updates from https://translatewiki.net. 2019-12-09 15:47:02 +01:00
Vivek Maskara
b0be4970ef Convert few model classes to kotlin (#3270) 2019-12-07 02:36:53 +10:00
Josephine Lim
d0f97398a5 Merge branch '2.12-release' 2019-12-06 22:32:36 +10:00
Manuel Alcaraz
f7cca31c53 Optimize imports (#3272) 2019-12-06 17:51:36 +09:00
Vivek Maskara
57a8aefde6 Use mockito for all tests instead of just for UI tests (#3277) 2019-12-05 20:47:13 +05:30
translatewiki.net
96d36ba3d8 Localisation updates from https://translatewiki.net. 2019-12-05 15:18:01 +01:00
Vivek Maskara
2f9a71911a Remove unused code from the app (#3276) 2019-12-05 18:07:21 +05:30
Ashish Kumar
bb0a21929e Added unit-tests for CacheController (#3275) 2019-12-05 16:33:55 +05:30
Ashish Kumar
6e485d687c Added unit-tests for NotificationClient & NotificationController (#3274) 2019-12-05 20:34:07 +10:00
Vivek Maskara
f27749fa51 With more unit test cases (#3269) 2019-12-04 18:51:02 +10:00
Ashish Kumar
d2fb3b36e7 Added unit-tests for PageEditClient & ThanksClient (#3268) 2019-12-04 17:27:06 +10:00
1698 changed files with 142415 additions and 52145 deletions

85
.github/ISSUE_TEMPLATE/bug-report.yml vendored Normal file
View file

@ -0,0 +1,85 @@
name: "\U0001F41E Bug report"
description: Create a report to help us improve.
title: "[Bug]: "
type: Bug # Retained to categorize the issue as per organization-level type
body:
- type: markdown
attributes:
value: |
- Before creating an issue, please search the existing issues to see if a similar one has already been created.
- You can search issues by specific labels (e.g. `label:nearby`) or just by typing keywords into the search filter.
- type: textarea
attributes:
label: Summary
description: Summarize your issue (what goes wrong, what did you expect to happen)
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce
description: How can we reproduce the issue?
placeholder: |
1. Have the app open..
2. Go to..
3. Click on..
4. Observe..
validations:
required: true
- type: textarea
attributes:
label: Expected behaviour
placeholder: A menu should open..
validations:
required: true
- type: textarea
attributes:
label: Actual behaviour
placeholder: The app closes unexpectedly..
validations:
required: true
- type: markdown
attributes:
value: |
# Device information
- type: input
attributes:
label: Device name
description: What make and model device did you encounter this on?
placeholder: Samsung J7
validations:
required: false
- type: input
attributes:
label: Android version
description: What Android version (e.g., Android 6.0 Marshmallow or Android 11) are you running? Is it the stock version from the manufacturer or a custom ROM ?
placeholder: Android 10
validations:
required: true
- type: input
attributes:
label: Commons app version
description: You can find this information by clicking the right-most menu in the bottom navigation bar in the app and tapping 'About'. If you are building from our codebase instead of downloading the app, please also mention the branch and build variant (e.g. `master` and `prodDebug`).
placeholder: 3.1.1
validations:
required: true
- type: textarea
attributes:
label: Device logs
description: Add logcat files here (if possible). Need help? See "[Getting app logs from Android Studio](https://commons-app.github.io/docs.html#getting-app-logs-from-android-studio)".
validations:
required: false
- type: textarea
attributes:
label: Screenshots
description: Add screenshots related to the issue (if available). Can be created by pressing the Volume Down and Power Button at the same time on Android 4.0 and higher.
validations:
required: false
- type: dropdown
attributes:
label: Would you like to work on the issue?
description: Please let us know whether you want to fix the issue by yourself. If not, anyone can get the issue assigned to them.
options:
- "Yes"
- Prefer not
validations:
required: false

View file

@ -0,0 +1,30 @@
name: "⭐️ Feature request"
description: Suggest an idea for this project
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
- Please do your best to search for duplicate issues before filing a new issue so we can keep our issue board clean.
- Every issue should have exactly one feature request described in it. Please do not file feedback list tickets as it is difficult to parse them and address their individual points.
- Feature Requests are better when theyre open-ended instead of demanding a specific solution e.g: “I want an easier way to do X” instead of “add Y”.
- type: textarea
attributes:
label: What is the user problem or growth opportunity you want to see solved?
validations:
required: false
- type: textarea
attributes:
label: How do you know that this problem exists today? Why is this important?
validations:
required: false
- type: textarea
attributes:
label: Who will benefit from it?
validations:
required: false
- type: textarea
attributes:
label: Anything else you would like to add?
validations:
required: false

46
.github/ISSUE_TEMPLATE/feedback.yml vendored Normal file
View file

@ -0,0 +1,46 @@
name: "\U0001F4AC Feedback"
description: Share your feedback about the app
labels: ["feedback"]
body:
- type: markdown
attributes:
value: |
- Before creating an issue, please search the existing issues to see if a similar one has already been created.
- You can search issues by specific labels (e.g. `label:nearby`) or just by typing keywords into the search filter.
- type: textarea
attributes:
label: Feedback
description: Share your feedback about the app.
validations:
required: true
- type: input
attributes:
label: Wiki username
placeholder: Jimbo Wales
validations:
required: false
- type: markdown
attributes:
value: |
# Device information
- type: input
attributes:
label: Device name
description: What make and model device did you encounter this on?
placeholder: Samsung J7
validations:
required: false
- type: input
attributes:
label: Android version
description: What Android version (e.g., Android 6.0 Marshmallow or Android 11) are you running? Is it the stock version from the manufacturer or a custom ROM ?
placeholder: Android 10
validations:
required: false
- type: input
attributes:
label: Commons app version
description: You can find this information by clicking the right-most menu in the bottom navigation bar in the app and tapping 'About'. If you are building from our codebase instead of downloading the app, please also mention the branch and build variant (e.g. `master` and `prodDebug`).
placeholder: 3.1.1
validations:
required: true

13
.github/ISSUE_TEMPLATE/need-help.yml vendored Normal file
View file

@ -0,0 +1,13 @@
name: "✋🏻 Need help"
description: Describe the situation which you need help with.
labels: ["help needed"]
body:
- type: markdown
attributes:
value: |
- Describe the situation which you need help with with as much information as possible.
- type: textarea
attributes:
label: Description
validations:
required: true

View file

@ -1,6 +1,6 @@
**Description (required)**
Fixes #{GitHub issue number} {Github issue title}
Fixes #INSERT_ISSUE_NUMBER_HERE
What changes did you make and why?
@ -8,7 +8,7 @@ What changes did you make and why?
Tested {build variant, e.g. ProdDebug} on {name of device or emulator} with API level {API level}.
**Screenshots showing what changed (optional - for UI changes)**
**Screenshots (for UI changes only)**
Need help? See https://support.google.com/android/answer/9075928

114
.github/workflows/android.yml vendored Normal file
View file

@ -0,0 +1,114 @@
name: Android CI
on: [push, pull_request, workflow_dispatch]
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Run tests and generate APK
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Cache packages
id: cache-packages
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: gradle-packages-${{ runner.os }}-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}
restore-keys: gradle-packages-${{ runner.os }}
- name: Access test login credentials
run: |
echo "TEST_USER_NAME=${{ secrets.TEST_USER_NAME }}" >> local.properties
echo "TEST_USER_PASSWORD=${{ secrets.TEST_USER_PASSWORD }}" >> local.properties
- name: AVD cache
if: github.event_name != 'pull_request'
uses: actions/cache@v4
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-tablet-api-24
- name: Create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true' && github.event_name != 'pull_request'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 24
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
script: echo "Generated AVD snapshot for caching."
- name: Run Instrumentation tests
if: github.event_name != 'pull_request'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 24
force-avd-creation: false
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: true
profile: Nexus 10
script: |
adb shell content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0
adb shell content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:0
adb emu geo fix 37.422131 -122.084801
./gradlew connectedBetaDebugAndroidTest --stacktrace
- name: Run Unit tests with unified coverage
if: github.event_name != 'pull_request'
run: ./gradlew -Pcoverage testBetaDebugUnitTestUnifiedCoverage --stacktrace
- name: Run Unit tests without unified coverage
if: github.event_name == 'pull_request'
run: ./gradlew -Pcoverage testBetaDebugUnitTestCoverage --stacktrace
- name: Upload Test Report to Codecov
if: github.event_name != 'pull_request'
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -f "app/build/reports/jacoco/testBetaDebugUnitTestUnifiedCoverage/testBetaDebugUnitTestUnifiedCoverage.xml" -Z
- name: Generate betaDebug APK
run: bash ./gradlew assembleBetaDebug --stacktrace
- name: Upload betaDebug APK
uses: actions/upload-artifact@v4
with:
name: betaDebugAPK
path: app/build/outputs/apk/beta/debug/app-*.apk
- name: Generate prodDebug APK
run: bash ./gradlew assembleProdDebug --stacktrace
- name: Upload prodDebug APK
uses: actions/upload-artifact@v4
with:
name: prodDebugAPK
path: app/build/outputs/apk/prod/debug/app-*.apk
- name: Create and PR number artifact
run: |
echo "{\"pr_number\": ${{ github.event.pull_request.number || 'null' }}}" > pr_number.json
- name: Upload PR number artifact
uses: actions/upload-artifact@v4
with:
name: pr_number
path: ./pr_number.json

41
.github/workflows/build-beta.yml vendored Normal file
View file

@ -0,0 +1,41 @@
name: Build beta only
on: [workflow_dispatch]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Access test login credentials
run: |
echo "TEST_USER_NAME=${{ secrets.TEST_USER_NAME }}" >> local.properties
echo "TEST_USER_PASSWORD=${{ secrets.TEST_USER_PASSWORD }}" >> local.properties
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Set env
run: echo "COMMIT_SHA=$(git log -n 1 --format='%h')" >> $GITHUB_ENV
- name: Generate betaDebug APK
run: ./gradlew assembleBetaDebug --stacktrace
- name: Rename betaDebug APK
run: mv app/build/outputs/apk/beta/debug/app-*.apk app/build/outputs/apk/beta/debug/apps-android-commons-betaDebug-$COMMIT_SHA.apk
- name: Upload betaDebug APK
uses: actions/upload-artifact@v4
with:
name: apps-android-commons-betaDebugAPK-${{ env.COMMIT_SHA }}
path: app/build/outputs/apk/beta/debug/*.apk
retention-days: 30

View file

@ -0,0 +1,96 @@
name: Comment Artifacts on PR
on:
workflow_run:
workflows: [ "Android CI" ]
types: [ completed ]
permissions:
pull-requests: write
contents: read
concurrency:
group: comment-${{ github.event.workflow_run.id }}
cancel-in-progress: true
jobs:
comment:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request' }}
steps:
- name: Download and process artifacts
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
const runId = context.payload.workflow_run.id;
const allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: runId,
});
const prNumberArtifact = allArtifacts.data.artifacts.find(artifact => artifact.name === "pr_number");
if (!prNumberArtifact) {
console.log("pr_number artifact not found.");
return;
}
const download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: prNumberArtifact.id,
archive_format: 'zip',
});
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/pr_number.zip`, Buffer.from(download.data));
const { execSync } = require('child_process');
execSync('unzip -q pr_number.zip -d ./pr_number/');
fs.unlinkSync('pr_number.zip');
const prData = JSON.parse(fs.readFileSync('./pr_number/pr_number.json', 'utf8'));
const prNumber = prData.pr_number;
if (!prNumber || prNumber === 'null') {
console.log("No valid PR number found in pr_number.json. Skipping.");
return;
}
const artifactsToLink = allArtifacts.data.artifacts.filter(artifact => artifact.name !== "pr_number");
if (artifactsToLink.length === 0) {
console.log("No artifacts to link found.");
return;
}
const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: Number(prNumber),
});
const oldComments = comments.data.filter(comment =>
comment.body.startsWith("✅ Generated APK variants!")
);
for (const comment of oldComments) {
await github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: comment.id,
});
console.log(`Deleted old comment ID: ${comment.id}`);
};
const commentBody = `✅ Generated APK variants!\n` +
artifactsToLink.map(artifact => {
const artifactUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${runId}/artifacts/${artifact.id}`;
return `- 🤖 [Download ${artifact.name}](${artifactUrl})`;
}).join('\n');
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: Number(prNumber),
body: commentBody
});

14
.gitignore vendored
View file

@ -1,10 +1,14 @@
# IDEA files
*.iml
*.iws
*.ipr
.idea
*.iws
/.idea/*
app/src/main/gen/*
# IDEA/Android Studio Ignore exceptions
!/.idea/codeStyles/
!/.idea/inspectionProfiles/
# Gradle
.gradle
local.properties
@ -38,3 +42,9 @@ app/src/main/jniLibs
#Below removes all the HTML files related to OpenCV documentation. The documentation can be otherwise found at:
#https://docs.opencv.org/3.3.0/
/libraries/opencv/javadoc/
captures/*
# Test and other output
app/jacoco.exec
app/CommonsContributions
app/.*

323
.idea/codeStyles/Project.xml generated Normal file
View file

@ -0,0 +1,323 @@
<component name="ProjectCodeStyleConfiguration">
<code_scheme name="Project" version="173">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</value>
</option>
<JSCodeStyleSettings>
<option name="INDENT_CHAINED_CALLS" value="false" />
</JSCodeStyleSettings>
<JavaCodeStyleSettings>
<option name="INSERT_INNER_CLASS_IMPORTS" value="true" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="" withSubpackages="true" static="false" module="true" />
<package name="" withSubpackages="true" static="true" />
<emptyLine />
<package name="" withSubpackages="true" static="false" />
</value>
</option>
</JavaCodeStyleSettings>
<JetCodeStyleSettings>
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</JetCodeStyleSettings>
<Objective-C>
<option name="INDENT_NAMESPACE_MEMBERS" value="0" />
<option name="INDENT_C_STRUCT_MEMBERS" value="2" />
<option name="INDENT_CLASS_MEMBERS" value="2" />
<option name="INDENT_VISIBILITY_KEYWORDS" value="1" />
<option name="INDENT_INSIDE_CODE_BLOCK" value="2" />
<option name="KEEP_STRUCTURES_IN_ONE_LINE" value="true" />
<option name="FUNCTION_PARAMETERS_WRAP" value="5" />
<option name="FUNCTION_CALL_ARGUMENTS_WRAP" value="5" />
<option name="TEMPLATE_CALL_ARGUMENTS_WRAP" value="5" />
<option name="TEMPLATE_CALL_ARGUMENTS_ALIGN_MULTILINE" value="true" />
<option name="ALIGN_INIT_LIST_IN_COLUMNS" value="false" />
<option name="SPACE_BEFORE_SUPERCLASS_COLON" value="false" />
</Objective-C>
<Python>
<option name="USE_CONTINUATION_INDENT_FOR_ARGUMENTS" value="true" />
</Python>
<TypeScriptCodeStyleSettings>
<option name="INDENT_CHAINED_CALLS" value="false" />
</TypeScriptCodeStyleSettings>
<files>
<extensions>
<pair source="cc" header="h" fileNamingConvention="NONE" />
<pair source="c" header="h" fileNamingConvention="NONE" />
</extensions>
</files>
<codeStyleSettings language="CSS">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="ECMA Script Level 4">
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_FOR" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="HTML">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_RESOURCES" value="false" />
<option name="ALIGN_MULTILINE_FOR" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="WRAP_COMMENTS" value="true" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JSON">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="RIGHT_MARGIN" value="80" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_FOR" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="ObjectiveC">
<option name="RIGHT_MARGIN" value="80" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
<option name="BLANK_LINES_BEFORE_IMPORTS" value="0" />
<option name="BLANK_LINES_AFTER_IMPORTS" value="0" />
<option name="BLANK_LINES_AROUND_CLASS" value="0" />
<option name="BLANK_LINES_AROUND_METHOD" value="0" />
<option name="BLANK_LINES_AROUND_METHOD_IN_INTERFACE" value="0" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="false" />
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="PROTO">
<option name="RIGHT_MARGIN" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Python">
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="RIGHT_MARGIN" value="80" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="SASS">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="SCSS">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>name</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>ANDROID_ATTRIBUTE_ORDER</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
<codeStyleSettings language="kotlin">
<option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
</codeStyleSettings>
<codeStyleSettings language="protobuf">
<option name="RIGHT_MARGIN" value="80" />
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
</component>

5
.idea/codeStyles/codeStyleConfig.xml generated Normal file
View file

@ -0,0 +1,5 @@
<component name="ProjectCodeStyleConfiguration">
<state>
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
</state>
</component>

View file

@ -0,0 +1,90 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="ClassWithOnlyPrivateConstructors" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="ComposePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="ComposePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="ConfusingElse" enabled="true" level="WARNING" enabled_by_default="true">
<option name="reportWhenNoStatementFollow" value="true" />
</inspection_tool>
<inspection_tool class="ControlFlowStatementWithoutBraces" enabled="true" level="ERROR" enabled_by_default="true" />
<inspection_tool class="ExplicitThis" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="GlancePreviewDimensionRespectsLimit" enabled="true" level="WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewMustBeTopLevelFunction" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewNeedsComposableAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="GlancePreviewNotSupportedInUnitTestFiles" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="LocalCanBeFinal" enabled="true" level="WARNING" enabled_by_default="true">
<option name="REPORT_VARIABLES" value="true" />
<option name="REPORT_PARAMETERS" value="true" />
</inspection_tool>
<inspection_tool class="LongLine" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="MissingOverrideAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="ignoreObjectMethods" value="true" />
<option name="ignoreAnonymousClassMethods" value="false" />
</inspection_tool>
<inspection_tool class="NonFinalUtilityClass" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="OverlyStrongTypeCast" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoreInMatchingInstanceof" value="false" />
</inspection_tool>
<inspection_tool class="PreviewAnnotationInFunctionWithParameters" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewApiLevelMustBeValid" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewDeviceShouldUseNewSpec" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewFontScaleMustBeGreaterThanZero" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewMultipleParameterProviders" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewParameterProviderOnFirstParameter" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="PreviewPickerAnnotation" enabled="true" level="ERROR" enabled_by_default="true">
<option name="composableFile" value="true" />
</inspection_tool>
<inspection_tool class="ProblematicWhitespace" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="RedundantFieldInitialization" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="RedundantImplements" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoreSerializable" value="false" />
<option name="ignoreCloneable" value="false" />
</inspection_tool>
<inspection_tool class="SimplifiableEqualsExpression" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="TypeParameterExtendsFinalClass" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UnnecessarilyQualifiedStaticUsage" enabled="true" level="WARNING" enabled_by_default="true">
<option name="m_ignoreStaticFieldAccesses" value="false" />
<option name="m_ignoreStaticMethodCalls" value="false" />
<option name="m_ignoreStaticAccessFromStaticContext" value="false" />
</inspection_tool>
<inspection_tool class="UnnecessarilyQualifiedStaticallyImportedElement" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UnnecessaryConstantArrayCreationExpression" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UnnecessaryConstructor" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoreAnnotations" value="true" />
</inspection_tool>
<inspection_tool class="UnnecessaryQualifierForThis" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UnnecessarySuperConstructor" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="UnnecessaryThis" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>

5
.mailmap Normal file
View file

@ -0,0 +1,5 @@
# See: https://git-scm.com/docs/git-shortlog#_mapping_authors
#
Brooke Vibber <bvibber@wikimedia.org>
Brooke Vibber <bvibber@wikimedia.org> <brion@wikimedia.org>
Brooke Vibber <bvibber@wikimedia.org> <brion@pobox.com>

View file

@ -1,59 +0,0 @@
language: android
addons:
apt:
packages:
- w3m
env:
global:
- ANDROID_TARGET=android-22
- ANDROID_ABI=armeabi-v7a
- ADB_INSTALL_TIMEOUT=12
- secure: okdkna5DaH/2Fay9vI6Enrx7u9UwRm4/IJXvcaWJcvjF3JTsLQr0r+dlMT2X5E1GsNk4WcoGcfZJcVonULkaW4S96B43g3EyevWbLFWjii0cMUO00OshToKyboSvNUf+d5B6rghrbnxTIBNel2ZBFj8MXHdtz6Az20q8VywqPeBZupo7olyKKS1nYdvoo7ypNScVjDGEjEPonWplztYlSDT1w81Vww4kF9oiOPEzDOPw1lOiD8FTyKLXhK0WYlnc3cnyFjZwVMlKcomnFYPfe/J2zO6OP/XInxYSXRkZ6wiOC5gMPYAYanUAuzm91vsTBQMk6jMCglSM9Nl6dPusGgEqOyTwLVALlgvS3km9HNVsHuVJhU+bmJ6scFBWrAOhbsV2ioSEsQ8NgU0Zv1SC0wN9ZruF4ae03Re+k+eHgwA3taZXrT2pvkkSmfRex6oFZReypcPGFQYiHo31NsO39WPRYYxr4edYisVXw75x/BJyOcUULhG1YmwHYYeXOzbNp0Sf9ADtUDi0oip/BO2tkLxbE+z1GJSmC83fX2YpoK+IwDHNm+4w8OJAJBvdxA3Q4HrJBAbd8jnQYP+sBBaki8t5WuwJmfOucx0vgKJ7pzqRY/MOUVe/dACnjLgFDLuS7MMqr6xU/oMM6/rrt4209tL+GQbn/R98UKtmMRRq1hY=
jdk:
- oraclejdk8
android:
components:
- tools
- platform-tools
- build-tools-28.0.3
- extra-google-m2repository
- extra-android-m2repository
- android-22
- android-28
licenses:
- android-sdk-license-.+
script:
- "./gradlew -Pcoverage clean check jacocoTestReport"
- if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
mkdir -p app/src/prodRelease/play/release-notes/en-US;
fi
- if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
git log --pretty=format:"%s" HEAD^..HEAD > app/src/prodRelease/play/release-notes/en-US/default.txt;
fi
- if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
./gradlew publishProdReleaseApk;
fi
after_success:
- bash <(curl -s https://codecov.io/bash)
after_failure:
- echo '*** Debug Unit Test Results ***'
- w3m -dump ${TRAVIS_BUILD_DIR}/app/build/reports/tests/*/classes/*Test.html
- echo '*** Connected Test Results ***'
- w3m -dump ${TRAVIS_BUILD_DIR}/app/build/reports/androidTests/connected/flavors/*/*Test.html
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
- "$HOME/.gradle/caches/"
- "$HOME/.gradle/wrapper/"
before_install:
- if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
openssl aes-256-cbc -K $encrypted_7b5c925cc32c_key -iv $encrypted_7b5c925cc32c_iv -in nr-commons.keystore.enc -out nr-commons.keystore -d;
fi
- if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
openssl aes-256-cbc -K $encrypted_38ac1a5053f6_key -iv $encrypted_38ac1a5053f6_iv -in play.p12.enc -out play.p12 -d;
fi
notifications:
webhooks:
- https://wiki-commons.zulipchat.com/api/v1/external/travis?api_key=kn4a8YKNqHCBYp7EW2k463txMj35vReq&stream=travis-ci

View file

@ -1,5 +1,390 @@
# Wikimedia Commons for Android
## v6.0.2
### What's changed
* Addressed a bug that prevented the keyboard from appearing in various text fields, such as on the upload wizard
* Links in the "File usages" list are now clickable and will take you to the correct page.
* Titles for file usages are now clearer and easier to understand
* Bug fixes and stability improvements
## v6.0.1
### What's changed
* The app now supports Android 15 with an improved user interface
* Enhanced Nearby with robust and more reliable labels
* Bug fixes and stability improvements
## v5.6.1
### What's changed
* The app no longer uploads images to Wikidata if one exists already for a given item
* File usage displays correctly now
* No more infinite circular progress bar on nominating an image for deletion
* Enhanced location updates while using GPS
* Author/uploader names are now available in Media Details for Commons licensing compliance
* Improved usage of popups in Nearby
* Bug fixes and stability improvements
## v5.5.0
### What's changed
* Explore images will now be shown based on the map location and not at your current location
* Enhanced Wikidata feedback message
* Green labels in Explore map will no longer be hidden by other pins thumbnails
* Upload wizard's language drop-down now reflects the language used in the pin label
* Users can now pick only one image at a time while using the custom selector
* Bug fixes and stability improvements
## v5.4.1
### What's changed
* Custom picker now detects images that are already available on Commons
* Improve credit line in image list
* Show place cards with loaded names only in the Nearby list
* Fix the error that occurs while loading images in Explore
## v5.3.0
### What's changed
* Enable EmailAuth support
* Explore map images no longer show "Unknown"
* Fix crash when removing last two images of multiupload
* Mark ❌ for closed locations (P3999) in Nearby
* Fix two pin labels staying visible at the same time in Explore map
* Refactoring and minor UI improvements
## v5.2.0
v5.2.0 boasts several new functionalities like:
* A new refresh button lets you quickly reload the Nearby map
* Bookmarks now support categories
* Improved feedback and consistency in the user interface
* Bug fixes and performance improvements
### What's changed
* Implement "Refresh" button to clear the cache and reload the Nearby map.
* `CommonsApplication` migrate to kotlin & some lint fixes.
* Revert back to MainScope for database and UI updates and make database operations thread safe.
* Hide edit options for logged-out users in Explore screen.
* Introduced a button to delete the current folder in custom selector.
* Improve Unique File Name Search.
* Migration of several modules from Java to Kotlin.
* Fix modification on bottom sheet's data when coming from Nearby Banner and clicked on other pins.
* Bug fixes and enhancement of Achievements screen.
* Show where file is being used on Commons and other wikis.
* Migrate android.media.ExifInterface to androidx.exifinterface.media.ExifInterface as android.media.ExifInterface had security flaws on older devices.
* Make dialogs modal and always show the upload icon.
* Fix unintentional deletion of subfolders and non-images by custom selector.
* Bookmark categories.
* Add pull down to refresh in the Contributions screen.
* Fix race condition and lag when loading pin details, faster overlay management.
* Show cached pins in Nearby even when internet is unavailable
Full changelog with the list of contributors: [`v5.1.2...v5.2.0`](https://github.com/commons-app/apps-android-commons/compare/v5.1.2...v5.2.0).
## v5.1.2
### What's changed
* Fix the broken category search in the explore screen
## v5.1.1
### What's changed
* Use Android's new EXIF interface to mitigate security issues in old
EXIF interface.
* Make the icon that helps view the upload queue always visible as it ensures
that the queue accessible at all times.
## v5.1.0
### What's Changed
* Enhanced **upload queue management** in the Commons app for smoother, sequential
processing, clearer progress tracking, prevention of stuck or duplicate
uploads. As part of this improvement, the "Limited Connection mode" has been
removed.
* Added an option in "Nearby" feature enabling users to **provide feedback on
Wikidata items**. Users can report if an item doesnt exist, is at a different
location, or has other issues, with submissions tagged for easy tracking and
updates.
* Improved the "Nearby" feature by splitting the query into two parts for faster
loading and **better performance, especially in areas with dense amount of
places**. This update also resolves issues with pins overlapping place names.
* Upgraded AGP and **target/compile SDK to 34** and make necessary adjustments to
the app such as adding **"Partial Access" support**. Also includes some minor
refactoring, and replacement of deprecated circular progress bars.
* Fixed an **UI issue where the 'Subcategories' and 'Parent Categories' tabs
appeared blank** in the Category Details screen. Resolved by optimizing view
binding handling in the parent fragments.
* Fixed an issue where editing depictions removed all other structured data from
images. Now, **only depictions are updated, preserving other associated data**.
* Fixed **map centering** in the image upload flow to **use GPS EXIF tag location**
from pictures and ensured "Show in map app" accurately reflects this location.
* Fixed navigation **after uploading via Nearby by directing users to the Uploads
activity** instead of returning to Nearby, preventing confusion about needing to
upload again.
### Bug fixes and various changes
* Improved the "Nearby" feature to fetch labels based on the user's preferred
language instead of defaulting to English.
* Added a legend to the "Nearby" feature indicating pin statuses: red for items
without pictures, green for those with pictures, and grey for items being
checked. A floating action button now allows users to toggle the legend's
visibility.
* Fixed an issue where the "Nominate for deletion" option is shown to logged out
users, preventing app errors and crashes.
* Updated the regex pattern that filters categories with an year in it to also
filter the 2020s.
* Fix an issue where past depictions were not shown as suggestions, despite
being saved correctly.
* Fixed an issue in custom image picker where exiting the media preview showed
only the first image and cleared selections. Now, previously selected images
are restored correctly after exiting the preview. This was contributed.
* Fixed an issue in custom image picker where scrolling behavior did not
maintain position after exiting fullscreen preview, ensuring users remain at
the same point in their image roll unless actioned images are filtered. This
was contributed.
* Fixed Nearby map not showing new pins on map move by removing the 2000m scroll
threshold and adding an 800ms debounce for smoother pin updates when the map
is moved. Queued searches are now canceled on fragment destruction.
* Revised author information retrieval to emphasize the custom author name from
the metadata instead of the default registered username.
* Enhanced notification classification to properly identify "email" type
notifications and prompting users to check their e-mail inbox when such
notifications are clicked.
* Resolved a bug in the language chooser that incorrectly greyed-out previously
selected languages, ensuring only the current language is non-selectable during
image upload.
* Resolved pin color update issue in "Nearby" feature where the pin colour
failed to be updated after a successful image upload.
What's listed here is only a subset of all the changes. Check the full-list of
the changes in [this link](https://github.com/commons-app/apps-android-commons/compare/v5.0.2...v5.1.0).
Alternatively, checkout [this release on GitHub releases page](https://github.com/commons-app/apps-android-commons/releases/tag/v5.1.0)
for an exhaustive list of changes and the various contributors who contributed the same.
## v5.0.2
- Enhanced multi-upload functionality with user prompts to clarify that all images would share the
same category and depictions.
- Show Wikidata description on currently active Nearby pin to provide more useful information.
- Improve the visibility of map markers by dynamically adjusting their colors based on the app's
theme. The map markers will now appear lighter when the app is in dark mode and darker when the
app is in light mode. This change aims to enhance marker visibility and improve the overall user
experience.
- Added information on where user feedback is posted, helping users track existing feedback and
monitor their own submissions.
- Enhanced the edit location screen of the upload screen by centering the map on the picture's
location from metadata when editing, or on the device's GPS location if metadata is unavailable,
improving accuracy and user experience.
- Ensured the 'Add Location' button is renamed to 'Edit Location' when copying the location of a
recently uploaded image, enhancing clarity and user experience.
- Added a ProgressBar to the media detail screen to indicate image loading status, enhancing user
experience by showing loading progress until the image is fully loaded.
- Fixed an issue where caption and description fields would intermittently disappear when using
voice input, ensuring text remains visible and stable across all entries.
- Fixed a crash that occurred when attempting to remove multiple instances of caption/description
fields after initially adding them.
- Improve the text in the prompt shown when skipping login to sound more natural.
- Modified feedback addition logic to append new sections at the bottom of the page, ensuring
auto-archiving of sections functions correctly on the feedback page.
- Resolved issue where the app failed to clear cookies upon logout.
## v5.0.1
Same as v5.0.0 except this fixes some R8 rules to ensure that the release
variants of the app work as intended.
## v5.0.0
### What's Changed
- Redesigned the map feature to **replace Mapbox with the osmdroid library**.
Key elements like pin visualization and user-centered display are still
included in this redesign. This is done to guard against possible misuse of
the Mapbox token and, more crucially, to keep the app from becoming dependent
on a service that charges for usage but offers a free tier.
With this change, the app retrieves the map tiles from [Wikimedia maps](https://maps.wikimedia.org).
- Add the ability to **export locations of nearby missing pictures in GPX and
KML formats**. This allows users to browse the locations with desired radius
for offline use in their favourite map apps like OsmAnd or Maps.me, enhancing
accessibility and offline functionality.
- **Limited the uploads via the custom image picker** to a maximum of 20.
- Added two menu choices for **transparent image backgrounds**, giving users the
option of either a black or white background, increasing adaptability to
various theme settings.
User customization option has been provided with the
ability to save background color selections permanently on a per image basis.
- Implemented functionality to **automatically resume uploads** that become
stuck due to app termination or device reboot.
- Added a **compass arrow in the Nearby banner** shown in the "Contributions"
screen to guide users towards the nearest item, thus providing the missing
directional cues. The arrow dynamically adjusts based on device rotation,
aligning with the calculated bearing towards the target location. Further,
the distance and direction are updated as the user moves.
- Implemented **voice input feature** for caption and description fields,
enabling users to dictate text directly into these fields.
- Improved various flows in the app to **redirect users to the login page** and
display a persistent message **if their session becomes invalid** due to a
password change, enhancing user guidance and security measures.
### Revamps and refactorings
- **Revamped initial upload screen layout and the description edit screen layout**
for enhanced user experience and ensuring better symmetry in the design.
- **Replaced Butterknife with ViewBinding** in various places of the app.
- Transferred essential code from **the redundant data-client module** to the
main Commons app code, enabling its integration and facilitating the removal
of the redundant module. Further, convert various parts of the code to Kotlin.
- **Revamped the various location permission flows** to ensure consistency for
the sake of a better user experience.
### Bug fixes and various changes
- Resolved an issue where paused uploads that were subsequently cancelled were
still being uploaded.
- Fixed an issue where some user information such as upload count were not
displayed in the "Contributions" and "Profile" screens.
- Fixed the long-standing broken *"Picture of the Day" widget* to restore its
usability.
- Resolved an issue where some categories were hidden at the top of Upload
Wizard suggestions.
- Resolved an issue where there was a grey empty screen at Upload wizard when
the app was denied the files permission.
- Implemented logic to bypass media in Peer Review if the current reviewer is
also the user who uploaded the media.
- Corrected arrow image behaviour in the first upload screen: now displays down
arrow when details card is fully visible, aligning with expected user
interaction.
- Updated app icon to improve visibility and recognition on F-Droid.
- Fixed issue causing all pictures to disappear and activity to reload fully in
the custom image selector after marking a picture as 'not for upload', now
ensuring only the selected picture is removed as expected.
What's listed here is only a subset of all the changes. Check the full-list of
the changes in [this link](https://github.com/commons-app/apps-android-commons/compare/v4.2.1...v5.0.0).
Alternatively, checkout [this release on GitHub releases page](https://github.com/commons-app/apps-android-commons/releases/tag/v5.0.0)
for an exhaustive list of changes and the various contributors who contributed the same.
## v4.2.1
- Provide the ability to edit an image to losslessly rotate it while uploading
- Fix a bug in v4.2.0 where the nearby places were not loading
- Fix a bug where editing depictions was showing a progress bar indefinitely
- In the upload screen, use different map icons to indicate if image is being uploaded with location
metadata
- For nearby uploads, it is no longer possible to deselect the item's category and depiction
- The Mapbox account key used by the app has been changed
- Category search now shows exact matches without any discrepancies
- Various bug and crash fixes
## v4.2.0
- Dark mode colour improvements
- Enhancements done to address location metadata loss including the metadata loss that occurs in
latest Android versions
- Enhancements done to address the issue where uploads get stuck in queued state
- Fix the inability to upload via the in-app camera option
- Provide the ability to optionally include location metadata for in-app camera uploads in case the
device camera app does not provide location metadata
- Use geo location URL that works consistently across all map applications
- Fix crash when clicking on location target icon while trying to edit the location of an upload
- Fix crash that occurs randomly while returning to the app after leaving it in the background
- Fix crash in Sign up activity on Android version 5.0 and 5.1
- Android 13 compatibility changes
## v4.1.0
- Location of pictures uploaded via custom picture selector are now recognized
- Improvements to the custom picture selector
- Ensure the WLM pictures are associated with the correct templates for each year
- Only show pictures uploaded via app in peer review
- Improve the variety of images show in peer review
- Allow going to current location in location edit dialog while uploading a picture
- Switch to using MapLibre instead of Mapbox and thereby disable telemetry sent to Mapbox
- Fixed various bugs
## v4.0.5
- Bumped min SDK to 29 to try and solve Google policy issue
- Reverted dialog
- Note: This encompasses versions 1031, 1032, and 1033, due to the Play Store's requirements to overwrite all the tracks with a post-fix version (otherwise no single track can be published)
## v4.0.4
- Added dialog for Google's location policy
## v4.0.3
- Added "Report" button for Google UGC policy
## v4.0.2
- Fixed bug with wrong dates taken from EXIF
- Fixed various crashes
## v4.0.1
- Fixed bug with no browser found
- Updated Mapbox SDK to fix hamburger crash
## v4.0.0
- Added map showing nearby Commons pictures
- Added custom SPARQL queries
- Added user profiles
- Added custom picture selector
- Various bugfixes
- Updated target SDK to 30
## v3.1.1
- Optimized Nearby query
- Added Sweden's property for WLM 2021
- Added link to wiki explaining how to contribute to WLM through app
- Fixed various bugs and crashes
## v3.1.0
- Added Wiki Loves Monuments integration for WLM 2021
## v3.0.2
- Fixed crash when uploading high res image
- Fixed crash when viewing images in Explore
## v3.0.1
- Pre-fill desc in Nearby uploads with Wikidata item's label + description
- Improved ACRA crash reporting
- Fixed various crashes
## v3.0.0
- Added Structured Data to upload workflow, users can now add depicts
- Added Leaderboard in Achievements screen
- Added to-do system for images with no categories/descriptions or with associated Wikipedia articles that have no pictures
- Users can now modify and add categories to their uploads from the media details view
- New UI for main screen
- Limited connection mode added, users can now pause and resume uploads
## v2.13.1
- Added OpenStreetMap attribution
- Fixed various crashes
- Fixed SQLite error in Nearby map
- Fixed issue with Nearby uploads not being associated with Wikidata p18
## v2.13.0
- New media details UI, ability to zoom and pan around image
- Added suggestions for a place that needs photos if user uploads a photo that is near one of them
- Modifications and fixes to Nearby filters based on user feedback
- Multiple crash and bug fixes
## v2.12.3
- Fixed issue with EXIF data, including coords, being removed from uploads
## v2.12.2
- Fixed crash on startup
## v2.12.1
- Fixed issue with Nearby loading in wrong location
- Various crash fixes
## v2.12.0
- Completed codebase overhaul
- Added filters for place type and place state to Nearby

View file

@ -7,7 +7,7 @@ Here's a gist of the guidelines,
1. Make separate commits for logically separate changes
1. Describe your changes well in the commit message
2. Describe your changes well in the commit message
The first line of the commit message should be a short description of what has
changed. It is also good to prefix the first line with "area: " where the "area"
@ -29,9 +29,9 @@ The body should provide a meaningful commit message.
and if needed, Git allows us to see who wrote something without needing
to add these tags (`git blame`)
1. Write tests for your code (if possible)
2. Write tests for your code (if possible)
1. Make sure the Wiki pages don't become stale by updating them (if needed)
3. Make sure the Wiki pages don't become stale by updating them (if needed)
### Further reading

View file

@ -47,12 +47,12 @@ their contribution to the product.
* Alicia Bendz
* Kaartic Sivaraam
* Vanshika Arora
* Seán Mac Gillicuddy
3rd party open source libraries used:
* Butterknife
* GSON
* Timber
* MapBox
3rd party open source apps from which significant code has been reused:
* Android Wikipedia app https://github.com/wikimedia/apps-android-wikipedia

View file

@ -1,36 +0,0 @@
**Summary:**
Summarize your issue in one sentence (what goes wrong, what did you expect to happen)
_Before creating an issue, please search the existing issues to see if a similar one has already been created. You can search issues by specific labels (e.g. `label:nearby`) or just by typing keywords into the search filter._
**Steps to reproduce:**
How can we reproduce the issue?
What did you expect the app to do, and what did you see instead?
**System logs:**
```
Add logcat files here (if possible).
Need help? See https://github.com/commons-app/apps-android-commons/wiki/Getting-app-logs-from-Android-Studio
```
**Device and Android version:**
What make and model device (e.g., Samsung J7) did you encounter this on?
What Android version (e.g., Android 4.0 Ice Cream Sandwich or Android 6.0 Marshmallow) are you running?
Is it the stock version from the manufacturer or a custom ROM ?
**Commons app version:**
You can find this information by going to the navigation drawer in the app and tapping 'About'. If you are building from our codebase instead of downloading the app, please also mention the branch and build variant (e.g. master and prodDebug).
**Screen-shots:**
Can be created by pressing the Volume Down and Power Button at the same time on Android 4.0 and higher.
**Would you like to work on the issue?**
Please let us know whether you want to fix the issue by yourself. If not, anyone can get the issue assigned to them.

View file

@ -1,19 +1,21 @@
# Wikimedia Commons Android app
[![Build status](https://api.travis-ci.org/commons-app/apps-android-commons.svg?branch=master)](https://travis-ci.org/commons-app/apps-android-commons)
![GitHub issue custom search](https://img.shields.io/github/issues-search?label=%22good%20first%20issue%22%20issues&query=repo%3Acommons-app%2Fapps-android-commons%20is%3Aissue%20is%3Aopen%20label%3A%22good%20first%20issue%22)
[![Build status](https://github.com/commons-app/apps-android-commons/actions/workflows/android.yml/badge.svg?branch=main)](https://github.com/commons-app/apps-android-commons/actions?query=branch%3Amain)
[![Preview the app](https://img.shields.io/badge/Preview-Appetize.io-orange.svg)](https://appetize.io/app/8ywtpe9f8tb8h6bey11c92vkcw)
[![codecov](https://codecov.io/gh/commons-app/apps-android-commons/branch/master/graph/badge.svg)](https://codecov.io/gh/commons-app/apps-android-commons)
The Wikimedia Commons Android app allows users to upload pictures from their Android phone/tablet to Wikimedia Commons. Download the app [here][1], or view our [website][2].
Initially started by the Wikimedia Foundation, this app is now maintained by grantees and volunteers of the Wikimedia community. Anyone is welcome to improve it, just choose among the [open issues][3] and send us a pull request :-)
Initially started by the Wikimedia Foundation, this app is now maintained by grantees and volunteers of the Wikimedia community. Anyone is welcome to improve it, just choose among the [open issues][3] and send us a pull request! :-)
<a href="https://f-droid.org/repository/browse/?fdid=fr.free.nrw.commons" target="_blank">
<img src="https://upload.wikimedia.org/wikipedia/commons/9/96/%22Get_it_on_F-droid%22_Badge.png" alt="Get it on F-Droid" height="90"/></a>
<img src="https://upload.wikimedia.org/wikipedia/commons/archive/9/96/20200131184248%21%22Get_it_on_F-droid%22_Badge.png" alt="Get it on F-Droid" height="90"/></a>
<a href="https://play.google.com/store/apps/details?id=fr.free.nrw.commons" target="_blank">
<img src="https://play.google.com/intl/en_us/badges/images/generic/en-play-badge.png" alt="Get it on Google Play" height="90"/></a>
## Documentation
We try to have an extensive documentation at [our wiki here at Github][4]:
Our [documentation repository][4] contains extensive documentation for users, contributors, and developers alike:
* [User Documentation][5]
* [Contributor Documentation][6]
@ -25,13 +27,14 @@ We try to have an extensive documentation at [our wiki here at Github][4]:
Thank you all for your work!
| [<img src="https://avatars1.githubusercontent.com/u/3611199?v=4" width="100px;"/><br /><sub><b>misaochan</b></sub>](https://github.com/misaochan) | [<img src="https://avatars2.githubusercontent.com/u/30430?v=4" width="100px;"/><br /><sub><b>yuvipanda</b></sub>](https://github.com/yuvipanda) | [<img src="https://avatars1.githubusercontent.com/u/3127881?v=4" width="100px;"/><br /><sub><b>neslihanturan</b></sub>](https://github.com/neslihanturan) | [<img src="https://avatars2.githubusercontent.com/u/3069373?v=4" width="100px;"/><br /><sub><b>maskaravivek</b></sub>](https://github.com/maskaravivek) | [<img src="https://avatars3.githubusercontent.com/u/24829418?v=4" width="100px;"/><br /><sub><b>translatewiki</b></sub>](https://github.com/translatewiki) |
| [<img src="https://avatars.githubusercontent.com/u/3611199?v=4" width="100px;"/><br /><sub><b>misaochan</b></sub>](https://github.com/misaochan) | [<img src="https://avatars.githubusercontent.com/u/24829418?v=4" width="100px;"/><br /><sub><b>translatewiki</b></sub>](https://github.com/translatewiki) | [<img src="https://avatars.githubusercontent.com/u/3127881?v=4" width="100px;"/><br /><sub><b>neslihanturan</b></sub>](https://github.com/neslihanturan) | [<img src="https://avatars.githubusercontent.com/u/30430?v=4" width="100px;"/><br /><sub><b>yuvipanda</b></sub>](https://github.com/yuvipanda) | [<img src="https://avatars.githubusercontent.com/u/99590?v=4" width="100px;"/><br /><sub><b>nicolas-raoul</b></sub>](https://github.com/nicolas-raoul) |
| :---: | :---: | :---: | :---: | :---: |
| [<img src="https://avatars1.githubusercontent.com/u/99590?v=4" width="100px;"/><br /><sub><b>nicolas-raoul</b></sub>](https://github.com/nicolas-raoul) | [<img src="https://avatars0.githubusercontent.com/u/407647?v=4" width="100px;"/><br /><sub><b>psh</b></sub>](https://github.com/psh) | [<img src="https://avatars2.githubusercontent.com/u/103075?v=4" width="100px;"/><br /><sub><b>brion</b></sub>](https://github.com/brion) | [<img src="https://avatars3.githubusercontent.com/u/10674?v=4" width="100px;"/><br /><sub><b>whym</b></sub>](https://github.com/whym) | [<img src="https://avatars0.githubusercontent.com/u/4953590?v=4" width="100px;"/><br /><sub><b>domdomegg</b></sub>](https://github.com/domdomegg) |
| [<img src="https://avatars2.githubusercontent.com/u/10153800?v=4" width="100px;"/><br /><sub><b>akaita</b></sub>](https://github.com/akaita) | [<img src="https://avatars0.githubusercontent.com/u/6900601?v=4" width="100px;"/><br /><sub><b>veyndan</b></sub>](https://github.com/veyndan) | [<img src="https://avatars0.githubusercontent.com/u/19607555?v=4" width="100px;"/><br /><sub><b>ujjwalagrawal17</b></sub>](https://github.com/ujjwalagrawal17) | [<img src="https://avatars1.githubusercontent.com/u/1682214?v=4" width="100px;"/><br /><sub><b>dbrant</b></sub>](https://github.com/dbrant) | [<img src="https://avatars3.githubusercontent.com/u/1345681?v=4" width="100px;"/><br /><sub><b>sandarumk</b></sub>](https://github.com/sandarumk) |
| [<img src="https://avatars0.githubusercontent.com/u/6953323?v=4" width="100px;"/><br /><sub><b>tobias47n9e</b></sub>](https://github.com/tobias47n9e) | [<img src="https://avatars0.githubusercontent.com/u/29161745?v=4" width="100px;"/><br /><sub><b>tanvidadu</b></sub>](https://github.com/tanvidadu) | [<img src="https://avatars1.githubusercontent.com/u/25305892?v=4" width="100px;"/><br /><sub><b>hismaeel</b></sub>](https://github.com/hismaeel) | [<img src="https://avatars0.githubusercontent.com/u/12574756?v=4" width="100px;"/><br /><sub><b>tshradheya</b></sub>](https://github.com/tshradheya) | [<img src="https://avatars1.githubusercontent.com/u/27244688?v=4" width="100px;"/><br /><sub><b>diddypod</b></sub>](https://github.com/diddypod) |
| [<img src="https://avatars0.githubusercontent.com/u/32291277?v=4" width="100px;"/><br /><sub><b>prxjeen</b></sub>](https://github.com/prxjeen) | [<img src="https://avatars2.githubusercontent.com/u/3308769?v=4" width="100px;"/><br /><sub><b>addshore</b></sub>](https://github.com/addshore) | [<img src="https://avatars3.githubusercontent.com/u/20313518?v=4" width="100px;"/><br /><sub><b>knight-shade</b></sub>](https://github.com/knight-shade) | [<img src="https://avatars3.githubusercontent.com/u/17375274?v=4" width="100px;"/><br /><sub><b>ashishkumar468</b></sub>](https://github.com/ashishkumar468) | [<img src="https://avatars0.githubusercontent.com/u/210297?v=4" width="100px;"/><br /><sub><b>siebrand</b></sub>](https://github.com/siebrand) |
| [<img src="https://avatars0.githubusercontent.com/u/5329780?v=4" width="100px;"/><br /><sub><b>Bluesir9</b></sub>](https://github.com/Bluesir9) | [<img src="https://avatars1.githubusercontent.com/u/17095817?v=4" width="100px;"/><br /><sub><b>Jatin0312</b></sub>](https://github.com/Jatin0312) | [<img src="https://avatars3.githubusercontent.com/u/3415851?v=4" width="100px;"/><br /><sub><b>mashawan</b></sub>](https://github.com/mashawan) | [<img src="https://avatars3.githubusercontent.com/u/594179?v=4" width="100px;"/><br /><sub><b>ford-prefect</b></sub>](https://github.com/ford-prefect) | [<img src="https://avatars1.githubusercontent.com/u/21229885?v=4" width="100px;"/><br /><sub><b>seantnemann</b></sub>](https://github.com/seantnemann) |
| [<img src="https://avatars.githubusercontent.com/u/407647?v=4" width="100px;"/><br /><sub><b>psh</b></sub>](https://github.com/psh) | [<img src="https://avatars.githubusercontent.com/u/4953590?v=4" width="100px;"/><br /><sub><b>domdomegg</b></sub>](https://github.com/domdomegg) | [<img src="https://avatars.githubusercontent.com/u/3069373?v=4" width="100px;"/><br /><sub><b>maskaravivek</b></sub>](https://github.com/maskaravivek) | [<img src="https://avatars.githubusercontent.com/u/30932899?v=4" width="100px;"/><br /><sub><b>madhurgupta10</b></sub>](https://github.com/madhurgupta10) | [<img src="https://avatars.githubusercontent.com/u/17375274?v=4" width="100px;"/><br /><sub><b>ashishkumar468</b></sub>](https://github.com/ashishkumar468) |
| [<img src="https://avatars.githubusercontent.com/u/103075?v=4" width="100px;"/><br /><sub><b>bvibber</b></sub>](https://github.com/bvibber) | [<img src="https://avatars.githubusercontent.com/u/10674?v=4" width="100px;"/><br /><sub><b>whym</b></sub>](https://github.com/whym) | [<img src="https://avatars.githubusercontent.com/u/10153800?v=4" width="100px;"/><br /><sub><b>akaita</b></sub>](https://github.com/akaita) | [<img src="https://avatars.githubusercontent.com/u/12448084?v=4" width="100px;"/><br /><sub><b>sivaraam</b></sub>](https://github.com/sivaraam) | [<img src="https://avatars.githubusercontent.com/u/6900601?v=4" width="100px;"/><br /><sub><b>veyndan</b></sub>](https://github.com/veyndan) |
| [<img src="https://avatars.githubusercontent.com/u/19607555?v=4" width="100px;"/><br /><sub><b>ujjwalagrawal17</b></sub>](https://github.com/ujjwalagrawal17) | [<img src="https://avatars.githubusercontent.com/u/3358282?v=4" width="100px;"/><br /><sub><b>macgills</b></sub>](https://github.com/macgills) | [<img src="https://avatars.githubusercontent.com/u/346271?v=4" width="100px;"/><br /><sub><b>amire80</b></sub>](https://github.com/amire80) | [<img src="https://avatars.githubusercontent.com/u/1682214?v=4" width="100px;"/><br /><sub><b>dbrant</b></sub>](https://github.com/dbrant) | [<img src="https://avatars.githubusercontent.com/u/34261945?v=4" width="100px;"/><br /><sub><b>vanshikaarora</b></sub>](https://github.com/vanshikaarora) |
| [<img src="https://avatars.githubusercontent.com/u/83745993?v=4" width="100px;"/><br /><sub><b>RitikaPahwa4444</b></sub>](https://github.com/RitikaPahwa4444) | [<img src="https://avatars.githubusercontent.com/u/71203077?v=4" width="100px;"/><br /><sub><b>Ayan-10</b></sub>](https://github.com/Ayan-10) | [<img src="https://avatars.githubusercontent.com/u/101377978?v=4" width="100px;"/><br /><sub><b>rohit9625</b></sub>](https://github.com/rohit9625) | [<img src="https://avatars.githubusercontent.com/u/126143257?v=4" width="100px;"/><br /><sub><b>shashankiitbhu</b></sub>](https://github.com/shashankiitbhu) | [<img src="https://avatars.githubusercontent.com/u/54663429?v=4" width="100px;"/><br /><sub><b>Pratham2305</b></sub>](https://github.com/Pratham2305) |
| [<img src="https://avatars.githubusercontent.com/u/111801812?v=4" width="100px;"/><br /><sub><b>parneet-guraya</b></sub>](https://github.com/parneet-guraya) | [<img src="https://avatars.githubusercontent.com/u/1345681?v=4" width="100px;"/><br /><sub><b>sandarumk</b></sub>](https://github.com/sandarumk) | [<img src="https://avatars.githubusercontent.com/u/29161745?v=4" width="100px;"/><br /><sub><b>tanvidadu</b></sub>](https://github.com/tanvidadu) | [<img src="https://avatars.githubusercontent.com/u/39745544?v=4" width="100px;"/><br /><sub><b>cypherop</b></sub>](https://github.com/cypherop) | [<img src="https://avatars.githubusercontent.com/u/65972015?v=4" width="100px;"/><br /><sub><b>Prince-kushwaha</b></sub>](https://github.com/Prince-kushwaha) |
.. and [many more](https://github.com/commons-app/apps-android-commons/graphs/contributors).
@ -43,13 +46,13 @@ This software is open source, licensed under the [Apache License 2.0][10].
[1]: https://play.google.com/store/apps/details?id=fr.free.nrw.commons
[2]: https://commons-app.github.io/
[3]: https://github.com/commons-app/apps-android-commons/issues
[3]: https://github.com/commons-app/apps-android-commons/issues?q=is%3Aopen+is%3Aissue+no%3Aassignee+-label%3Adebated+label%3Abug+-label%3A%22low+priority%22+-label%3Aupstream
[4]: https://github.com/commons-app/apps-android-commons/wiki
[5]: https://github.com/commons-app/apps-android-commons/wiki#user-documentation
[6]: https://github.com/commons-app/apps-android-commons/wiki#contributor-documentation
[7]: https://github.com/commons-app/apps-android-commons/wiki/Volunteers-welcome%21
[8]: https://github.com/commons-app/apps-android-commons/wiki#developer-documentation
[9]: https://github.com/commons-app/apps-android-commons/wiki/Libraries-used
[4]: https://github.com/commons-app/commons-app-documentation/blob/master/android/README.md#-android-documentation
[5]: https://github.com/commons-app/commons-app-documentation/blob/master/android/README.md#-user-documentation
[6]: https://github.com/commons-app/commons-app-documentation/blob/master/android/README.md#-contributor-documentation
[7]: https://github.com/commons-app/commons-app-documentation/blob/master/android/Volunteers-welcome!.md#volunteers-welcome
[8]: https://github.com/commons-app/commons-app-documentation/blob/master/android/README.md#-developer-documentation
[9]: https://github.com/commons-app/commons-app-documentation/blob/master/android/Libraries-used.md#libraries-used
[10]: https://www.apache.org/licenses/LICENSE-2.0

View file

@ -1,272 +0,0 @@
plugins {
id 'com.github.triplet.play' version '2.2.1' apply false
}
apply from: '../gitutils.gradle'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'jacoco-android'
apply from: 'quality.gradle'
def isRunningOnTravisAndIsNotPRBuild = System.getenv("CI") == "true" && file('../play.p12').exists()
if(isRunningOnTravisAndIsNotPRBuild) {
apply plugin: 'com.github.triplet.play'
}
dependencies {
// Utils
implementation 'com.github.nicolas-raoul:Quadtree:ac16ea8035bf07'
implementation 'in.yuvi:http.fluent:1.3'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.okhttp3:okhttp:4.2.0'
implementation 'com.squareup.okio:okio:2.2.2'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.3'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
implementation 'com.jakewharton.rxbinding2:rxbinding-support-v4:2.1.1'
implementation 'com.jakewharton.rxbinding2:rxbinding-appcompat-v7:2.1.1'
implementation 'com.jakewharton.rxbinding2:rxbinding-design:2.1.1'
implementation 'com.facebook.fresco:fresco:1.13.0'
implementation 'org.apache.commons:commons-lang3:3.8.1'
implementation 'com.github.maskaravivek:wikimedia-android-data-client:v0.0.30'
// UI
implementation 'fr.avianey.com.viewpagerindicator:library:2.4.1.1@aar'
implementation 'com.github.chrisbanes:PhotoView:2.0.0'
implementation 'com.github.pedrovgs:renderers:3.3.3'
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:7.2.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-localization-v7:0.7.0'
implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0'
implementation 'com.dinuscxj:circleprogressbar:1.1.1'
implementation 'com.karumi:dexter:5.0.0'
implementation "com.jakewharton:butterknife:$BUTTERKNIFE_VERSION"
kapt "com.jakewharton:butterknife-compiler:$BUTTERKNIFE_VERSION"
// Logging
implementation 'ch.acra:acra-dialog:5.3.0'
implementation 'ch.acra:acra-mail:5.3.0'
implementation 'org.slf4j:slf4j-api:1.7.25'
api('com.github.tony19:logback-android-classic:1.1.1-6') {
exclude group: 'com.google.android', module: 'android'
}
implementation "com.squareup.okhttp3:logging-interceptor:4.2.0"
// Dependency injector
implementation "com.google.dagger:dagger-android-support:$DAGGER_VERSION"
kapt "com.google.dagger:dagger-android-processor:$DAGGER_VERSION"
kapt "com.google.dagger:dagger-compiler:$DAGGER_VERSION"
// Unit testing
testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$KOTLIN_VERSION"
testImplementation "org.jetbrains.kotlin:kotlin-reflect:$KOTLIN_VERSION"
testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:4.3'
testImplementation 'androidx.test:core:1.2.0'
testImplementation 'com.nhaarman:mockito-kotlin:1.5.0'
testImplementation 'com.squareup.okhttp3:mockwebserver:3.12.1'
testImplementation "org.powermock:powermock-module-junit4:2.0.0-beta.5"
testImplementation "org.powermock:powermock-api-mockito2:2.0.0-beta.5"
// Android testing
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$KOTLIN_VERSION"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-intents:3.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.annotation:annotation:1.1.0'
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:3.12.1'
androidTestImplementation 'org.mockito:mockito-core:2.13.0'
androidTestUtil 'androidx.test:orchestrator:1.2.0'
// Debugging
debugImplementation "com.squareup.leakcanary:leakcanary-android:$LEAK_CANARY_VERSION"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$LEAK_CANARY_VERSION"
testImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$LEAK_CANARY_VERSION"
// Support libraries
implementation "com.google.android.material:material:1.1.0-alpha04"
implementation "androidx.browser:browser:1.0.0"
implementation "androidx.cardview:cardview:1.0.0"
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation "androidx.exifinterface:exifinterface:1.0.0"
//swipe_layout
implementation 'com.daimajia.swipelayout:library:1.2.0@aar'
}
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId 'fr.free.nrw.commons'
versionCode 542
versionName '2.12.1'
setProperty("archivesBaseName", "app-commons-v$versionName-" + getBranchName())
minSdkVersion 19
targetSdkVersion 28
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments clearPackageData: 'true'
testOptions {
execution 'ANDROIDX_TEST_ORCHESTRATOR'
}
vectorDrawables.useSupportLibrary = true
}
packagingOptions {
exclude 'META-INF/androidx.*'
exclude 'META-INF/proguard/androidx-annotations.pro'
}
testOptions {
unitTests.returnDefaultValues = true
unitTests.includeAndroidResources = true
unitTests.all {
jvmArgs '-noverify'
}
}
sourceSets {
// use kotlin only in tests (for now)
test.java.srcDirs += 'src/test/kotlin'
// use main assets and resources in test
test.assets.srcDirs += 'src/main/assets'
test.resources.srcDirs += 'src/main/resoures'
}
signingConfigs {
release
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
testProguardFile 'test-proguard-rules.txt'
if(isRunningOnTravisAndIsNotPRBuild) {
signingConfig signingConfigs.release
}
}
debug {
minifyEnabled true
testCoverageEnabled project.hasProperty('coverage')
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
testProguardFile 'test-proguard-rules.txt'
versionNameSuffix "-debug-" + getBranchName()
}
}
if (isRunningOnTravisAndIsNotPRBuild) {
// configure keystore based on env vars in Travis for automated alpha builds
signingConfigs.release.storeFile = file("../nr-commons.keystore")
signingConfigs.release.storePassword = System.getenv("keystore_password")
signingConfigs.release.keyAlias = System.getenv("key_alias")
signingConfigs.release.keyPassword = System.getenv("key_password")
}
configurations.all {
resolutionStrategy.force 'androidx.annotation:annotation:1.0.2'
}
flavorDimensions 'tier'
productFlavors {
prod {
applicationId 'fr.free.nrw.commons'
buildConfigField "String", "WIKIMEDIA_API_POTD", "\"https://commons.wikimedia.org/w/api.php?action=featuredfeed&feed=potd&feedformat=rss&language=en\""
buildConfigField "String", "WIKIMEDIA_API_HOST", "\"https://commons.wikimedia.org/w/api.php\""
buildConfigField "String", "WIKIDATA_API_HOST", "\"https://www.wikidata.org/w/api.php\""
buildConfigField "String", "WIKIMEDIA_FORGE_API_HOST", "\"https://tools.wmflabs.org/\""
buildConfigField "String", "WIKIMEDIA_CAMPAIGNS_URL", "\"https://raw.githubusercontent.com/commons-app/campaigns/master/campaigns.json\""
buildConfigField "String", "IMAGE_URL_BASE", "\"https://upload.wikimedia.org/wikipedia/commons\""
buildConfigField "String", "HOME_URL", "\"https://commons.wikimedia.org/wiki/\""
buildConfigField "String", "COMMONS_URL", "\"https://commons.wikimedia.org\""
buildConfigField "String", "WIKIDATA_URL", "\"https://www.wikidata.org\""
buildConfigField "String", "MOBILE_HOME_URL", "\"https://commons.m.wikimedia.org/wiki/\""
buildConfigField "String", "SIGNUP_LANDING_URL", "\"https://commons.m.wikimedia.org/w/index.php?title=Special:CreateAccount&returnto=Main+Page&returntoquery=welcome%3Dyes\""
buildConfigField "String", "SIGNUP_SUCCESS_REDIRECTION_URL", "\"https://commons.m.wikimedia.org/w/index.php?title=Main_Page&welcome=yes\""
buildConfigField "String", "FORGOT_PASSWORD_URL", "\"https://commons.wikimedia.org/wiki/Special:PasswordReset\""
buildConfigField "String", "PRIVACY_POLICY_URL", "\"https://github.com/commons-app/apps-android-commons/wiki/Privacy-policy\""
buildConfigField "String", "ACCOUNT_TYPE", "\"fr.free.nrw.commons\""
buildConfigField "String", "CONTRIBUTION_AUTHORITY", "\"fr.free.nrw.commons.contributions.contentprovider\""
buildConfigField "String", "MODIFICATION_AUTHORITY", "\"fr.free.nrw.commons.modifications.contentprovider\""
buildConfigField "String", "CATEGORY_AUTHORITY", "\"fr.free.nrw.commons.categories.contentprovider\""
buildConfigField "String", "RECENT_SEARCH_AUTHORITY", "\"fr.free.nrw.commons.explore.recentsearches.contentprovider\""
buildConfigField "String", "BOOKMARK_AUTHORITY", "\"fr.free.nrw.commons.bookmarks.contentprovider\""
buildConfigField "String", "BOOKMARK_LOCATIONS_AUTHORITY", "\"fr.free.nrw.commons.bookmarks.locations.contentprovider\""
buildConfigField "String", "COMMIT_SHA", "\"" + getBuildVersion().toString() + "\""
buildConfigField "String", "TEST_USERNAME", "\"" + System.getenv("test_user_name") + "\""
buildConfigField "String", "TEST_PASSWORD", "\"" + System.getenv("test_user_password") + "\""
dimension 'tier'
}
beta {
applicationId 'fr.free.nrw.commons.beta'
// What values do we need to hit the BETA versions of the site / api ?
buildConfigField "String", "WIKIMEDIA_API_POTD", "\"https://commons.wikimedia.org/w/api.php?action=featuredfeed&feed=potd&feedformat=rss&language=en\""
buildConfigField "String", "WIKIMEDIA_API_HOST", "\"https://commons.wikimedia.beta.wmflabs.org/w/api.php\""
buildConfigField "String", "WIKIDATA_API_HOST", "\"https://www.wikidata.org/w/api.php\""
buildConfigField "String", "WIKIMEDIA_FORGE_API_HOST", "\"https://tools.wmflabs.org/\""
buildConfigField "String", "WIKIMEDIA_CAMPAIGNS_URL", "\"https://raw.githubusercontent.com/commons-app/campaigns/master/campaigns_beta_active.json\""
buildConfigField "String", "IMAGE_URL_BASE", "\"https://upload.beta.wmflabs.org/wikipedia/commons\""
buildConfigField "String", "HOME_URL", "\"https://commons.wikimedia.beta.wmflabs.org/wiki/\""
buildConfigField "String", "COMMONS_URL", "\"https://commons.wikimedia.beta.wmflabs.org\""
buildConfigField "String", "WIKIDATA_URL", "\"https://www.wikidata.org\""
buildConfigField "String", "MOBILE_HOME_URL", "\"https://commons.m.wikimedia.beta.wmflabs.org/wiki/\""
buildConfigField "String", "SIGNUP_LANDING_URL", "\"https://commons.m.wikimedia.beta.wmflabs.org/w/index.php?title=Special:CreateAccount&returnto=Main+Page&returntoquery=welcome%3Dyes\""
buildConfigField "String", "SIGNUP_SUCCESS_REDIRECTION_URL", "\"https://commons.m.wikimedia.beta.wmflabs.org/w/index.php?title=Main_Page&welcome=yes\""
buildConfigField "String", "FORGOT_PASSWORD_URL", "\"https://commons.wikimedia.beta.wmflabs.org/wiki/Special:PasswordReset\""
buildConfigField "String", "PRIVACY_POLICY_URL", "\"https://github.com/commons-app/apps-android-commons/wiki/Privacy-policy\""
buildConfigField "String", "ACCOUNT_TYPE", "\"fr.free.nrw.commons.beta\""
buildConfigField "String", "CONTRIBUTION_AUTHORITY", "\"fr.free.nrw.commons.beta.contributions.contentprovider\""
buildConfigField "String", "MODIFICATION_AUTHORITY", "\"fr.free.nrw.commons.beta.modifications.contentprovider\""
buildConfigField "String", "CATEGORY_AUTHORITY", "\"fr.free.nrw.commons.beta.categories.contentprovider\""
buildConfigField "String", "RECENT_SEARCH_AUTHORITY", "\"fr.free.nrw.commons.beta.explore.recentsearches.contentprovider\""
buildConfigField "String", "BOOKMARK_AUTHORITY", "\"fr.free.nrw.commons.beta.bookmarks.contentprovider\""
buildConfigField "String", "BOOKMARK_LOCATIONS_AUTHORITY", "\"fr.free.nrw.commons.beta.bookmarks.locations.contentprovider\""
buildConfigField "String", "COMMIT_SHA", "\"" + getBuildVersion().toString() + "\""
buildConfigField "String", "TEST_USERNAME", "\"" + System.getenv("test_user_name") + "\""
buildConfigField "String", "TEST_PASSWORD", "\"" + System.getenv("test_user_password") + "\""
dimension 'tier'
}
}
lintOptions {
disable 'MissingTranslation'
disable 'ExtraTranslation'
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildToolsVersion buildToolsVersion
}
if(isRunningOnTravisAndIsNotPRBuild) {
play {
track = "alpha"
userFraction = 1
serviceAccountEmail = System.getenv("SERVICE_ACCOUNT_NAME")
serviceAccountCredentials = file("../play.p12")
resolutionStrategy = "auto"
outputProcessor { // this: ApkVariantOutput
versionNameOverride = "$versionNameOverride.$versionCode"
}
}
}

447
app/build.gradle.kts Normal file
View file

@ -0,0 +1,447 @@
import java.util.Properties
import java.io.ByteArrayOutputStream
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
alias(libs.plugins.kotlin.kapt)
alias(libs.plugins.kotlin.parcelize)
}
apply(from = "$rootDir/jacoco.gradle")
val isRunningOnTravisAndIsNotPRBuild = System.getenv("CI") == "true" && file("../play.p12").exists()
if (isRunningOnTravisAndIsNotPRBuild) {
apply(plugin = "com.github.triplet.play")
}
android {
namespace = "fr.free.nrw.commons"
compileSdk = 35
defaultConfig {
applicationId = "fr.free.nrw.commons"
minSdk = 21
targetSdk = 35
versionCode = 1059
versionName = "6.1.0"
setProperty("archivesBaseName", "app-commons-v$versionName-" + getBranchName())
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
testInstrumentationRunnerArguments["clearPackageData"] = "true"
multiDexEnabled = true
vectorDrawables {
useSupportLibrary = true
}
}
sourceSets {
getByName("test") {
// Use kotlin only in tests (for now)
java.srcDirs("src/test/kotlin")
// Use main assets and resources in test
assets.srcDirs("src/main/assets")
resources.srcDirs("src/main/resources")
}
}
signingConfigs {
create("release") {
// Configure keystore based on env vars in Travis for automated alpha builds
if(isRunningOnTravisAndIsNotPRBuild) {
storeFile = file("../nr-commons.keystore")
storePassword = System.getenv("keystore_password")
keyAlias = System.getenv("key_alias")
keyPassword = System.getenv("key_password")
}
}
}
buildTypes {
release {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.txt")
testProguardFile("test-proguard-rules.txt")
signingConfig = signingConfigs.getByName("debug")
if (isRunningOnTravisAndIsNotPRBuild) {
signingConfig = signingConfigs.getByName("release")
}
}
debug {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.txt")
testProguardFile("test-proguard-rules.txt")
versionNameSuffix = "-debug-" + getBranchName()
enableUnitTestCoverage = true
enableAndroidTestCoverage = true
}
}
configurations.all {
resolutionStrategy {
force("androidx.annotation:annotation:1.1.0")
force("com.jakewharton.timber:timber:4.7.1")
force("androidx.fragment:fragment:1.3.6")
}
exclude(module = "okhttp-ws")
}
flavorDimensions += "tier"
productFlavors {
create("prod") {
dimension = "tier"
applicationId = "fr.free.nrw.commons"
buildConfigField("String", "WIKIMEDIA_API_POTD", "\"https://commons.wikimedia.org/w/api.php?action=featuredfeed&feed=potd&feedformat=rss&language=en\"")
buildConfigField("String", "WIKIMEDIA_API_HOST", "\"https://commons.wikimedia.org/w/api.php\"")
buildConfigField("String", "WIKIDATA_API_HOST", "\"https://www.wikidata.org/w/api.php\"")
buildConfigField("String", "WIKIDATA_URL", "\"https://www.wikidata.org\"")
buildConfigField("String", "WIKIMEDIA_FORGE_API_HOST", "\"https://tools.wmflabs.org/\"")
buildConfigField("String", "WIKIMEDIA_CAMPAIGNS_URL", "\"https://raw.githubusercontent.com/commons-app/campaigns/master/campaigns.json\"")
buildConfigField("String", "IMAGE_URL_BASE", "\"https://upload.wikimedia.org/wikipedia/commons\"")
buildConfigField("String", "HOME_URL", "\"https://commons.wikimedia.org/wiki/\"")
buildConfigField("String", "COMMONS_URL", "\"https://commons.wikimedia.org\"")
buildConfigField("String", "WIKIDATA_URL", "\"https://www.wikidata.org\"")
buildConfigField("String", "MOBILE_HOME_URL", "\"https://commons.m.wikimedia.org/wiki/\"")
buildConfigField("String", "MOBILE_META_URL", "\"https://meta.m.wikimedia.org/wiki/\"")
buildConfigField("String", "SIGNUP_LANDING_URL", "\"https://commons.m.wikimedia.org/w/index.php?title=Special:CreateAccount&returnto=Main+Page&returntoquery=welcome%3Dyes\"")
buildConfigField("String", "SIGNUP_SUCCESS_REDIRECTION_URL", "\"https://commons.m.wikimedia.org/w/index.php?title=Main_Page&welcome=yes\"")
buildConfigField("String", "FORGOT_PASSWORD_URL", "\"https://commons.wikimedia.org/wiki/Special:PasswordReset\"")
buildConfigField("String", "PRIVACY_POLICY_URL", "\"https://github.com/commons-app/commons-app-documentation/blob/master/android/Privacy-policy.md\"")
buildConfigField("String", "FILE_USAGES_BASE_URL", "\"https://commons.wikimedia.org/w/api.php?action=query&format=json&formatversion=2\"")
buildConfigField("String", "ACCOUNT_TYPE", "\"fr.free.nrw.commons\"")
buildConfigField("String", "CONTRIBUTION_AUTHORITY", "\"fr.free.nrw.commons.contributions.contentprovider\"")
buildConfigField("String", "MODIFICATION_AUTHORITY", "\"fr.free.nrw.commons.modifications.contentprovider\"")
buildConfigField("String", "CATEGORY_AUTHORITY", "\"fr.free.nrw.commons.categories.contentprovider\"")
buildConfigField("String", "RECENT_SEARCH_AUTHORITY", "\"fr.free.nrw.commons.explore.recentsearches.contentprovider\"")
buildConfigField("String", "RECENT_LANGUAGE_AUTHORITY", "\"fr.free.nrw.commons.recentlanguages.contentprovider\"")
buildConfigField("String", "BOOKMARK_AUTHORITY", "\"fr.free.nrw.commons.bookmarks.contentprovider\"")
buildConfigField("String", "BOOKMARK_LOCATIONS_AUTHORITY", "\"fr.free.nrw.commons.bookmarks.locations.contentprovider\"")
buildConfigField("String", "BOOKMARK_ITEMS_AUTHORITY", "\"fr.free.nrw.commons.bookmarks.items.contentprovider\"")
buildConfigField("String", "COMMIT_SHA", "\"" + getBuildVersion().toString() + "\"")
buildConfigField("String", "TEST_USERNAME", "\"" + getTestUserName() + "\"")
buildConfigField("String", "TEST_PASSWORD", "\"" + getTestPassword() + "\"")
buildConfigField("String", "DEPICTS_PROPERTY", "\"P180\"")
buildConfigField("String", "CREATOR_PROPERTY", "\"P170\"")
}
create("beta") {
dimension = "tier"
applicationId = "fr.free.nrw.commons.beta"
// What values do we need to hit the BETA versions of the site / api ?
buildConfigField("String", "WIKIMEDIA_API_POTD", "\"https://commons.wikimedia.org/w/api.php?action=featuredfeed&feed=potd&feedformat=rss&language=en\"")
buildConfigField("String", "WIKIMEDIA_API_HOST", "\"https://commons.wikimedia.beta.wmflabs.org/w/api.php\"")
buildConfigField("String", "WIKIDATA_API_HOST", "\"https://www.wikidata.org/w/api.php\"")
buildConfigField("String", "WIKIDATA_URL", "\"https://www.wikidata.org\"")
buildConfigField("String", "WIKIMEDIA_FORGE_API_HOST", "\"https://tools.wmflabs.org/\"")
buildConfigField("String", "WIKIMEDIA_CAMPAIGNS_URL", "\"https://raw.githubusercontent.com/commons-app/campaigns/master/campaigns_beta_active.json\"")
buildConfigField("String", "IMAGE_URL_BASE", "\"https://upload.beta.wmflabs.org/wikipedia/commons\"")
buildConfigField("String", "HOME_URL", "\"https://commons.wikimedia.beta.wmflabs.org/wiki/\"")
buildConfigField("String", "COMMONS_URL", "\"https://commons.wikimedia.beta.wmflabs.org\"")
buildConfigField("String", "WIKIDATA_URL", "\"https://www.wikidata.org\"")
buildConfigField("String", "MOBILE_HOME_URL", "\"https://commons.m.wikimedia.beta.wmflabs.org/wiki/\"")
buildConfigField("String", "MOBILE_META_URL", "\"https://meta.m.wikimedia.beta.wmflabs.org/wiki/\"")
buildConfigField("String", "SIGNUP_LANDING_URL", "\"https://commons.m.wikimedia.beta.wmflabs.org/w/index.php?title=Special:CreateAccount&returnto=Main+Page&returntoquery=welcome%3Dyes\"")
buildConfigField("String", "SIGNUP_SUCCESS_REDIRECTION_URL", "\"https://commons.m.wikimedia.beta.wmflabs.org/w/index.php?title=Main_Page&welcome=yes\"")
buildConfigField("String", "FORGOT_PASSWORD_URL", "\"https://commons.wikimedia.beta.wmflabs.org/wiki/Special:PasswordReset\"")
buildConfigField("String", "PRIVACY_POLICY_URL", "\"https://github.com/commons-app/commons-app-documentation/blob/master/android/Privacy-policy.md\"")
buildConfigField("String", "FILE_USAGES_BASE_URL", "\"https://commons.wikimedia.org/w/api.php?action=query&format=json&formatversion=2\"")
buildConfigField("String", "ACCOUNT_TYPE", "\"fr.free.nrw.commons.beta\"")
buildConfigField("String", "CONTRIBUTION_AUTHORITY", "\"fr.free.nrw.commons.beta.contributions.contentprovider\"")
buildConfigField("String", "MODIFICATION_AUTHORITY", "\"fr.free.nrw.commons.beta.modifications.contentprovider\"")
buildConfigField("String", "CATEGORY_AUTHORITY", "\"fr.free.nrw.commons.beta.categories.contentprovider\"")
buildConfigField("String", "RECENT_SEARCH_AUTHORITY", "\"fr.free.nrw.commons.beta.explore.recentsearches.contentprovider\"")
buildConfigField("String", "RECENT_LANGUAGE_AUTHORITY", "\"fr.free.nrw.commons.beta.recentlanguages.contentprovider\"")
buildConfigField("String", "BOOKMARK_AUTHORITY", "\"fr.free.nrw.commons.beta.bookmarks.contentprovider\"")
buildConfigField("String", "BOOKMARK_LOCATIONS_AUTHORITY", "\"fr.free.nrw.commons.beta.bookmarks.locations.contentprovider\"")
buildConfigField("String", "BOOKMARK_ITEMS_AUTHORITY", "\"fr.free.nrw.commons.beta.bookmarks.items.contentprovider\"")
buildConfigField("String", "COMMIT_SHA", "\"" + getBuildVersion().toString() + "\"")
buildConfigField("String", "TEST_USERNAME", "\"" + getTestUserName() + "\"")
buildConfigField("String", "TEST_PASSWORD", "\"" + getTestPassword() + "\"")
buildConfigField("String", "DEPICTS_PROPERTY", "\"P245962\"")
buildConfigField("String", "CREATOR_PROPERTY", "\"P253075\"")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = "17"
}
buildFeatures {
buildConfig = true
viewBinding = true
compose = true
}
buildToolsVersion = buildToolsVersion
composeOptions {
kotlinCompilerExtensionVersion = "1.5.8"
}
packaging {
jniLibs {
excludes += listOf("META-INF/androidx.*")
}
resources {
excludes += listOf(
"META-INF/androidx.*",
"META-INF/proguard/androidx-annotations.pro",
"/META-INF/LICENSE.md",
"/META-INF/LICENSE-notice.md"
)
}
}
testOptions {
animationsDisabled = true
unitTests {
isReturnDefaultValues = true
isIncludeAndroidResources = true
}
unitTests.all {
it.jvmArgs("-noverify")
}
}
lint {
abortOnError = false
disable += listOf("MissingTranslation", "ExtraTranslation")
}
}
dependencies {
// Utils
implementation(libs.gson)
implementation(libs.okhttp)
implementation(libs.retrofit)
implementation(libs.retrofit.converter.gson)
implementation(libs.retrofit.adapter.rxjava)
implementation(libs.rxandroid)
implementation(libs.rxjava)
implementation(libs.rxbinding)
implementation(libs.rxbinding.appcompat)
implementation(libs.facebook.fresco)
implementation(libs.facebook.fresco.middleware)
implementation(libs.apache.commons.lang3)
// UI
implementation("${libs.viewpagerindicator.library.get()}@aar")
implementation(libs.photoview)
implementation(libs.android.sdk)
implementation(libs.android.plugin.scalebar)
implementation(libs.timber)
implementation(libs.android.material)
implementation(libs.dexter)
// Jetpack Compose
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation(libs.androidx.compose.runtime)
implementation(libs.androidx.ui)
implementation(libs.androidx.ui.graphics)
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.ui.viewbinding)
implementation(libs.androidx.material3)
implementation(libs.androidx.foundation)
implementation(libs.androidx.foundation.layout)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.ui.test.junit4)
debugImplementation(libs.androidx.ui.tooling)
debugImplementation(libs.androidx.ui.test.manifest)
implementation(libs.adapterdelegates4.kotlin.dsl.viewbinding)
implementation(libs.adapterdelegates4.pagination)
implementation(libs.androidx.paging.runtime.ktx)
testImplementation(libs.androidx.paging.common.ktx)
implementation(libs.androidx.paging.rxjava2.ktx)
implementation(libs.androidx.recyclerview)
// Logging
implementation(libs.acra.dialog)
implementation(libs.acra.mail)
implementation(libs.slf4j.api)
implementation(libs.logback.android.classic) {
exclude(group = "com.google.android", module = "android")
}
implementation(libs.logging.interceptor)
// Dependency injector
implementation(libs.dagger.android)
implementation(libs.dagger.android.support)
kapt(libs.dagger.android.processor)
kapt(libs.dagger.compiler)
annotationProcessor(libs.dagger.android.processor)
implementation(libs.kotlin.reflect)
//Mocking
testImplementation(libs.mockito.kotlin)
testImplementation(libs.mockito.core)
testImplementation(libs.powermock.module.junit)
testImplementation(libs.powermock.api.mockito)
testImplementation(libs.mockk)
// Unit testing
testImplementation(libs.junit)
testImplementation(libs.robolectric)
testImplementation(libs.androidx.test.core)
testImplementation(libs.androidx.runner)
testImplementation(libs.androidx.test.ext.junit)
testImplementation(libs.androidx.test.rules)
testImplementation(libs.mockwebserver)
testImplementation(libs.livedata.testing.ktx)
testImplementation(libs.androidx.core.testing)
testImplementation(libs.junit.jupiter.api)
testRuntimeOnly(libs.junit.jupiter.engine)
testImplementation(libs.soloader)
testImplementation(libs.kotlinx.coroutines.test)
debugImplementation(libs.androidx.fragment.testing)
testImplementation(libs.commons.io)
// Android testing
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(libs.androidx.espresso.intents)
androidTestImplementation(libs.androidx.espresso.contrib)
androidTestImplementation(libs.androidx.runner)
androidTestImplementation(libs.androidx.test.rules)
androidTestImplementation(libs.androidx.test.core)
androidTestImplementation(libs.androidx.test.ext.junit)
androidTestImplementation(libs.androidx.annotation)
androidTestImplementation(libs.mockwebserver)
androidTestImplementation(libs.androidx.uiautomator)
// Debugging
debugImplementation(libs.leakcanary.android)
// Support libraries
implementation(libs.androidx.browser)
implementation(libs.androidx.cardview)
implementation(libs.androidx.constraintlayout)
implementation(libs.androidx.exifinterface)
implementation(libs.recyclerview.fastscroll)
//swipe_layout
implementation(libs.swipelayout.library)
//Room
implementation(libs.androidx.room.runtime)
implementation(libs.androidx.room.ktx)
implementation(libs.androidx.room.rxjava)
kapt(libs.androidx.room.compiler)
// Preferences
implementation(libs.androidx.preference)
implementation(libs.androidx.preference.ktx)
//Android Media
implementation(libs.juanitobananas.androidDmediaUtil)
implementation(libs.androidx.multidex)
// Kotlin + coroutines
implementation(libs.androidx.work.runtime.ktx)
implementation(libs.androidx.work.runtime)
implementation(libs.kotlinx.coroutines.rx2)
testImplementation(libs.androidx.work.testing)
//Glide
implementation(libs.glide)
annotationProcessor(libs.glide.compiler)
kaptTest(libs.androidx.databinding.compiler)
kaptAndroidTest(libs.androidx.databinding.compiler)
implementation(libs.coordinates2country.android) {
exclude(group = "com.google.android", module = "android")
}
//OSMDroid
implementation(libs.osmdroid.android)
constraints {
implementation(libs.kotlin.stdlib.jdk7) {
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
}
implementation(libs.kotlin.stdlib.jdk8) {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
}
}
tasks.register<Exec>("disableAnimations") {
val adb = "${System.getenv("ANDROID_HOME")}/platform-tools/adb"
commandLine(adb, "shell", "settings", "put", "global", "window_animation_scale", "0")
commandLine(adb, "shell", "settings", "put", "global", "transition_animation_scale", "0")
commandLine(adb, "shell", "settings", "put", "global", "animator_duration_scale", "0")
}
project.gradle.taskGraph.whenReady {
val connectedBetaDebugAndroidTest = tasks.named("connectedBetaDebugAndroidTest")
val connectedProdDebugAndroidTest = tasks.named("connectedProdDebugAndroidTest")
connectedBetaDebugAndroidTest.configure {
dependsOn("disableAnimations")
}
connectedProdDebugAndroidTest.configure {
dependsOn("disableAnimations")
}
}
fun getTestUserName(): String? {
val propFile = rootProject.file("./local.properties")
val properties = Properties()
propFile.inputStream().use { properties.load(it) }
return properties.getProperty("TEST_USER_NAME")
}
fun getTestPassword(): String? {
val propFile = rootProject.file("./local.properties")
val properties = Properties()
propFile.inputStream().use { properties.load(it) }
return properties.getProperty("TEST_USER_PASSWORD")
}
if (isRunningOnTravisAndIsNotPRBuild) {
configure<com.github.triplet.gradle.play.PlayPublisherExtension> {
track = "alpha"
userFraction = 1.0
serviceAccountEmail = System.getenv("SERVICE_ACCOUNT_NAME")
serviceAccountCredentials = file("../play.p12")
resolutionStrategy = "auto"
outputProcessor { // this: ApkVariantOutput
versionNameOverride = "$versionNameOverride.$versionCode"
}
}
}
fun getBuildVersion(): String? {
return try {
val stdout = ByteArrayOutputStream()
exec {
commandLine("git", "rev-parse", "--short", "HEAD")
standardOutput = stdout
}
stdout.toString().trim()
} catch (e: Exception) {
null
}
}
fun getBranchName(): String? {
return try {
val stdout = ByteArrayOutputStream()
exec {
commandLine("git", "rev-parse", "--abbrev-ref", "HEAD")
standardOutput = stdout
}
stdout.toString().trim()
} catch (e: Exception) {
null
}
}

View file

@ -1 +0,0 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":90,"versionName":"2.8.3","enabled":true,"outputFile":"app-commons-v2.8.3-acra-prod-release.apk","fullName":"prodRelease","baseName":"prod-release"},"path":"app-commons-v2.8.3-acra-prod-release.apk","properties":{}}]

View file

@ -31,6 +31,17 @@
-keepattributes Signature
# Retain declared checked exceptions for use by a Proxy instance.
-keepattributes Exceptions
# Note: The model package right now seems to include some other classes that
# are not used for serialization / deserialization over Gson. Hopefully
# that's not a problem since it only prevents R8 from avoiding trimming
# of few more classes.
-keepclasseswithmembers class fr.free.nrw.commons.*.model.** { *; }
-keepclasseswithmembers class fr.free.nrw.commons.actions.** { *; }
-keepclasseswithmembers class fr.free.nrw.commons.auth.csrf.** { *; }
-keepclasseswithmembers class fr.free.nrw.commons.auth.login.** { *; }
-keepclasseswithmembers class fr.free.nrw.commons.wikidata.mwapi.** { *; }
# --- /Retrofit ---
# --- OkHttp + Okio ---
@ -55,6 +66,9 @@
# Application classes that will be serialized/deserialized over Gson
-keep class com.google.gson.examples.android.model.** { *; }
# Prevent R8 from obfuscating project classes used by Gson for parsing
-keep class fr.free.nrw.commons.fileusages.** { *; }
# Prevent proguard from stripping interface information from TypeAdapterFactory,
# JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
-keep class * implements com.google.gson.TypeAdapterFactory
@ -76,6 +90,10 @@
-keepattributes SourceFile,LineNumberTable
-keepattributes *Annotation*
# --- /recycler view ---
-keep class androidx.recyclerview.widget.RecyclerView {
public androidx.recyclerview.widget.RecyclerView$ViewHolder findViewHolderForPosition(int);
}
# --- Parcelable ---
-keepclassmembers class * implements android.os.Parcelable {
static ** CREATOR;

View file

@ -1,45 +0,0 @@
apply plugin: 'checkstyle'
apply plugin: 'pmd'
check.dependsOn 'checkstyle', 'pmd'
checkstyle {
toolVersion = '7.5.1'
}
task checkstyle(type: Checkstyle) {
configFile file("${project.rootDir}/script/style/checkstyle.xml")
source 'src'
include '**/*.java'
exclude '**/gen/**'
classpath = files()
reports {
html {
enabled true
destination file("${project.buildDir}/reports/checkstyle/checkstyle.html")
}
}
}
task pmd(type: Pmd) {
ignoreFailures = true
ruleSetFiles = files("${project.rootDir}/script/style/ruleset.xml")
ruleSets = []
source 'src'
include '**/*.java'
exclude '**/gen/**'
reports {
xml.enabled = false
html.enabled = true
xml {
destination file("${project.buildDir}/reports/pmd/pmd.xml")
}
html {
destination file("${project.buildDir}/reports/pmd/pmd.html")
}
}
}

View file

@ -0,0 +1,149 @@
package fr.free.nrw.commons
import android.app.Activity
import android.app.Instrumentation
import android.content.Intent
import androidx.test.core.app.ApplicationProvider.getApplicationContext
import androidx.test.espresso.Espresso
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.assertion.ViewAssertions
import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.matcher.IntentMatchers
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.ActivityTestRule
import androidx.test.uiautomator.UiDevice
import fr.free.nrw.commons.utils.ConfigUtils.getVersionNameWithSha
import org.hamcrest.CoreMatchers
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class AboutActivityTest {
@get:Rule
var activityRule: ActivityTestRule<*> = ActivityTestRule(AboutActivity::class.java)
private val device: UiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
@Before
fun setup() {
device.setOrientationNatural()
device.freezeRotation()
Intents.init()
Intents
.intending(CoreMatchers.not(IntentMatchers.isInternal()))
.respondWith(Instrumentation.ActivityResult(Activity.RESULT_OK, null))
}
@After
fun cleanUp() {
Intents.release()
}
@Test
fun testBuildNumber() {
Espresso
.onView(ViewMatchers.withId(R.id.about_version))
.check(
ViewAssertions.matches(
withText(getApplicationContext<CommonsApplication>().getVersionNameWithSha()),
),
)
}
@Test
fun testLaunchWebsite() {
Espresso.onView(ViewMatchers.withId(R.id.website_launch_icon)).perform(ViewActions.click())
Intents.intended(
CoreMatchers.allOf(
IntentMatchers.hasAction(Intent.ACTION_VIEW),
IntentMatchers.hasData(Urls.WEBSITE_URL),
),
)
}
@Test
fun testLaunchFacebook() {
Espresso.onView(ViewMatchers.withId(R.id.facebook_launch_icon)).perform(ViewActions.click())
Intents.intended(
CoreMatchers.anyOf(
IntentMatchers.hasAction(Intent.ACTION_VIEW),
IntentMatchers.hasData(Urls.FACEBOOK_WEB_URL),
IntentMatchers.hasPackage(Urls.FACEBOOK_PACKAGE_NAME),
),
)
}
@Test
fun testLaunchGithub() {
Espresso.onView(ViewMatchers.withId(R.id.github_launch_icon)).perform(ViewActions.click())
Intents.intended(
CoreMatchers.allOf(
IntentMatchers.hasAction(Intent.ACTION_VIEW),
IntentMatchers.hasData(Urls.GITHUB_REPO_URL),
),
)
}
@Test
fun testLaunchAboutPrivacyPolicy() {
Espresso.onView(ViewMatchers.withId(R.id.about_privacy_policy)).perform(ViewActions.click())
Intents.intended(
CoreMatchers.allOf(
IntentMatchers.hasAction(Intent.ACTION_VIEW),
IntentMatchers.hasData(BuildConfig.PRIVACY_POLICY_URL),
),
)
}
@Test
fun testLaunchTranslate() {
Espresso.onView(ViewMatchers.withId(R.id.about_translate)).perform(ViewActions.click())
Espresso.onView(ViewMatchers.withId(android.R.id.button1)).perform(ViewActions.click())
val langCode = CommonsApplication.instance.languageLookUpTable!!.getCodes()[0]
Intents.intended(
CoreMatchers.allOf(
IntentMatchers.hasAction(Intent.ACTION_VIEW),
IntentMatchers.hasData("${Urls.TRANSLATE_WIKI_URL}$langCode"),
),
)
}
@Test
fun testLaunchAboutCredits() {
Espresso.onView(ViewMatchers.withId(R.id.about_credits)).perform(ViewActions.click())
Intents.intended(
CoreMatchers.allOf(
IntentMatchers.hasAction(Intent.ACTION_VIEW),
IntentMatchers.hasData(Urls.CREDITS_URL),
),
)
}
@Test
fun testLaunchUserGuide() {
Espresso.onView(ViewMatchers.withId(R.id.about_user_guide)).perform(ViewActions.click())
Intents.intended(
CoreMatchers.allOf(
IntentMatchers.hasAction(Intent.ACTION_VIEW),
IntentMatchers.hasData(Urls.USER_GUIDE_URL),
),
)
}
@Test
fun testLaunchAboutFaq() {
Espresso.onView(ViewMatchers.withId(R.id.about_faq)).perform(ViewActions.click())
Intents.intended(
CoreMatchers.allOf(
IntentMatchers.hasAction(Intent.ACTION_VIEW),
IntentMatchers.hasData(Urls.FAQ_URL),
),
)
}
}

View file

@ -1,37 +0,0 @@
package fr.free.nrw.commons
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.contrib.DrawerActions
import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent
import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.filters.MediumTest
import androidx.test.runner.AndroidJUnit4
import fr.free.nrw.commons.achievements.AchievementsActivity
import fr.free.nrw.commons.auth.LoginActivity
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class AchievementsActivityTest {
@get:Rule
var activityRule = IntentsTestRule(LoginActivity::class.java)
@Before
fun setup() {
UITestHelper.skipWelcome()
UITestHelper.loginUser()
}
@Test
fun testAchievements() {
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open())
onView(withId(R.id.user_icon)).perform(click())
Intents.intended(hasComponent(AchievementsActivity::class.java.name))
}
}

View file

@ -1,19 +0,0 @@
package fr.free.nrw.commons
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.AndroidJUnit4
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import fr.free.nrw.commons.explore.categories.ExploreActivity
@RunWith(AndroidJUnit4::class)
class ExploreActivityTest {
@get:Rule
var activityRule = ActivityTestRule(ExploreActivity::class.java)
@Test
fun orientationChange() {
UITestHelper.changeOrientation(activityRule)
}
}

View file

@ -8,15 +8,17 @@ import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.Intents.intending
import androidx.test.espresso.intent.matcher.IntentMatchers
import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent
import androidx.test.espresso.intent.matcher.IntentMatchers.isInternal
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.AndroidJUnit4
import androidx.test.uiautomator.UiDevice
import fr.free.nrw.commons.auth.LoginActivity
import fr.free.nrw.commons.contributions.MainActivity
import fr.free.nrw.commons.auth.SignupActivity
import org.hamcrest.CoreMatchers
import org.hamcrest.CoreMatchers.not
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
@ -27,28 +29,37 @@ class LoginActivityTest {
@get:Rule
var activityRule = ActivityTestRule(LoginActivity::class.java)
private val device: UiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
@Before
fun setup() {
try {
device.setOrientationNatural()
device.freezeRotation()
Intents.init()
} catch (ex: IllegalStateException) {
}
UITestHelper.skipWelcome()
intending(not(isInternal())).respondWith(ActivityResult(Activity.RESULT_OK, null))
}
@Test
fun testLogin() {
UITestHelper.loginUser()
Intents.intended(hasComponent(MainActivity::class.java.name))
@After
fun cleanUp() {
Intents.release()
}
@Test
fun testForgotPassword() {
Espresso.onView(ViewMatchers.withId(R.id.forgot_password))
.perform(ViewActions.click())
Intents.intended(CoreMatchers.allOf(IntentMatchers.hasAction(Intent.ACTION_VIEW), IntentMatchers.hasData(BuildConfig.FORGOT_PASSWORD_URL)));
Espresso.onView(ViewMatchers.withId(R.id.forgot_password)).perform(ViewActions.click())
Intents.intended(
CoreMatchers.allOf(
IntentMatchers.hasAction(Intent.ACTION_VIEW),
IntentMatchers.hasData(BuildConfig.FORGOT_PASSWORD_URL),
),
)
}
@Test
fun testSignupButton() {
Espresso.onView(ViewMatchers.withId(R.id.sign_up_button)).perform(ViewActions.click())
Intents.intended(IntentMatchers.hasComponent(SignupActivity::class.java.name))
}
@Test

View file

@ -1,19 +1,214 @@
package fr.free.nrw.commons
import android.app.Activity
import android.app.Instrumentation
import androidx.test.espresso.Espresso
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.matcher.IntentMatchers
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.AndroidJUnit4
import fr.free.nrw.commons.contributions.MainActivity
import androidx.test.rule.GrantPermissionRule
import androidx.test.uiautomator.UiDevice
import com.google.gson.Gson
import fr.free.nrw.commons.UITestHelper.Companion.childAtPosition
import fr.free.nrw.commons.auth.LoginActivity
import fr.free.nrw.commons.kvstore.JsonKvStore
import fr.free.nrw.commons.notification.NotificationActivity
import org.hamcrest.CoreMatchers
import org.hamcrest.Matchers
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@LargeTest
@RunWith(AndroidJUnit4::class)
class MainActivityTest {
@get:Rule
var activityRule = ActivityTestRule(MainActivity::class.java)
var activityRule: ActivityTestRule<*> = ActivityTestRule(LoginActivity::class.java)
@get:Rule
var mGrantPermissionRule: GrantPermissionRule =
GrantPermissionRule.grant(
"android.permission.ACCESS_FINE_LOCATION",
)
private val device: UiDevice =
UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
private lateinit var defaultKvStore: JsonKvStore
@Before
fun setup() {
device.setOrientationNatural()
device.freezeRotation()
UITestHelper.loginUser()
UITestHelper.skipWelcome()
Intents.init()
Intents
.intending(CoreMatchers.not(IntentMatchers.isInternal()))
.respondWith(Instrumentation.ActivityResult(Activity.RESULT_OK, null))
val context = InstrumentationRegistry.getInstrumentation().targetContext
val storeName = context.packageName + "_preferences"
defaultKvStore = JsonKvStore(context, storeName, Gson())
}
@After
fun cleanUp() {
Intents.release()
}
@Test
fun orientationChange() {
UITestHelper.changeOrientation(activityRule)
fun testNearby() {
Espresso
.onView(
Matchers.allOf(
childAtPosition(
childAtPosition(
ViewMatchers.withId(R.id.fragment_main_nav_tab_layout),
0,
),
1,
),
ViewMatchers.isDisplayed(),
),
).perform(ViewActions.click())
Espresso
.onView(ViewMatchers.withId(R.id.fragmentContainer))
.check(matches(ViewMatchers.isDisplayed()))
UITestHelper.sleep(10000)
val actionMenuItemView2 =
Espresso.onView(
Matchers.allOf(
ViewMatchers.withId(R.id.list_sheet),
ViewMatchers.withContentDescription("List"),
childAtPosition(
childAtPosition(
ViewMatchers.withId(R.id.toolbar),
1,
),
0,
),
ViewMatchers.isDisplayed(),
),
)
actionMenuItemView2.perform(ViewActions.click())
UITestHelper.sleep(1000)
}
@Test
fun testExplore() {
Espresso
.onView(
Matchers.allOf(
childAtPosition(
childAtPosition(
ViewMatchers.withId(R.id.fragment_main_nav_tab_layout),
0,
),
2,
),
ViewMatchers.isDisplayed(),
),
).perform(ViewActions.click())
Espresso
.onView(ViewMatchers.withId(R.id.fragmentContainer))
.check(matches(ViewMatchers.isDisplayed()))
UITestHelper.sleep(1000)
}
@Test
fun testContributions() {
Espresso
.onView(
Matchers.allOf(
childAtPosition(
childAtPosition(
ViewMatchers.withId(R.id.fragment_main_nav_tab_layout),
0,
),
0,
),
ViewMatchers.isDisplayed(),
),
).perform(ViewActions.click())
Espresso
.onView(ViewMatchers.withId(R.id.fragmentContainer))
.check(matches(ViewMatchers.isDisplayed()))
Espresso
.onView(
Matchers.allOf(
ViewMatchers.withId(R.id.contributionImage),
childAtPosition(
childAtPosition(
ViewMatchers.withId(R.id.contributionsList),
0,
),
1,
),
ViewMatchers.isDisplayed(),
),
).perform(ViewActions.click())
val actionMenuItemView =
Espresso.onView(
Matchers.allOf(
ViewMatchers.withId(R.id.menu_bookmark_current_image),
childAtPosition(
childAtPosition(
ViewMatchers.withId(R.id.toolbar),
1,
),
0,
),
ViewMatchers.isDisplayed(),
),
)
actionMenuItemView.perform(ViewActions.click())
UITestHelper.sleep(3000)
}
@Test
fun testBookmarks() {
Espresso
.onView(
Matchers.allOf(
childAtPosition(
childAtPosition(
ViewMatchers.withId(R.id.fragment_main_nav_tab_layout),
0,
),
3,
),
ViewMatchers.isDisplayed(),
),
).perform(ViewActions.click())
UITestHelper.sleep(1000)
}
@Test
fun testNotifications() {
Espresso
.onView(
Matchers.allOf(
ViewMatchers.withId(R.id.notifications),
childAtPosition(
childAtPosition(
ViewMatchers.withId(R.id.toolbar),
1,
),
1,
),
ViewMatchers.isDisplayed(),
),
).perform(ViewActions.click())
Intents.intended(IntentMatchers.hasComponent(NotificationActivity::class.java.name))
Espresso.pressBack()
UITestHelper.sleep(1000)
}
}

View file

@ -1,55 +0,0 @@
package fr.free.nrw.commons
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.contrib.DrawerActions
import androidx.test.espresso.contrib.NavigationViewActions
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.filters.LargeTest
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.AndroidJUnit4
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@LargeTest
@RunWith(AndroidJUnit4::class)
class NavigationBaseActivityTest {
@get:Rule
var activityRule: ActivityTestRule<*> = ActivityTestRule(AboutActivity::class.java)
/**
* Goes through all the activities in the app and checks we don't crash
* NB: This is not realistic if we're not logged in; we can access 'home', 'notifications', 'settings' and 'achievements' which we wouldn't otherwise be able to.
*/
@Test
fun goThroughNavigationBaseActivityActivities() {
// Home
openNavigationDrawerAndNavigateTo(R.id.action_home)
// Explore
openNavigationDrawerAndNavigateTo(R.id.action_explore)
// Bookmarks
openNavigationDrawerAndNavigateTo(R.id.action_bookmarks)
// About
openNavigationDrawerAndNavigateTo(R.id.action_about)
// Settings
openNavigationDrawerAndNavigateTo(R.id.action_settings)
// Achievements
openNavigationDrawerAndNavigateTo(R.id.action_login)
}
private fun openNavigationDrawerAndNavigateTo(menuItemId: Int) {
onView(withId(R.id.drawer_layout)).perform(DrawerActions.open())
UITestHelper.sleep(500)
onView(withId(R.id.navigation_view)).perform(NavigationViewActions.navigateTo(menuItemId))
}
@Test
fun orientationChange() {
UITestHelper.changeOrientation(activityRule)
}
}

View file

@ -0,0 +1,67 @@
package fr.free.nrw.commons
import android.app.Activity
import android.app.Instrumentation
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.matcher.IntentMatchers
import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent
import androidx.test.espresso.intent.rule.IntentsTestRule
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry.getInstrumentation
import androidx.test.uiautomator.UiDevice
import fr.free.nrw.commons.UITestHelper.Companion.childAtPosition
import fr.free.nrw.commons.auth.LoginActivity
import fr.free.nrw.commons.profile.ProfileActivity
import org.hamcrest.CoreMatchers
import org.hamcrest.Matchers
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class ProfileActivityTest {
@get:Rule
var activityRule = IntentsTestRule(LoginActivity::class.java)
private val device: UiDevice = UiDevice.getInstance(getInstrumentation())
@Before
fun setup() {
device.setOrientationNatural()
device.freezeRotation()
UITestHelper.loginUser()
UITestHelper.skipWelcome()
Intents
.intending(CoreMatchers.not(IntentMatchers.isInternal()))
.respondWith(Instrumentation.ActivityResult(Activity.RESULT_OK, null))
}
@Test
fun testProfile() {
onView(
Matchers.allOf(
ViewMatchers.withContentDescription("More"),
childAtPosition(
childAtPosition(
withId(R.id.fragment_main_nav_tab_layout),
0,
),
4,
),
ViewMatchers.isDisplayed(),
),
).perform(ViewActions.click())
onView(Matchers.allOf(withId(R.id.more_profile))).perform(
ViewActions.scrollTo(),
ViewActions.click(),
)
device.swipe(1033, 1346, 531, 1346, 20)
UITestHelper.sleep(5000)
Intents.intended(hasComponent(ProfileActivity::class.java.name))
}
}

View file

@ -1,16 +1,16 @@
package fr.free.nrw.commons
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.AndroidJUnit4
import fr.free.nrw.commons.category.CategoryImagesActivity
import fr.free.nrw.commons.review.ReviewActivity
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class CategoryImagesActivityTest {
class ReviewActivityTest {
@get:Rule
var activityRule = ActivityTestRule(CategoryImagesActivity::class.java)
var activityRule: ActivityTestRule<*> = ActivityTestRule(ReviewActivity::class.java)
@Test
fun orientationChange() {

View file

@ -1,19 +1,59 @@
package fr.free.nrw.commons
import androidx.test.espresso.Espresso
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.AndroidJUnit4
import androidx.test.uiautomator.UiDevice
import fr.free.nrw.commons.explore.SearchActivity
import org.hamcrest.Matchers
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import fr.free.nrw.commons.explore.SearchActivity
@RunWith(AndroidJUnit4::class)
class SearchActivityTest {
@get:Rule
var activityRule = ActivityTestRule(SearchActivity::class.java)
private val device: UiDevice =
UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
@Before
fun setup() {
device.setOrientationNatural()
device.freezeRotation()
}
@Test
fun orientationChange() {
UITestHelper.changeOrientation(activityRule)
fun exploreActivityTest() {
val searchAutoComplete =
Espresso.onView(
Matchers.allOf(
UITestHelper.childAtPosition(
Matchers.allOf(
ViewMatchers.withClassName(Matchers.`is`("android.widget.LinearLayout")),
UITestHelper.childAtPosition(
ViewMatchers.withClassName(Matchers.`is`("android.widget.LinearLayout")),
1,
),
),
0,
),
ViewMatchers.isDisplayed(),
),
)
searchAutoComplete.perform(ViewActions.replaceText("cat"), ViewActions.closeSoftKeyboard())
UITestHelper.sleep(5000)
device.swipe(1000, 1400, 500, 1400, 20)
device.swipe(800, 1400, 600, 1400, 20)
device.swipe(800, 1400, 600, 1400, 20)
device.swipe(800, 1400, 600, 1400, 20)
device.swipe(800, 1400, 600, 1400, 20)
device.swipe(800, 1400, 600, 1400, 20)
UITestHelper.sleep(1000)
}
}

View file

@ -0,0 +1,65 @@
package fr.free.nrw.commons
import android.app.Activity
import android.app.Instrumentation
import androidx.test.espresso.Espresso
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.matcher.IntentMatchers
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.ActivityTestRule
import androidx.test.uiautomator.UiDevice
import fr.free.nrw.commons.auth.LoginActivity
import fr.free.nrw.commons.settings.SettingsActivity
import org.hamcrest.CoreMatchers
import org.hamcrest.Matchers
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class SettingsActivityLoggedInTest {
@get:Rule
var activityRule: ActivityTestRule<*> = ActivityTestRule(LoginActivity::class.java)
private val device: UiDevice =
UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
@Before
fun setup() {
device.setOrientationNatural()
device.freezeRotation()
UITestHelper.loginUser()
UITestHelper.skipWelcome()
Intents
.intending(CoreMatchers.not(IntentMatchers.isInternal()))
.respondWith(Instrumentation.ActivityResult(Activity.RESULT_OK, null))
}
@Test
fun testSettings() {
Espresso
.onView(
Matchers.allOf(
ViewMatchers.withContentDescription("More"),
UITestHelper.childAtPosition(
UITestHelper.childAtPosition(
ViewMatchers.withId(R.id.fragment_main_nav_tab_layout),
0,
),
4,
),
ViewMatchers.isDisplayed(),
),
).perform(ViewActions.click())
Espresso.onView(Matchers.allOf(ViewMatchers.withId(R.id.more_settings))).perform(
ViewActions.scrollTo(),
ViewActions.click(),
)
Intents.intended(IntentMatchers.hasComponent(SettingsActivity::class.java.name))
UITestHelper.sleep(1000)
}
}

View file

@ -1,28 +1,26 @@
package fr.free.nrw.commons
import androidx.recyclerview.widget.RecyclerView
import androidx.test.espresso.Espresso
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.replaceText
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.PreferenceMatchers
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.filters.LargeTest
import androidx.test.espresso.contrib.RecyclerViewActions
import androidx.test.espresso.matcher.ViewMatchers.isEnabled
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.AndroidJUnit4
import androidx.test.uiautomator.UiDevice
import com.google.gson.Gson
import fr.free.nrw.commons.UITestHelper.Companion.childAtPosition
import fr.free.nrw.commons.kvstore.JsonKvStore
import fr.free.nrw.commons.settings.Prefs
import fr.free.nrw.commons.settings.SettingsActivity
import org.hamcrest.Matchers.allOf
import org.hamcrest.core.IsNot.not
import org.junit.Assert.assertEquals
import org.hamcrest.CoreMatchers.allOf
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@LargeTest
@RunWith(AndroidJUnit4::class)
class SettingsActivityTest {
private lateinit var defaultKvStore: JsonKvStore
@ -30,125 +28,39 @@ class SettingsActivityTest {
@get:Rule
var activityRule: ActivityTestRule<*> = ActivityTestRule(SettingsActivity::class.java)
private val device: UiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
@Before
fun setup() {
device.setOrientationNatural()
device.freezeRotation()
val context = InstrumentationRegistry.getInstrumentation().targetContext
val storeName = context.packageName + "_preferences"
defaultKvStore = JsonKvStore(context, storeName, Gson())
}
@Test
fun setRecentUploadLimitTo123() {
// Open "Use external storage" preference
Espresso.onData(PreferenceMatchers.withKey("uploads"))
.inAdapterView(withId(android.R.id.list))
.perform(click())
// Try setting it to 123
Espresso.onView(withId(android.R.id.edit))
.perform(replaceText("123"))
// Click "OK"
Espresso.onView(allOf(withId(android.R.id.button1), withText("OK")))
.perform(click())
// Check setting set to 123 in SharedPreferences
assertEquals(
123,
defaultKvStore.getInt(Prefs.UPLOADS_SHOWING, 0).toLong()
)
// Check displaying 123 in summary text
Espresso.onData(PreferenceMatchers.withKey("uploads"))
.inAdapterView(withId(android.R.id.list))
.onChildView(withId(android.R.id.summary))
.check(matches(withText("123")))
}
@Test
fun setRecentUploadLimitTo0() {
// Open "Use external storage" preference
Espresso.onData(PreferenceMatchers.withKey("uploads"))
.inAdapterView(withId(android.R.id.list))
.perform(click())
// Try setting it to 0
Espresso.onView(withId(android.R.id.edit))
.perform(replaceText("0"))
// Click "OK"
Espresso.onView(allOf(withId(android.R.id.button1), withText("OK")))
.perform(click())
// Check setting set to 100 in SharedPreferences
assertEquals(
100,
defaultKvStore.getInt(Prefs.UPLOADS_SHOWING, 0).toLong()
)
// Check displaying 100 in summary text
Espresso.onData(PreferenceMatchers.withKey("uploads"))
.inAdapterView(withId(android.R.id.list))
.onChildView(withId(android.R.id.summary))
.check(matches(withText("100")))
}
@Test
fun setRecentUploadLimitTo700() {
// Open "Use external storage" preference
Espresso.onData(PreferenceMatchers.withKey("uploads"))
.inAdapterView(withId(android.R.id.list))
.perform(click())
// Try setting it to 700
Espresso.onView(withId(android.R.id.edit))
.perform(replaceText("700"))
// Click "OK"
Espresso.onView(allOf(withId(android.R.id.button1), withText("OK")))
.perform(click())
// Check setting set to 500 in SharedPreferences
assertEquals(
500,
defaultKvStore.getInt(Prefs.UPLOADS_SHOWING, 0).toLong()
)
// Check displaying 100 in summary text
Espresso.onData(PreferenceMatchers.withKey("uploads"))
.inAdapterView(withId(android.R.id.list))
.onChildView(withId(android.R.id.summary))
.check(matches(withText("500")))
}
@Test
fun useAuthorNameTogglesOn() {
// Turn on "Use author name" preference if currently off
if (!defaultKvStore.getBoolean("useAuthorName", false)) {
Espresso.onData(PreferenceMatchers.withKey("useAuthorName"))
.inAdapterView(withId(android.R.id.list))
.perform(click())
Espresso
.onView(
allOf(
withId(R.id.recycler_view),
childAtPosition(withId(android.R.id.list_container), 0),
),
).perform(
RecyclerViewActions.actionOnItemAtPosition<RecyclerView.ViewHolder>(6, click()),
)
}
// Check authorName preference is enabled
Espresso.onData(PreferenceMatchers.withKey("authorName"))
.inAdapterView(withId(android.R.id.list))
.check(matches(isEnabled()))
}
@Test
fun useAuthorNameTogglesOff() {
// Turn off "Use external storage" preference if currently on
if (defaultKvStore.getBoolean("useAuthorName", false)) {
Espresso.onData(PreferenceMatchers.withKey("useAuthorName"))
.inAdapterView(withId(android.R.id.list))
.perform(click())
}
// Check authorName preference is enabled
Espresso.onData(PreferenceMatchers.withKey("authorName"))
.inAdapterView(withId(android.R.id.list))
.check(matches(not(isEnabled())))
Espresso
.onView(
allOf(
withId(R.id.recycler_view),
childAtPosition(withId(android.R.id.list_container), 0),
),
).check(matches(isEnabled()))
}
@Test

View file

@ -1,49 +0,0 @@
package fr.free.nrw.commons
import androidx.test.espresso.Espresso
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.assertion.ViewAssertions
import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.Intents.intended
import androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.AndroidJUnit4
import fr.free.nrw.commons.auth.LoginActivity
import fr.free.nrw.commons.auth.SignupActivity
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class SignupTest {
@get:Rule
var activityRule: ActivityTestRule<*> = ActivityTestRule(LoginActivity::class.java)
@Before
fun setup() {
UITestHelper.skipWelcome()
}
@Test
fun testSignupButton() {
try {
Intents.init()
} catch (ex: IllegalStateException) {
}
Espresso.onView(withId(R.id.sign_up_button))
.check(ViewAssertions.matches(ViewMatchers.isDisplayed()))
.perform(click())
intended(hasComponent(SignupActivity::class.java.name))
Intents.release()
}
@Test
fun orientationChange() {
UITestHelper.changeOrientation(activityRule)
}
}

View file

@ -2,19 +2,27 @@ package fr.free.nrw.commons
import android.app.Activity
import android.content.pm.ActivityInfo
import androidx.test.espresso.Espresso.closeSoftKeyboard
import android.view.View
import android.view.ViewGroup
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.NoMatchingViewException
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.rule.ActivityTestRule
import fr.free.nrw.commons.utils.StringUtils
import org.apache.commons.lang3.StringUtils
import org.hamcrest.BaseMatcher
import org.hamcrest.Description
import org.hamcrest.Matcher
import org.hamcrest.Matchers
import org.hamcrest.TypeSafeMatcher
import timber.log.Timber
class UITestHelper {
companion object {
fun skipWelcome() {
try {
onView(ViewMatchers.withId(R.id.button_ok))
.perform(ViewActions.click())
// Skip tutorial
onView(ViewMatchers.withId(R.id.finishTutorialButton))
.perform(ViewActions.click())
@ -22,20 +30,124 @@ class UITestHelper {
}
}
fun skipLogin() {
try {
// Skip Login
val htmlTextView =
onView(
Matchers.allOf(
ViewMatchers.withId(R.id.skip_login),
ViewMatchers.withText("Skip"),
ViewMatchers.isDisplayed(),
),
)
htmlTextView.perform(ViewActions.click())
val appCompatButton =
onView(
Matchers.allOf(
ViewMatchers.withId(android.R.id.button1),
ViewMatchers.withText("Yes"),
childAtPosition(
childAtPosition(
ViewMatchers.withId(R.id.buttonPanel),
0,
),
3,
),
),
)
appCompatButton.perform(ViewActions.scrollTo(), ViewActions.click())
} catch (ignored: NoMatchingViewException) {
}
}
fun loginUser() {
try {
// Perform Login
sleep(3000)
onView(ViewMatchers.withId(R.id.login_username))
.perform(ViewActions.clearText(), ViewActions.typeText(getTestUsername()))
.perform(
ViewActions.replaceText(getTestUsername()),
ViewActions.closeSoftKeyboard(),
)
sleep(2000)
onView(ViewMatchers.withId(R.id.login_password))
.perform(ViewActions.clearText(), ViewActions.typeText(getTestUserPassword()))
closeSoftKeyboard()
.perform(
ViewActions.replaceText(getTestUserPassword()),
ViewActions.closeSoftKeyboard(),
)
sleep(2000)
onView(ViewMatchers.withId(R.id.login_button))
.perform(ViewActions.click())
sleep(10000)
} catch (ignored: NoMatchingViewException) {
}
}
fun logoutUser() {
try {
onView(
Matchers.allOf(
ViewMatchers.withContentDescription("More"),
childAtPosition(
childAtPosition(
ViewMatchers.withId(R.id.fragment_main_nav_tab_layout),
0,
),
4,
),
ViewMatchers.isDisplayed(),
),
).perform(ViewActions.click())
onView(
Matchers.allOf(
ViewMatchers.withId(R.id.more_logout),
ViewMatchers.withText("Logout"),
childAtPosition(
childAtPosition(
ViewMatchers.withId(R.id.scroll_view_more_bottom_sheet),
0,
),
6,
),
),
).perform(ViewActions.scrollTo(), ViewActions.click())
onView(
Matchers.allOf(
ViewMatchers.withId(android.R.id.button1),
ViewMatchers.withText("Yes"),
childAtPosition(
childAtPosition(
ViewMatchers.withId(R.id.buttonPanel),
0,
),
3,
),
),
).perform(ViewActions.scrollTo(), ViewActions.click())
sleep(5000)
} catch (ignored: NoMatchingViewException) {
}
}
fun childAtPosition(
parentMatcher: Matcher<View>,
position: Int,
): Matcher<View> {
return object : TypeSafeMatcher<View>() {
override fun describeTo(description: Description) {
description.appendText("Child at position $position in parent ")
parentMatcher.describeTo(description)
}
public override fun matchesSafely(view: View): Boolean {
val parent = view.parent
return parent is ViewGroup &&
parentMatcher.matches(parent) &&
view == parent.getChildAt(position)
}
}
}
fun sleep(timeInMillis: Long) {
@ -49,22 +161,45 @@ class UITestHelper {
private fun getTestUsername(): String {
val username = BuildConfig.TEST_USERNAME
if (StringUtils.isNullOrWhiteSpace(username) || username == "null") {
if (StringUtils.isEmpty(username) || username == "null") {
throw NotImplementedError("Configure your beta account's username")
} else return username
} else {
return username
}
}
private fun getTestUserPassword(): String {
val password = BuildConfig.TEST_PASSWORD
if (StringUtils.isNullOrWhiteSpace(password) || password == "null") {
if (StringUtils.isEmpty(password) || password == "null") {
throw NotImplementedError("Configure your beta account's password")
} else return password
} else {
return password
}
}
fun <T : Activity> changeOrientation(activityRule: ActivityTestRule<T>) {
activityRule.activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT
assert(activityRule.activity.requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
activityRule.activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE
assert(activityRule.activity.requestedOrientation == ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE)
}
fun <T> first(matcher: Matcher<T>): Matcher<T>? {
return object : BaseMatcher<T>() {
var isFirst = true
override fun matches(item: Any): Boolean {
if (isFirst && matcher.matches(item)) {
isFirst = false
return true
}
return false
}
override fun describeTo(description: Description) {
description.appendText("should return first matching item")
}
}
}
}
}

View file

@ -1,7 +1,7 @@
package fr.free.nrw.commons
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.AndroidJUnit4
import fr.free.nrw.commons.upload.UploadActivity
import org.junit.Rule
import org.junit.Test

View file

@ -0,0 +1,203 @@
package fr.free.nrw.commons
import android.app.Activity
import android.app.Instrumentation
import androidx.recyclerview.widget.RecyclerView
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.closeSoftKeyboard
import androidx.test.espresso.action.ViewActions.replaceText
import androidx.test.espresso.action.ViewActions.scrollTo
import androidx.test.espresso.contrib.RecyclerViewActions
import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.matcher.IntentMatchers
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.ActivityTestRule
import androidx.test.rule.GrantPermissionRule
import androidx.test.uiautomator.UiDevice
import fr.free.nrw.commons.locationpicker.LocationPickerActivity
import fr.free.nrw.commons.UITestHelper.Companion.childAtPosition
import fr.free.nrw.commons.auth.LoginActivity
import org.hamcrest.CoreMatchers
import org.hamcrest.Matchers.allOf
import org.junit.After
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class UploadCancelledTest {
@Rule
@JvmField
var mActivityTestRule = ActivityTestRule(LoginActivity::class.java)
@Rule
@JvmField
var mGrantPermissionRule: GrantPermissionRule =
GrantPermissionRule.grant(
"android.permission.WRITE_EXTERNAL_STORAGE",
)
private val device: UiDevice =
UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
@Before
fun setup() {
try {
Intents.init()
} catch (_: IllegalStateException) {
}
device.unfreezeRotation()
device.setOrientationNatural()
device.freezeRotation()
UITestHelper.loginUser()
UITestHelper.skipWelcome()
Intents
.intending(CoreMatchers.not(IntentMatchers.isInternal()))
.respondWith(Instrumentation.ActivityResult(Activity.RESULT_OK, null))
}
@After
fun teardown() {
try {
Intents.release()
} catch (_: IllegalStateException) {
}
}
@Test
fun uploadCancelledAfterLocationPickedTest() {
val bottomNavigationItemView =
onView(
allOf(
childAtPosition(
childAtPosition(
withId(R.id.fragment_main_nav_tab_layout),
0,
),
1,
),
isDisplayed(),
),
)
bottomNavigationItemView.perform(click())
UITestHelper.sleep(12000)
val actionMenuItemView =
onView(
allOf(
withId(R.id.list_sheet),
childAtPosition(
childAtPosition(
withId(R.id.toolbar),
1,
),
0,
),
isDisplayed(),
),
)
actionMenuItemView.perform(click())
val recyclerView =
onView(
allOf(
withId(R.id.rv_nearby_list),
),
)
recyclerView.perform(
RecyclerViewActions.actionOnItemAtPosition<RecyclerView.ViewHolder>(
0,
click(),
),
)
val linearLayout3 =
onView(
allOf(
withId(R.id.cameraButton),
childAtPosition(
allOf(
withId(R.id.nearby_button_layout),
),
0,
),
isDisplayed(),
),
)
linearLayout3.perform(click())
val pasteSensitiveTextInputEditText =
onView(
allOf(
withId(R.id.caption_item_edit_text),
childAtPosition(
childAtPosition(
withId(R.id.caption_item_edit_text_input_layout),
0,
),
0,
),
isDisplayed(),
),
)
pasteSensitiveTextInputEditText.perform(replaceText("test"), closeSoftKeyboard())
val pasteSensitiveTextInputEditText2 =
onView(
allOf(
withId(R.id.description_item_edit_text),
childAtPosition(
childAtPosition(
withId(R.id.description_item_edit_text_input_layout),
0,
),
0,
),
isDisplayed(),
),
)
pasteSensitiveTextInputEditText2.perform(replaceText("test"), closeSoftKeyboard())
val appCompatButton2 =
onView(
allOf(
withId(R.id.btn_next),
childAtPosition(
childAtPosition(
withId(R.id.ll_container_media_detail),
2,
),
1,
),
isDisplayed(),
),
)
appCompatButton2.perform(click())
val appCompatButton3 =
onView(
allOf(
withId(android.R.id.button1),
),
)
appCompatButton3.perform(scrollTo(), click())
Intents.intended(IntentMatchers.hasComponent(LocationPickerActivity::class.java.name))
val floatingActionButton3 =
onView(
allOf(
withId(R.id.location_chosen_button),
isDisplayed(),
),
)
UITestHelper.sleep(2000)
floatingActionButton3.perform(click())
}
}

View file

@ -13,21 +13,28 @@ import androidx.test.espresso.NoMatchingViewException
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.replaceText
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.contrib.RecyclerViewActions
import androidx.test.espresso.intent.Intents
import androidx.test.espresso.intent.Intents.intended
import androidx.test.espresso.intent.Intents.intending
import androidx.test.espresso.intent.matcher.IntentMatchers.hasAction
import androidx.test.espresso.intent.matcher.IntentMatchers.hasType
import androidx.test.espresso.matcher.ViewMatchers.*
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.espresso.matcher.ViewMatchers.withParent
import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import androidx.test.rule.ActivityTestRule
import androidx.test.rule.GrantPermissionRule
import androidx.test.runner.AndroidJUnit4
import fr.free.nrw.commons.auth.LoginActivity
import fr.free.nrw.commons.upload.UploadMediaDetailAdapter
import fr.free.nrw.commons.util.MyViewAction
import fr.free.nrw.commons.utils.ConfigUtils
import org.hamcrest.core.AllOf.allOf
import org.junit.After
import org.junit.Before
import org.junit.Ignore
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
@ -36,14 +43,18 @@ import java.io.File
import java.io.FileOutputStream
import java.io.IOException
import java.text.SimpleDateFormat
import java.util.*
import java.util.Date
import java.util.Random
@LargeTest
@RunWith(AndroidJUnit4::class)
class UploadTest {
@get:Rule
var permissionRule = GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.ACCESS_FINE_LOCATION)!!
var permissionRule =
GrantPermissionRule.grant(
Manifest.permission.WRITE_EXTERNAL_STORAGE,
Manifest.permission.ACCESS_FINE_LOCATION,
)!!
@get:Rule
var activityRule = ActivityTestRule(LoginActivity::class.java)
@ -60,12 +71,10 @@ class UploadTest {
fun setup() {
try {
Intents.init()
} catch (ex: IllegalStateException) {
} catch (_: IllegalStateException) {
}
UITestHelper.skipWelcome()
UITestHelper.loginUser()
saveToInternalStorage()
UITestHelper.skipWelcome()
}
@After
@ -73,11 +82,230 @@ class UploadTest {
Intents.release()
}
private fun saveToInternalStorage() {
@Test
@Ignore("Fix Failing Test")
fun testUploadWithDescription() {
if (!ConfigUtils.isBetaFlavour) {
throw Error("This test should only be run in Beta!")
}
setupSingleUpload("image.jpg")
openGallery()
// Validate that an intent to get an image is sent
intended(allOf(hasAction(Intent.ACTION_GET_CONTENT), hasType("image/*")))
// Create filename with the current time (to prevent overwrites)
val dateFormat = SimpleDateFormat("yyMMdd-hhmmss")
val commonsFileName = "MobileTest " + dateFormat.format(Date())
// Try to dismiss the error, if there is one (probably about duplicate files on Commons)
dismissWarning("Yes")
onView(allOf<View>(isDisplayed(), withId(R.id.tv_title)))
.perform(replaceText(commonsFileName))
onView(allOf<View>(isDisplayed(), withId(R.id.description_item_edit_text)))
.perform(replaceText(commonsFileName))
onView(allOf(isDisplayed(), withId(R.id.btn_next)))
.perform(click())
UITestHelper.sleep(5000)
dismissWarning("Yes")
UITestHelper.sleep(3000)
onView(allOf(isDisplayed(), withId(R.id.et_search)))
.perform(replaceText("Uploaded with Mobile/Android Tests"))
UITestHelper.sleep(3000)
try {
onView(allOf(isDisplayed(), UITestHelper.first(withParent(withId(R.id.rv_categories)))))
.perform(click())
} catch (ignored: NoMatchingViewException) {
}
onView(allOf(isDisplayed(), withId(R.id.btn_next)))
.perform(click())
dismissWarning("Yes, Submit")
UITestHelper.sleep(500)
onView(allOf(isDisplayed(), withId(R.id.btn_submit)))
.perform(click())
UITestHelper.sleep(10000)
val fileUrl =
"https://commons.wikimedia.beta.wmflabs.org/wiki/File:" +
commonsFileName.replace(' ', '_') + ".jpg"
Timber.i("File should be uploaded to $fileUrl")
}
private fun dismissWarning(warningText: String) {
try {
onView(withText(warningText))
.check(matches(isDisplayed()))
.perform(click())
} catch (ignored: NoMatchingViewException) {
}
}
@Test
@Ignore("Fix Failing Test")
fun testUploadWithoutDescription() {
if (!ConfigUtils.isBetaFlavour) {
throw Error("This test should only be run in Beta!")
}
setupSingleUpload("image.jpg")
openGallery()
// Validate that an intent to get an image is sent
intended(allOf(hasAction(Intent.ACTION_GET_CONTENT), hasType("image/*")))
// Create filename with the current time (to prevent overwrites)
val dateFormat = SimpleDateFormat("yyMMdd-hhmmss")
val commonsFileName = "MobileTest " + dateFormat.format(Date())
// Try to dismiss the error, if there is one (probably about duplicate files on Commons)
dismissWarning("Yes")
onView(allOf<View>(isDisplayed(), withId(R.id.tv_title)))
.perform(replaceText(commonsFileName))
onView(allOf(isDisplayed(), withId(R.id.btn_next)))
.perform(click())
UITestHelper.sleep(10000)
dismissWarning("Yes")
UITestHelper.sleep(3000)
onView(allOf(isDisplayed(), withId(R.id.et_search)))
.perform(replaceText("Test"))
UITestHelper.sleep(3000)
try {
onView(allOf(isDisplayed(), UITestHelper.first(withParent(withId(R.id.rv_categories)))))
.perform(click())
} catch (ignored: NoMatchingViewException) {
}
onView(allOf(isDisplayed(), withId(R.id.btn_next)))
.perform(click())
dismissWarning("Yes, Submit")
UITestHelper.sleep(500)
onView(allOf(isDisplayed(), withId(R.id.btn_submit)))
.perform(click())
UITestHelper.sleep(10000)
val fileUrl =
"https://commons.wikimedia.beta.wmflabs.org/wiki/File:" +
commonsFileName.replace(' ', '_') + ".jpg"
Timber.i("File should be uploaded to $fileUrl")
}
@Test
@Ignore("Fix Failing Test")
fun testUploadWithMultilingualDescription() {
if (!ConfigUtils.isBetaFlavour) {
throw Error("This test should only be run in Beta!")
}
setupSingleUpload("image.jpg")
openGallery()
// Validate that an intent to get an image is sent
intended(allOf(hasAction(Intent.ACTION_GET_CONTENT), hasType("image/*")))
// Create filename with the current time (to prevent overwrites)
val dateFormat = SimpleDateFormat("yyMMdd-hhmmss")
val commonsFileName = "MobileTest " + dateFormat.format(Date())
// Try to dismiss the error, if there is one (probably about duplicate files on Commons)
dismissWarningDialog()
onView(allOf<View>(isDisplayed(), withId(R.id.tv_title)))
.perform(replaceText(commonsFileName))
onView(withId(R.id.rv_descriptions)).perform(
RecyclerViewActions
.actionOnItemAtPosition<UploadMediaDetailAdapter.ViewHolder>(
0,
MyViewAction.typeTextInChildViewWithId(R.id.description_item_edit_text, "Test description"),
),
)
onView(withId(R.id.btn_add))
.perform(click())
onView(withId(R.id.rv_descriptions)).perform(
RecyclerViewActions
.actionOnItemAtPosition<UploadMediaDetailAdapter.ViewHolder>(
1,
MyViewAction.typeTextInChildViewWithId(R.id.description_item_edit_text, "Description"),
),
)
onView(allOf(isDisplayed(), withId(R.id.btn_next)))
.perform(click())
UITestHelper.sleep(5000)
dismissWarning("Yes")
UITestHelper.sleep(3000)
onView(allOf(isDisplayed(), withId(R.id.et_search)))
.perform(replaceText("Test"))
UITestHelper.sleep(3000)
try {
onView(allOf(isDisplayed(), UITestHelper.first(withParent(withId(R.id.rv_categories)))))
.perform(click())
} catch (ignored: NoMatchingViewException) {
}
onView(allOf(isDisplayed(), withId(R.id.btn_next)))
.perform(click())
dismissWarning("Yes, Submit")
UITestHelper.sleep(500)
onView(allOf(isDisplayed(), withId(R.id.btn_submit)))
.perform(click())
UITestHelper.sleep(10000)
val fileUrl =
"https://commons.wikimedia.beta.wmflabs.org/wiki/File:" +
commonsFileName.replace(' ', '_') + ".jpg"
Timber.i("File should be uploaded to $fileUrl")
}
private fun setupSingleUpload(imageName: String) {
saveToInternalStorage(imageName)
singleImageIntent(imageName)
}
private fun saveToInternalStorage(imageName: String) {
val bitmapImage = randomBitmap
// path to /data/data/yourapp/app_data/imageDir
val mypath = File(Environment.getExternalStorageDirectory(), "image.jpg")
val mypath = File(Environment.getExternalStorageDirectory(), imageName)
Timber.d("Filepath: %s", mypath.path)
@ -96,19 +324,13 @@ class UploadTest {
} catch (e: IOException) {
e.printStackTrace()
}
}
}
@Test
fun uploadTest() {
if (!ConfigUtils.isBetaFlavour()) {
throw Error("This test should only be run in Beta!")
}
private fun singleImageIntent(imageName: String) {
// Uri to return by our mock gallery selector
// Requires file 'image.jpg' to be placed at root of file structure
val imageUri = Uri.parse("file://mnt/sdcard/image.jpg")
val imageUri = Uri.parse("file://mnt/sdcard/$imageName")
// Build a result to return from the Camera app
val intent = Intent()
@ -118,7 +340,18 @@ class UploadTest {
// Stub out the File picker. When an intent is sent to the File picker, this tells
// Espresso to respond with the ActivityResult we just created
intending(allOf(hasAction(Intent.ACTION_GET_CONTENT), hasType("image/*"))).respondWith(result)
}
private fun dismissWarningDialog() {
try {
onView(withText("Yes"))
.check(matches(isDisplayed()))
.perform(click())
} catch (ignored: NoMatchingViewException) {
}
}
private fun openGallery() {
// Open FAB
onView(allOf<View>(withId(R.id.fab_plus), isDisplayed()))
.perform(click())
@ -126,49 +359,5 @@ class UploadTest {
// Click gallery
onView(allOf<View>(withId(R.id.fab_gallery), isDisplayed()))
.perform(click())
// Validate that an intent to get an image is sent
intended(allOf(hasAction(Intent.ACTION_GET_CONTENT), hasType("image/*")))
// Create filename with the current time (to prevent overwrites)
val dateFormat = SimpleDateFormat("yyMMdd-hhmmss")
val commonsFileName = "MobileTest " + dateFormat.format(Date())
// Try to dismiss the error, if there is one (probably about duplicate files on Commons)
try {
onView(withText("Yes"))
.check(matches(isDisplayed()))
.perform(click())
} catch (ignored: NoMatchingViewException) {}
onView(allOf<View>(withId(R.id.description_item_edit_text), withParent(withParent(withId(R.id.image_title_container)))))
.perform(replaceText(commonsFileName))
onView(withId(R.id.bottom_card_next))
.perform(click())
UITestHelper.sleep(1000)
onView(withId(R.id.category_search))
.perform(replaceText("Uploaded with Mobile/Android Tests"))
UITestHelper.sleep(3000)
onView(withParent(withId(R.id.categories)))
.perform(click())
onView(withId(R.id.category_next))
.perform(click())
UITestHelper.sleep(500)
onView(withId(R.id.submit))
.perform(click())
UITestHelper.sleep(10000)
val fileUrl = "https://commons.wikimedia.beta.wmflabs.org/wiki/File:" +
commonsFileName.replace(' ', '_') + ".jpg"
Timber.i("File should be uploaded to $fileUrl")
}
}

View file

@ -5,15 +5,20 @@ import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.assertion.ViewAssertions.matches
import androidx.test.espresso.matcher.ViewMatchers.isDisplayed
import androidx.test.espresso.matcher.ViewMatchers.withId
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.filters.LargeTest
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.rule.ActivityTestRule
import androidx.test.runner.AndroidJUnit4
import androidx.test.uiautomator.UiDevice
import androidx.viewpager.widget.ViewPager
import fr.free.nrw.commons.utils.ConfigUtils
import org.hamcrest.core.IsNot.not
import org.junit.Before
import org.junit.Rule
import org.junit.Test
import org.junit.runner.RunWith
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.CoreMatchers.equalTo
@LargeTest
@RunWith(AndroidJUnit4::class)
@ -21,9 +26,19 @@ class WelcomeActivityTest {
@get:Rule
var activityRule: ActivityTestRule<*> = ActivityTestRule(WelcomeActivity::class.java)
private val device: UiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
@Before
fun setup() {
device.setOrientationNatural()
device.freezeRotation()
}
@Test
fun ifBetaShowsSkipButton() {
if (ConfigUtils.isBetaFlavour()) {
if (ConfigUtils.isBetaFlavour) {
onView(withId(R.id.button_ok))
.perform(ViewActions.click())
onView(withId(R.id.finishTutorialButton))
.check(matches(isDisplayed()))
}
@ -31,7 +46,9 @@ class WelcomeActivityTest {
@Test
fun ifProdHidesSkipButton() {
if (!ConfigUtils.isBetaFlavour()) {
if (!ConfigUtils.isBetaFlavour) {
onView(withId(R.id.button_ok))
.perform(ViewActions.click())
onView(withId(R.id.finishTutorialButton))
.check(matches(not(isDisplayed())))
}
@ -39,64 +56,74 @@ class WelcomeActivityTest {
@Test
fun testBetaSkipButton() {
if (ConfigUtils.isBetaFlavour()) {
if (ConfigUtils.isBetaFlavour) {
onView(withId(R.id.button_ok))
.perform(ViewActions.click())
onView(withId(R.id.finishTutorialButton))
.perform(ViewActions.click())
assert(activityRule.activity.isDestroyed)
assertThat(activityRule.activity.isDestroyed, equalTo(true))
}
}
@Test
fun testSwipingOnce() {
onView(withId(R.id.button_ok))
.perform(ViewActions.click())
onView(withId(R.id.welcomePager))
.perform(ViewActions.swipeLeft())
assert(true)
assertThat(true, equalTo(true))
onView(withId(R.id.welcomePager))
.perform(ViewActions.swipeRight())
assert(true)
assertThat(true, equalTo(true))
}
@Test
fun testSwipingWholeTutorial() {
onView(withId(R.id.button_ok))
.perform(ViewActions.click())
onView(withId(R.id.welcomePager))
.perform(ViewActions.swipeLeft())
.perform(ViewActions.swipeLeft())
.perform(ViewActions.swipeLeft())
.perform(ViewActions.swipeLeft())
assert(true)
assertThat(true, equalTo(true))
onView(withId(R.id.welcomePager))
.perform(ViewActions.swipeRight())
.perform(ViewActions.swipeRight())
.perform(ViewActions.swipeRight())
.perform(ViewActions.swipeRight())
assert(true)
assertThat(true, equalTo(true))
}
@Test
fun swipeBeyondBounds() {
var view_pager=activityRule.activity.findViewById<ViewPager>(R.id.welcomePager)
val viewPager = activityRule.activity.findViewById<ViewPager>(R.id.welcomePager)
view_pager.adapter?.let { view_pager.currentItem == view_pager.adapter?.count?.minus(1)
if (view_pager.currentItem==3){
viewPager.adapter?.let {
if (viewPager.currentItem == 3) {
onView(withId(R.id.welcomePager))
.perform(ViewActions.swipeLeft())
assert(true)
assertThat(true, equalTo(true))
onView(withId(R.id.welcomePager))
.perform(ViewActions.swipeRight())
assert(false)
}}
assertThat(true, equalTo(true))
}
}
}
@Test
fun swipeTillLastAndFinish() {
var view_pager=activityRule.activity.findViewById<ViewPager>(R.id.welcomePager)
val viewPager = activityRule.activity.findViewById<ViewPager>(R.id.welcomePager)
view_pager.adapter?.let { view_pager.currentItem == view_pager.adapter?.count?.minus(1)
if (view_pager.currentItem==3){
viewPager.adapter?.let {
if (viewPager.currentItem == 3) {
onView(withId(R.id.button_ok))
.perform(ViewActions.click())
onView(withId(R.id.finishTutorialButton))
.perform(ViewActions.click())
assert(activityRule.activity.isDestroyed)
}}
assertThat(activityRule.activity.isDestroyed, equalTo(true))
}
}
}
@Test

View file

@ -0,0 +1,271 @@
package fr.free.nrw.commons.contributions
import android.content.res.Configuration
import android.os.Looper
import androidx.fragment.app.testing.FragmentScenario
import androidx.fragment.app.testing.launchFragmentInContainer
import androidx.lifecycle.Lifecycle
import androidx.test.ext.junit.runners.AndroidJUnit4
import com.google.android.material.floatingactionbutton.FloatingActionButton
import fr.free.nrw.commons.Media
import fr.free.nrw.commons.OkHttpConnectionFactory
import fr.free.nrw.commons.R
import fr.free.nrw.commons.TestCommonsApplication
import fr.free.nrw.commons.createTestClient
import fr.free.nrw.commons.upload.WikidataPlace
import org.junit.Assert
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.mockito.ArgumentMatchers.anyInt
import org.mockito.Mockito.mock
import org.mockito.Mockito.verify
import org.mockito.Mockito.`when`
import org.robolectric.Shadows
import org.robolectric.annotation.Config
import org.robolectric.annotation.LooperMode
import java.lang.reflect.Method
@RunWith(AndroidJUnit4::class)
@Config(sdk = [21], application = TestCommonsApplication::class)
@LooperMode(LooperMode.Mode.PAUSED)
class ContributionsListFragmentUnitTests {
private lateinit var scenario: FragmentScenario<ContributionsListFragment>
private lateinit var fragment: ContributionsListFragment
private val adapter: ContributionsListAdapter = mock()
private val contribution: Contribution = mock()
private val media: Media = mock()
private val wikidataPlace: WikidataPlace = mock()
@Before
fun setUp() {
OkHttpConnectionFactory.CLIENT = createTestClient()
scenario =
launchFragmentInContainer(
initialState = Lifecycle.State.RESUMED,
themeResId = R.style.LightAppTheme,
) {
ContributionsListFragment()
.apply {
contributionsListPresenter = mock()
callback = mock()
}.also {
fragment = it
}
}
scenario.onFragment {
it.adapter = adapter
}
}
@Test
@Throws(Exception::class)
fun checkFragmentNotNull() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
Assert.assertNotNull(fragment)
}
@Test
@Throws(Exception::class)
fun testOnDetach() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
fragment.onDetach()
}
@Test
@Throws(Exception::class)
fun testGetContributionStateAt() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
`when`(adapter.getContributionForPosition(anyInt())).thenReturn(contribution)
fragment.getContributionStateAt(0)
}
@Test
@Throws(Exception::class)
fun testOnScrollToTop() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
fragment.rvContributionsList = mock()
fragment.scrollToTop()
verify(fragment.rvContributionsList)?.smoothScrollToPosition(0)
}
@Test
@Throws(Exception::class)
fun testOnConfirmClicked() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
`when`(contribution.media).thenReturn(media)
`when`(media.wikiCode).thenReturn("")
`when`(contribution.wikidataPlace).thenReturn(wikidataPlace)
fragment.onConfirmClicked(contribution, true)
}
@Test
@Throws(Exception::class)
fun testGetTotalMediaCount() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
fragment.totalMediaCount
}
@Test
@Throws(Exception::class)
fun testGetMediaAtPositionCaseNonNull() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
`when`(adapter.getContributionForPosition(anyInt())).thenReturn(contribution)
`when`(contribution.media).thenReturn(media)
fragment.getMediaAtPosition(0)
}
@Test
@Throws(Exception::class)
fun testGetMediaAtPositionCaseNull() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
`when`(adapter.getContributionForPosition(anyInt())).thenReturn(null)
fragment.getMediaAtPosition(0)
}
@Test
@Throws(Exception::class)
fun testShowAddImageToWikipediaInstructions() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
val method: Method =
ContributionsListFragment::class.java.getDeclaredMethod(
"showAddImageToWikipediaInstructions",
Contribution::class.java,
)
method.isAccessible = true
method.invoke(fragment, contribution)
}
@Test
@Throws(Exception::class)
fun testAddImageToWikipedia() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
fragment.addImageToWikipedia(contribution)
}
@Test
@Throws(Exception::class)
fun testOpenMediaDetail() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
fragment.openMediaDetail(0, true)
}
@Test
@Throws(Exception::class)
fun testOnViewStateRestored() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
fragment.onViewStateRestored(mock())
}
@Test
@Throws(Exception::class)
fun testOnSaveInstanceState() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
fragment.onSaveInstanceState(mock())
}
@Test
@Throws(Exception::class)
fun testShowNoContributionsUI() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
fragment.showNoContributionsUI(true)
}
@Test
@Throws(Exception::class)
fun testShowProgress() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
fragment.showProgress(true)
}
@Test
@Throws(Exception::class)
fun testShowWelcomeTip() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
fragment.showWelcomeTip(true)
}
@Test
@Throws(Exception::class)
fun testAnimateFAB() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
scenario.onFragment {
it.requireView().findViewById<FloatingActionButton>(R.id.fab_plus).hide()
}
val method: Method =
ContributionsListFragment::class.java.getDeclaredMethod(
"animateFAB",
Boolean::class.java,
)
method.isAccessible = true
method.invoke(fragment, true)
}
@Test
@Throws(Exception::class)
fun testAnimateFABCaseShownAndOpen() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
scenario.onFragment {
it.requireView().findViewById<FloatingActionButton>(R.id.fab_plus).show()
}
val method: Method =
ContributionsListFragment::class.java.getDeclaredMethod(
"animateFAB",
Boolean::class.java,
)
method.isAccessible = true
method.invoke(fragment, true)
}
@Test
@Throws(Exception::class)
fun testAnimateFABCaseShownAndClose() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
scenario.onFragment {
it.requireView().findViewById<FloatingActionButton>(R.id.fab_plus).show()
}
val method: Method =
ContributionsListFragment::class.java.getDeclaredMethod(
"animateFAB",
Boolean::class.java,
)
method.isAccessible = true
method.invoke(fragment, false)
}
@Test
@Throws(Exception::class)
fun testSetListeners() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
val method: Method =
ContributionsListFragment::class.java.getDeclaredMethod(
"setListeners",
)
method.isAccessible = true
method.invoke(fragment)
}
@Test
@Throws(Exception::class)
fun testInitializeAnimations() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
val method: Method =
ContributionsListFragment::class.java.getDeclaredMethod(
"initializeAnimations",
)
method.isAccessible = true
method.invoke(fragment)
}
@Test
@Throws(Exception::class)
fun testOnConfigurationChanged() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
val newConfig: Configuration = mock()
newConfig.orientation = Configuration.ORIENTATION_LANDSCAPE
fragment.onConfigurationChanged(newConfig)
}
}

View file

@ -0,0 +1,61 @@
package fr.free.nrw.commons.navtab
import android.os.Looper
import androidx.fragment.app.testing.FragmentScenario
import androidx.fragment.app.testing.launchFragmentInContainer
import androidx.lifecycle.Lifecycle
import androidx.test.ext.junit.runners.AndroidJUnit4
import fr.free.nrw.commons.R
import fr.free.nrw.commons.TestCommonsApplication
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.Shadows
import org.robolectric.annotation.Config
import org.robolectric.annotation.LooperMode
@RunWith(AndroidJUnit4::class)
@Config(sdk = [21], application = TestCommonsApplication::class)
@LooperMode(LooperMode.Mode.PAUSED)
class MoreBottomSheetLoggedOutFragmentUnitTests {
private lateinit var scenario: FragmentScenario<MoreBottomSheetLoggedOutFragment>
@Before
fun setUp() {
scenario =
launchFragmentInContainer(
initialState = Lifecycle.State.RESUMED,
themeResId = R.style.LightAppTheme,
) {
MoreBottomSheetLoggedOutFragment()
}
}
@Test
@Throws(Exception::class)
fun testOnSettingsClicked() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
scenario.onFragment { it.onSettingsClicked() }
}
@Test
@Throws(Exception::class)
fun testOnAboutClicked() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
scenario.onFragment { it.onAboutClicked() }
}
@Test
@Throws(Exception::class)
fun testOnFeedbackClicked() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
scenario.onFragment { it.onFeedbackClicked() }
}
@Test
@Throws(Exception::class)
fun testOnLogoutClicked() {
Shadows.shadowOf(Looper.getMainLooper()).idle()
scenario.onFragment { it.onLogoutClicked() }
}
}

View file

@ -0,0 +1,46 @@
package fr.free.nrw.commons.ui
import android.content.Context
import android.util.AttributeSet
import androidx.test.core.app.ApplicationProvider
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Assert
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
@RunWith(AndroidJUnit4::class)
class PasteSensitiveTextInputEditTextTest {
private var context: Context? = null
private var textView: PasteSensitiveTextInputEditText? = null
@Before
fun setup() {
context = ApplicationProvider.getApplicationContext()
textView = PasteSensitiveTextInputEditText(context!!)
}
// this test has no real value, just % for test code coverage
@Test
fun extractFormattingAttributeSet() {
val methodExtractFormattingAttribute =
textView!!.javaClass.getDeclaredMethod(
"extractFormattingAttribute",
Context::class.java,
AttributeSet::class.java,
)
methodExtractFormattingAttribute.isAccessible = true
methodExtractFormattingAttribute.invoke(textView, context, null)
}
@Test
@Throws(Exception::class)
fun setFormattingAllowed() {
val fieldFormattingAllowed = textView!!.javaClass.getDeclaredField("formattingAllowed")
fieldFormattingAllowed.isAccessible = true
textView!!.setFormattingAllowed(true)
Assert.assertTrue(fieldFormattingAllowed.getBoolean(textView))
textView!!.setFormattingAllowed(false)
Assert.assertFalse(fieldFormattingAllowed.getBoolean(textView))
}
}

View file

@ -0,0 +1,66 @@
package fr.free.nrw.commons.util
import android.view.View
import android.widget.EditText
import androidx.appcompat.widget.AppCompatSpinner
import androidx.test.espresso.UiController
import androidx.test.espresso.ViewAction
import org.hamcrest.Matcher
class MyViewAction {
companion object {
fun typeTextInChildViewWithId(
id: Int,
textToBeTyped: String,
): ViewAction =
object : ViewAction {
override fun getConstraints(): Matcher<View>? = null
override fun getDescription(): String = "Click on a child view with specified id."
override fun perform(
uiController: UiController,
view: View,
) {
val v = view.findViewById<View>(id) as EditText
v.setText(textToBeTyped)
}
}
fun selectSpinnerItemInChildViewWithId(
id: Int,
position: Int,
): ViewAction =
object : ViewAction {
override fun getConstraints(): Matcher<View>? = null
override fun getDescription(): String = "Click on a child view with specified id."
override fun perform(
uiController: UiController,
view: View,
) {
val v = view.findViewById<View>(id) as AppCompatSpinner
v.setSelection(position)
}
}
fun clickItemWithId(
id: Int,
position: Int,
): ViewAction =
object : ViewAction {
override fun getConstraints(): Matcher<View>? = null
override fun getDescription(): String = "Click on a child view with specified id."
override fun perform(
uiController: UiController,
view: View,
) {
val v = view.findViewById<View>(id) as View
v.performClick()
}
}
}
}

View file

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<shortcuts xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<shortcut
android:enabled="true"
android:icon="@mipmap/ic_settings_black"
android:shortcutId="Setting"
android:shortcutLongLabel="@string/title_app_shortcut_setting"
android:shortcutShortLabel="@string/title_app_shortcut_setting"
tools:targetApi="n_mr1">
<intent
android:action="android.intent.action.VIEW"
android:targetClass="fr.free.nrw.commons.settings.SettingsActivity"
android:targetPackage="fr.free.nrw.commons.beta" />
</shortcut>
</shortcuts>

View file

@ -1,62 +1,109 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="fr.free.nrw.commons">
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.READ_SYNC_STATS" />
<uses-permission android:name="android.permission.REORDER_TASKS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="29"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<!-- Permission needed up to Android 5.1, see https://github.com/commons-app/apps-android-commons/pull/5863 -->
<uses-permission android:name="android.permission.GET_ACCOUNTS"
android:maxSdkVersion="22"/>
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS" />
<uses-permission android:name="android.permission.MANAGE_DOCUMENTS" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"
android:minSdkVersion="33"/>
<uses-permission android:name="com.google.android.apps.photos.permission.GOOGLE_PHOTOS" />
<uses-permission android:name="android.permission.READ_LOGS" />
<uses-permission android:name="android.permission.SET_WALLPAPER" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.ACCESS_MEDIA_LOCATION"/>
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED"
android:minSdkVersion="34"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<queries>
<!-- Needed only if your app targets Android 5.0 (API level 21) or higher. -->
<!-- Browser -->
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
<!-- Google Maps -->
<package android:name="com.google.android.apps.maps" />
</queries> <!-- Needed only if your app targets Android 5.0 (API level 21) or higher. -->
<uses-feature android:name="android.hardware.location.gps" />
<application
android:name=".CommonsApplication"
android:appComponentFactory="commons"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/LightAppTheme"
android:largeHeap="true"
android:requestLegacyExternalStorage="true"
android:supportsRtl="true"
tools:replace="android:appComponentFactory"
android:appComponentFactory="commons"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="org.acra.dialog.CrashReportDialog"
android:process=":acra"
android:launchMode="singleInstance"
android:theme="@style/LightAppTheme"
tools:ignore="GoogleAppIndexingWarning"
tools:replace="android:appComponentFactory">
<activity
android:name=".activity.SingleWebViewActivity"
android:exported="false" />
<activity
android:name=".nearby.WikidataFeedback"
android:exported="false" />
<activity
android:name=".upload.UploadProgressActivity"
android:exported="false" />
<activity
android:name=".description.DescriptionEditActivity"
android:exported="true"
android:theme="@style/EditActivityTheme" />
<activity
android:name=".edit.EditActivity"
android:exported="false" />
<activity
android:name="org.acra.dialog.CrashReportDialog"
android:excludeFromRecents="true"
android:finishOnTaskLaunch="true" />
<activity android:name=".auth.LoginActivity">
android:finishOnTaskLaunch="true"
android:launchMode="singleInstance"
android:process=":acra" />
<activity
android:name=".media.ZoomableActivity"
android:configChanges="screenSize|keyboard|orientation"
android:label="Zoomable Activity"
android:parentActivityName=".customselector.ui.selector.CustomSelectorActivity" />
<activity
android:name=".auth.LoginActivity"
android:windowSoftInputMode="adjustPan"
android:exported="true">
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
</intent-filter>
<meta-data
android:name="android.app.shortcuts"
android:resource="@xml/shortcuts" />
</activity>
<activity android:name=".WelcomeActivity" />
<activity
android:name=".upload.UploadActivity"
android:configChanges="orientation|screenSize|keyboard"
android:exported="true"
android:hardwareAccelerated="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:windowSoftInputMode="adjustResize"
>
android:windowSoftInputMode="adjustPan">
<intent-filter android:label="@string/intent_share_upload_label">
<action android:name="android.intent.action.SEND" />
@ -76,9 +123,9 @@
</activity>
<activity
android:name=".contributions.MainActivity"
android:configChanges="screenSize|keyboard|orientation"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:configChanges="orientation|screenSize|keyboard" />
/>
<activity
android:name=".settings.SettingsActivity"
android:label="@string/title_activity_settings" />
@ -86,59 +133,51 @@
android:name=".AboutActivity"
android:label="@string/title_activity_about"
android:parentActivityName=".contributions.MainActivity" />
<activity
android:name=".auth.SignupActivity"
android:configChanges="orientation|screenLayout|screenSize"
android:label="@string/title_activity_signup" />
<activity
android:name=".notification.NotificationActivity"
android:label="@string/navigation_item_notification" />
<activity android:name=".quiz.QuizActivity"
android:label="@string/quiz"/>
<activity android:name=".quiz.QuizResultActivity"
android:label="@string/result"/>
<activity
android:name=".category.CategoryImagesActivity"
android:label="@string/title_activity_featured_images"
android:parentActivityName=".contributions.MainActivity"
android:configChanges="orientation|screenSize|keyboard"/>
android:name=".quiz.QuizActivity"
android:label="@string/quiz" />
<activity
android:name=".quiz.QuizResultActivity"
android:label="@string/result" />
<activity
android:name=".customselector.ui.selector.CustomSelectorActivity"
android:configChanges="screenSize|keyboard|orientation"
android:label="@string/title_activity_custom_selector"
android:parentActivityName=".contributions.MainActivity" />
<activity
android:name=".category.CategoryDetailsActivity"
android:configChanges="screenSize|keyboard|orientation"
android:label="@string/title_activity_featured_images"
android:parentActivityName=".contributions.MainActivity" />
<activity
android:name=".explore.categories.ExploreActivity"
android:label="@string/title_activity_explore"
android:parentActivityName=".contributions.MainActivity"
android:configChanges="orientation|screenSize|keyboard" />
android:name=".explore.depictions.WikidataItemDetailsActivity"
android:configChanges="screenSize|keyboard|orientation"
android:label="@string/title_activity_featured_images"
android:parentActivityName=".contributions.MainActivity" />
<activity
android:name=".explore.SearchActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/title_activity_search"
android:launchMode="singleTop"
android:configChanges="orientation|keyboardHidden|screenSize"
android:parentActivityName=".contributions.MainActivity"
/>
android:parentActivityName=".contributions.MainActivity" />
<activity
android:name=".achievements.AchievementsActivity"
android:label="@string/Achievements" />
<activity
android:name=".bookmarks.BookmarksActivity"
android:label="@string/title_activity_bookmarks" />
android:name=".profile.ProfileActivity"
android:configChanges="orientation|screenSize|keyboard"
android:label="@string/Profile" />
<activity
android:name=".review.ReviewActivity"
android:label="@string/title_activity_review" />
<activity
android:name=".locationpicker.LocationPickerActivity"
android:label="Location Picker" />
<service android:name=".upload.UploadService" />
<service
android:name=".auth.WikiAccountAuthenticatorService"
android:exported="true"
@ -146,28 +185,20 @@
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data
android:name="android.accounts.AccountAuthenticator"
android:resource="@xml/authenticator" />
</service>
<service
android:name=".contributions.ContributionsSyncService"
android:exported="true"
android:process=":sync">
<intent-filter>
<action android:name="android.content.SyncAdapter" />
</intent-filter>
<meta-data
android:name="android.content.SyncAdapter"
android:resource="@xml/contributions_sync_adapter" />
</service>
<service
android:name="org.acra.sender.SenderService"
android:exported="false"
android:process=":acra" />
<service
android:name="androidx.work.impl.foreground.SystemForegroundService"
android:foregroundServiceType="dataSync" />
<provider
android:name=".filepicker.ExtendedFileProvider"
android:authorities="${applicationId}.provider"
@ -177,42 +208,40 @@
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
<provider
android:name=".contributions.ContributionsContentProvider"
android:authorities="${applicationId}.contributions.contentprovider"
android:exported="false"
android:label="@string/provider_contributions"
android:syncable="true" />
<provider
android:name=".category.CategoryContentProvider"
android:authorities="${applicationId}.categories.contentprovider"
android:exported="false"
android:label="@string/provider_categories"
android:syncable="false" />
<provider
android:name=".explore.recentsearches.RecentSearchesContentProvider"
android:authorities="${applicationId}.explore.recentsearches.contentprovider"
android:exported="false"
android:label="@string/provider_searches"
android:syncable="false" />
<provider
android:name=".recentlanguages.RecentLanguagesContentProvider"
android:authorities="${applicationId}.recentlanguages.contentprovider"
android:exported="false"
android:label="@string/provider_recent_languages"
android:syncable="false" />
<provider
android:name=".bookmarks.pictures.BookmarkPicturesContentProvider"
android:authorities="${applicationId}.bookmarks.contentprovider"
android:exported="false"
android:label="@string/provider_bookmarks"
android:syncable="false" />
<provider
android:name=".bookmarks.locations.BookmarkLocationsContentProvider"
android:authorities="${applicationId}.bookmarks.locations.contentprovider"
android:name=".bookmarks.items.BookmarkItemsContentProvider"
android:authorities="${applicationId}.bookmarks.items.contentprovider"
android:exported="false"
android:label="@string/provider_bookmarks_location"
android:syncable="false" />
<receiver android:name=".widget.PicOfDayAppWidget">
<receiver
android:name=".widget.PicOfDayAppWidget"
android:exported="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
@ -222,8 +251,9 @@
android:resource="@xml/pic_of_day_app_widget_info" />
</receiver>
<uses-library android:name="org.apache.http.legacy" android:required="false" />
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
</application>
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View file

@ -1,166 +0,0 @@
package fr.free.nrw.commons;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.style.UnderlineSpan;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
import org.wikipedia.util.StringUtil;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import fr.free.nrw.commons.theme.NavigationBaseActivity;
import fr.free.nrw.commons.ui.widget.HtmlTextView;
import fr.free.nrw.commons.utils.ConfigUtils;
/**
* Represents about screen of this app
*/
public class AboutActivity extends NavigationBaseActivity {
@BindView(R.id.about_version) TextView versionText;
@BindView(R.id.about_license) HtmlTextView aboutLicenseText;
@BindView(R.id.about_faq) TextView faqText;
@BindView(R.id.about_improve) HtmlTextView improve;
/**
* This method helps in the creation About screen
*
* @param savedInstanceState Data bundle
*/
@Override
@SuppressLint("StringFormatInvalid")
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_about);
ButterKnife.bind(this);
String aboutText = getString(R.string.about_license);
aboutLicenseText.setHtmlText(aboutText);
@SuppressLint("StringFormatMatches")
String improveText = String.format(getString(R.string.about_improve), Urls.NEW_ISSUE_URL);
improve.setHtmlText(improveText);
SpannableString content = new SpannableString(getString(R.string.about_faq));
content.setSpan(new UnderlineSpan(), 0, content.length(), 0);
faqText.setText(content);
versionText.setText(ConfigUtils.getVersionNameWithSha(getApplicationContext()));
TextView rate_us = findViewById(R.id.about_rate_us);
TextView privacy_policy = findViewById(R.id.about_privacy_policy);
TextView translate = findViewById(R.id.about_translate);
TextView credits = findViewById(R.id.about_credits);
TextView faq = findViewById(R.id.about_faq);
rate_us.setText(StringUtil.fromHtml(getString(R.string.about_rate_us)));
privacy_policy.setText(StringUtil.fromHtml(getString(R.string.about_privacy_policy)));
translate.setText(StringUtil.fromHtml(getString(R.string.about_translate)));
credits.setText(StringUtil.fromHtml(getString(R.string.about_credits)));
faq.setText(StringUtil.fromHtml(getString(R.string.about_faq)));
initDrawer();
}
@OnClick(R.id.facebook_launch_icon)
public void launchFacebook(View view) {
Intent intent;
try {
intent = new Intent(Intent.ACTION_VIEW, Uri.parse(Urls.FACEBOOK_APP_URL));
intent.setPackage(Urls.FACEBOOK_PACKAGE_NAME);
startActivity(intent);
} catch (Exception e) {
Utils.handleWebUrl(this, Uri.parse(Urls.FACEBOOK_WEB_URL));
}
}
@OnClick(R.id.github_launch_icon)
public void launchGithub(View view) {
Utils.handleWebUrl(this, Uri.parse(Urls.GITHUB_REPO_URL));
}
@OnClick(R.id.website_launch_icon)
public void launchWebsite(View view) {
Utils.handleWebUrl(this, Uri.parse(Urls.WEBSITE_URL));
}
@OnClick(R.id.about_rate_us)
public void launchRatings(View view){
Utils.rateApp(this);
}
@OnClick(R.id.about_credits)
public void launchCredits(View view) {
Utils.handleWebUrl(this, Uri.parse(Urls.CREDITS_URL));
}
@OnClick(R.id.about_privacy_policy)
public void launchPrivacyPolicy(View view) {
Utils.handleWebUrl(this, Uri.parse(BuildConfig.PRIVACY_POLICY_URL));
}
@OnClick(R.id.about_faq)
public void launchFrequentlyAskedQuesions(View view) {
Utils.handleWebUrl(this, Uri.parse(Urls.FAQ_URL));
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.menu_about, menu);
return super.onCreateOptionsMenu(menu);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.share_app_icon:
String shareText = String.format(getString(R.string.share_text), Urls.PLAY_STORE_URL);
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, shareText);
sendIntent.setType("text/plain");
startActivity(Intent.createChooser(sendIntent, getString(R.string.share_via)));
return true;
default:
return super.onOptionsItemSelected(item);
}
}
@OnClick(R.id.about_translate)
public void launchTranslate(View view) {
final ArrayAdapter<String> languageAdapter = new ArrayAdapter<>(AboutActivity.this,
android.R.layout.simple_spinner_dropdown_item, CommonsApplication.getInstance().getLanguageLookUpTable().getLocalizedNames());
final Spinner spinner = new Spinner(AboutActivity.this);
spinner.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT));
spinner.setAdapter(languageAdapter);
spinner.setGravity(17);
spinner.setPadding(50,0,0,0);
AlertDialog.Builder builder = new AlertDialog.Builder(AboutActivity.this);
builder.setView(spinner);
builder.setTitle(R.string.about_translate_title)
.setMessage(R.string.about_translate_message)
.setPositiveButton(R.string.about_translate_proceed, (dialog, which) -> {
String langCode = CommonsApplication.getInstance().getLanguageLookUpTable().getCodes().get(spinner.getSelectedItemPosition());
Utils.handleWebUrl(AboutActivity.this, Uri.parse(Urls.TRANSLATE_WIKI_URL + langCode));
});
builder.setNegativeButton(R.string.about_translate_cancel, (dialog, which) -> finish());
builder.create().show();
}
}

View file

@ -0,0 +1,207 @@
package fr.free.nrw.commons
import android.annotation.SuppressLint
import android.content.ActivityNotFoundException
import android.content.Intent
import android.content.Intent.ACTION_VIEW
import android.net.Uri
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import android.view.View
import android.widget.ArrayAdapter
import android.widget.LinearLayout
import android.widget.Spinner
import fr.free.nrw.commons.CommonsApplication.Companion.instance
import fr.free.nrw.commons.databinding.ActivityAboutBinding
import fr.free.nrw.commons.theme.BaseActivity
import fr.free.nrw.commons.utils.ConfigUtils.getVersionNameWithSha
import fr.free.nrw.commons.utils.DialogUtil.showAlertDialog
import java.util.Collections
import androidx.core.net.toUri
import fr.free.nrw.commons.utils.applyEdgeToEdgeTopInsets
import fr.free.nrw.commons.utils.handleWebUrl
import fr.free.nrw.commons.utils.setUnderlinedText
/**
* Represents about screen of this app
*/
class AboutActivity : BaseActivity() {
/*
This View Binding class is auto-generated for each xml file. The format is usually the name
of the file with PascalCasing (The underscore characters will be ignored).
More information is available at https://developer.android.com/topic/libraries/view-binding
*/
private var binding: ActivityAboutBinding? = null
/**
* This method helps in the creation About screen
*
* @param savedInstanceState Data bundle
*/
@SuppressLint("StringFormatInvalid") //TODO:
public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
/*
Instead of just setting the view with the xml file. We need to use View Binding class.
*/
binding = ActivityAboutBinding.inflate(layoutInflater)
val view: View = binding!!.root
applyEdgeToEdgeTopInsets(binding!!.toolbarLayout)
setContentView(view)
setSupportActionBar(binding!!.toolbarBinding.toolbar)
supportActionBar!!.setDisplayHomeAsUpEnabled(true)
val aboutText = getString(R.string.about_license)
/*
We can then access all the views by just using the id names like this.
camelCasing is used with underscore characters being ignored.
*/
binding!!.aboutLicense.setHtmlText(aboutText)
@SuppressLint("StringFormatMatches") // TODO:
val improveText =
String.format(getString(R.string.about_improve), Urls.NEW_ISSUE_URL)
binding!!.aboutImprove.setHtmlText(improveText)
binding!!.aboutVersion.text = applicationContext.getVersionNameWithSha()
binding!!.aboutFaq.setUnderlinedText(R.string.about_faq)
binding!!.aboutRateUs.setUnderlinedText(R.string.about_rate_us)
binding!!.aboutUserGuide.setUnderlinedText(R.string.user_guide)
binding!!.aboutPrivacyPolicy.setUnderlinedText(R.string.about_privacy_policy)
binding!!.aboutTranslate.setUnderlinedText(R.string.about_translate)
binding!!.aboutCredits.setUnderlinedText(R.string.about_credits)
/*
To set listeners, we can create a separate method and use lambda syntax.
*/
binding!!.facebookLaunchIcon.setOnClickListener(::launchFacebook)
binding!!.githubLaunchIcon.setOnClickListener(::launchGithub)
binding!!.websiteLaunchIcon.setOnClickListener(::launchWebsite)
binding!!.aboutRateUs.setOnClickListener(::launchRatings)
binding!!.aboutCredits.setOnClickListener(::launchCredits)
binding!!.aboutPrivacyPolicy.setOnClickListener(::launchPrivacyPolicy)
binding!!.aboutUserGuide.setOnClickListener(::launchUserGuide)
binding!!.aboutFaq.setOnClickListener(::launchFrequentlyAskedQuesions)
binding!!.aboutTranslate.setOnClickListener(::launchTranslate)
}
override fun onSupportNavigateUp(): Boolean {
onBackPressed()
return true
}
fun launchFacebook(view: View?) {
val intent: Intent
try {
intent = Intent(ACTION_VIEW, Urls.FACEBOOK_APP_URL.toUri())
intent.setPackage(Urls.FACEBOOK_PACKAGE_NAME)
startActivity(intent)
} catch (e: Exception) {
handleWebUrl(this, Urls.FACEBOOK_WEB_URL.toUri())
}
}
fun launchGithub(view: View?) {
val intent: Intent
try {
intent = Intent(ACTION_VIEW, Urls.GITHUB_REPO_URL.toUri())
intent.setPackage(Urls.GITHUB_PACKAGE_NAME)
startActivity(intent)
} catch (e: Exception) {
handleWebUrl(this, Urls.GITHUB_REPO_URL.toUri())
}
}
fun launchWebsite(view: View?) {
handleWebUrl(this, Urls.WEBSITE_URL.toUri())
}
fun launchRatings(view: View?) {
try {
startActivity(
Intent(
ACTION_VIEW,
(Urls.PLAY_STORE_PREFIX + packageName).toUri()
)
)
} catch (_: ActivityNotFoundException) {
handleWebUrl(this, (Urls.PLAY_STORE_URL_PREFIX + packageName).toUri())
}
}
fun launchCredits(view: View?) {
handleWebUrl(this, Urls.CREDITS_URL.toUri())
}
fun launchUserGuide(view: View?) {
handleWebUrl(this, Urls.USER_GUIDE_URL.toUri())
}
fun launchPrivacyPolicy(view: View?) {
handleWebUrl(this, BuildConfig.PRIVACY_POLICY_URL.toUri())
}
fun launchFrequentlyAskedQuesions(view: View?) {
handleWebUrl(this, Urls.FAQ_URL.toUri())
}
override fun onCreateOptionsMenu(menu: Menu): Boolean {
val inflater = menuInflater
inflater.inflate(R.menu.menu_about, menu)
return super.onCreateOptionsMenu(menu)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
R.id.share_app_icon -> {
val shareText = String.format(
getString(R.string.share_text),
Urls.PLAY_STORE_URL_PREFIX + this.packageName
)
val sendIntent = Intent()
sendIntent.setAction(Intent.ACTION_SEND)
sendIntent.putExtra(Intent.EXTRA_TEXT, shareText)
sendIntent.setType("text/plain")
startActivity(Intent.createChooser(sendIntent, getString(R.string.share_via)))
return true
}
else -> return super.onOptionsItemSelected(item)
}
}
fun launchTranslate(view: View?) {
val sortedLocalizedNamesRef = instance.languageLookUpTable!!.getCanonicalNames()
Collections.sort(sortedLocalizedNamesRef)
val languageAdapter = ArrayAdapter(
this@AboutActivity,
android.R.layout.simple_spinner_dropdown_item, sortedLocalizedNamesRef
)
val spinner = Spinner(this@AboutActivity)
spinner.layoutParams =
LinearLayout.LayoutParams(
LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT
)
spinner.adapter = languageAdapter
spinner.gravity = 17
spinner.setPadding(50, 0, 0, 0)
val positiveButtonRunnable = Runnable {
val langCode = instance.languageLookUpTable!!.getCodes()[spinner.selectedItemPosition]
handleWebUrl(this@AboutActivity, (Urls.TRANSLATE_WIKI_URL + langCode).toUri())
}
showAlertDialog(
this,
getString(R.string.about_translate_title),
getString(R.string.about_translate_message),
getString(R.string.about_translate_proceed),
getString(R.string.about_translate_cancel),
positiveButtonRunnable,
{},
spinner
)
}
}

View file

@ -0,0 +1,63 @@
package fr.free.nrw.commons
import android.content.Context
import android.graphics.Bitmap
import android.graphics.Canvas
import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import fr.free.nrw.commons.location.LatLng
import fr.free.nrw.commons.nearby.Place
class BaseMarker {
private var _position: LatLng = LatLng(0.0, 0.0, 0f)
private var _title: String = ""
private var _place: Place = Place()
private var _icon: Bitmap? = null
var position: LatLng
get() = _position
set(value) {
_position = value
}
var title: String
get() = _title
set(value) {
_title = value
}
var place: Place
get() = _place
set(value) {
_place = value
}
var icon: Bitmap?
get() = _icon
set(value) {
_icon = value
}
constructor() {
}
fun fromResource(
context: Context,
drawableResId: Int,
) {
val drawable: Drawable = context.resources.getDrawable(drawableResId)
icon =
if (drawable is BitmapDrawable) {
drawable.bitmap
} else {
val bitmap =
Bitmap.createBitmap(
drawable.intrinsicWidth,
drawable.intrinsicHeight,
Bitmap.Config.ARGB_8888,
)
val canvas = Canvas(bitmap)
drawable.setBounds(0, 0, canvas.width, canvas.height)
drawable.draw(canvas)
bitmap
}
}
}

View file

@ -1,16 +0,0 @@
package fr.free.nrw.commons;
/**
* Base presenter, enforcing contracts to atach and detach view
*/
public interface BasePresenter<T> {
/**
* Until a view is attached, it is open to listen events from the presenter
*/
void onAttachView(T view);
/**
* Detaching a view makes sure that the view no more receives events from the presenter
*/
void onDetachView();
}

View file

@ -0,0 +1,10 @@
package fr.free.nrw.commons
/**
* Base presenter, enforcing contracts to attach and detach view
*/
interface BasePresenter<T> {
fun onAttachView(view: T)
fun onDetachView()
}

View file

@ -0,0 +1,19 @@
package fr.free.nrw.commons
/**
* Production variant related constants which is used in beta variant for some specific GET calls on
* production server where beta server does not work
*/
object BetaConstants {
/**
* Commons production URL which is used in beta for some specific GET calls on
* production server where beta server does not work
*/
const val COMMONS_URL = "https://commons.wikimedia.org/"
/**
* Commons production's depicts property which is used in beta for some specific GET calls on
* production server where beta server does not work
*/
const val DEPICTS_PROPERTY = "P180"
}

View file

@ -0,0 +1,33 @@
package fr.free.nrw.commons
import android.os.Parcel
import android.os.Parcelable
class CameraPosition(
val latitude: Double,
val longitude: Double,
val zoom: Double,
) : Parcelable {
constructor(parcel: Parcel) : this(
parcel.readDouble(),
parcel.readDouble(),
parcel.readDouble(),
)
override fun writeToParcel(
parcel: Parcel,
flags: Int,
) {
parcel.writeDouble(latitude)
parcel.writeDouble(longitude)
parcel.writeDouble(zoom)
}
override fun describeContents(): Int = 0
companion object CREATOR : Parcelable.Creator<CameraPosition> {
override fun createFromParcel(parcel: Parcel): CameraPosition = CameraPosition(parcel)
override fun newArray(size: Int): Array<CameraPosition?> = arrayOfNulls(size)
}
}

View file

@ -1,85 +0,0 @@
package fr.free.nrw.commons;
import org.wikipedia.AppAdapter;
import org.wikipedia.dataclient.SharedPreferenceCookieManager;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.json.GsonMarshaller;
import org.wikipedia.json.GsonUnmarshaller;
import org.wikipedia.login.LoginResult;
import androidx.annotation.NonNull;
import fr.free.nrw.commons.auth.SessionManager;
import fr.free.nrw.commons.kvstore.JsonKvStore;
import okhttp3.OkHttpClient;
public class CommonsAppAdapter extends AppAdapter {
private final int DEFAULT_THUMB_SIZE = 640;
private final String COOKIE_STORE_NAME = "cookie_store";
private final SessionManager sessionManager;
private final JsonKvStore preferences;
CommonsAppAdapter(@NonNull SessionManager sessionManager, @NonNull JsonKvStore preferences) {
this.sessionManager = sessionManager;
this.preferences = preferences;
}
@Override
public String getMediaWikiBaseUrl() {
return BuildConfig.COMMONS_URL;
}
@Override
public String getRestbaseUriFormat() {
return BuildConfig.COMMONS_URL;
}
@Override
public OkHttpClient getOkHttpClient(@NonNull WikiSite wikiSite) {
return OkHttpConnectionFactory.getClient();
}
@Override
public int getDesiredLeadImageDp() {
return DEFAULT_THUMB_SIZE;
}
@Override
public boolean isLoggedIn() {
return sessionManager.isUserLoggedIn();
}
@Override
public String getUserName() {
return sessionManager.getUserName();
}
@Override
public String getPassword() {
return sessionManager.getPassword();
}
@Override
public void updateAccount(@NonNull LoginResult result) {
sessionManager.updateAccount(result);
}
@Override
public SharedPreferenceCookieManager getCookies() {
if (!preferences.contains(COOKIE_STORE_NAME)) {
return null;
}
return GsonUnmarshaller.unmarshal(SharedPreferenceCookieManager.class,
preferences.getString(COOKIE_STORE_NAME, null));
}
@Override
public void setCookies(@NonNull SharedPreferenceCookieManager cookies) {
preferences.putString(COOKIE_STORE_NAME, GsonMarshaller.marshal(cookies));
}
@Override
public boolean logErrorsInsteadOfCrashing() {
return false;
}
}

View file

@ -1,291 +0,0 @@
package fr.free.nrw.commons;
import android.annotation.SuppressLint;
import android.app.Application;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.os.Build;
import android.os.Process;
import android.util.Log;
import androidx.annotation.NonNull;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.imagepipeline.core.ImagePipeline;
import com.facebook.imagepipeline.core.ImagePipelineConfig;
import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher;
import org.acra.ACRA;
import org.acra.annotation.AcraCore;
import org.acra.annotation.AcraDialog;
import org.acra.annotation.AcraMailSender;
import org.acra.data.StringFormat;
import org.wikipedia.AppAdapter;
import org.wikipedia.language.AppLanguageLookUpTable;
import java.io.File;
import javax.inject.Inject;
import javax.inject.Named;
import fr.free.nrw.commons.auth.SessionManager;
import fr.free.nrw.commons.bookmarks.locations.BookmarkLocationsDao;
import fr.free.nrw.commons.bookmarks.pictures.BookmarkPicturesDao;
import fr.free.nrw.commons.category.CategoryDao;
import fr.free.nrw.commons.concurrency.BackgroundPoolExceptionHandler;
import fr.free.nrw.commons.concurrency.ThreadPoolService;
import fr.free.nrw.commons.contributions.ContributionDao;
import fr.free.nrw.commons.data.DBOpenHelper;
import fr.free.nrw.commons.di.ApplicationlessInjection;
import fr.free.nrw.commons.kvstore.JsonKvStore;
import fr.free.nrw.commons.logging.FileLoggingTree;
import fr.free.nrw.commons.logging.LogUtils;
import fr.free.nrw.commons.upload.FileUtils;
import fr.free.nrw.commons.utils.ConfigUtils;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.internal.functions.Functions;
import io.reactivex.plugins.RxJavaPlugins;
import io.reactivex.schedulers.Schedulers;
import timber.log.Timber;
import static org.acra.ReportField.ANDROID_VERSION;
import static org.acra.ReportField.APP_VERSION_CODE;
import static org.acra.ReportField.APP_VERSION_NAME;
import static org.acra.ReportField.PHONE_MODEL;
import static org.acra.ReportField.STACK_TRACE;
import static org.acra.ReportField.USER_COMMENT;
@AcraCore(
buildConfigClass = BuildConfig.class,
resReportSendSuccessToast = R.string.crash_dialog_ok_toast,
reportFormat = StringFormat.KEY_VALUE_LIST,
reportContent = {USER_COMMENT, APP_VERSION_CODE, APP_VERSION_NAME, ANDROID_VERSION, PHONE_MODEL, STACK_TRACE}
)
@AcraMailSender(
mailTo = "commons-app-android-private@googlegroups.com",
reportAsFile = false
)
@AcraDialog(
resTheme = R.style.Theme_AppCompat_Dialog,
resText = R.string.crash_dialog_text,
resTitle = R.string.crash_dialog_title,
resCommentPrompt = R.string.crash_dialog_comment_prompt
)
public class CommonsApplication extends Application {
@Inject SessionManager sessionManager;
@Inject DBOpenHelper dbOpenHelper;
@Inject @Named("default_preferences") JsonKvStore defaultPrefs;
/**
* Constants begin
*/
public static final int OPEN_APPLICATION_DETAIL_SETTINGS = 1001;
public static final String DEFAULT_EDIT_SUMMARY = "Uploaded using [[COM:MOA|Commons Mobile App]]";
public static final String FEEDBACK_EMAIL = "commons-app-android@googlegroups.com";
public static final String FEEDBACK_EMAIL_SUBJECT = "Commons Android App Feedback";
public static final String NOTIFICATION_CHANNEL_ID_ALL = "CommonsNotificationAll";
public static final String FEEDBACK_EMAIL_TEMPLATE_HEADER = "-- Technical information --";
/**
* Constants End
*/
private RefWatcher refWatcher;
private static CommonsApplication INSTANCE;
public static CommonsApplication getInstance() {
return INSTANCE;
}
private AppLanguageLookUpTable languageLookUpTable;
public AppLanguageLookUpTable getLanguageLookUpTable() {
return languageLookUpTable;
}
/**
* Used to declare and initialize various components and dependencies
*/
@Override
public void onCreate() {
super.onCreate();
INSTANCE = this;
ACRA.init(this);
ApplicationlessInjection
.getInstance(this)
.getCommonsApplicationComponent()
.inject(this);
AppAdapter.set(new CommonsAppAdapter(sessionManager, defaultPrefs));
initTimber();
// Set DownsampleEnabled to True to downsample the image in case it's heavy
ImagePipelineConfig config = ImagePipelineConfig.newBuilder(this)
.setDownsampleEnabled(true)
.build();
try {
Fresco.initialize(this, config);
} catch (Exception e) {
Timber.e(e);
// TODO: Remove when we're able to initialize Fresco in test builds.
}
createNotificationChannel(this);
languageLookUpTable = new AppLanguageLookUpTable(this);
// This handler will catch exceptions thrown from Observables after they are disposed,
// or from Observables that are (deliberately or not) missing an onError handler.
RxJavaPlugins.setErrorHandler(Functions.emptyConsumer());
if (setupLeakCanary() == RefWatcher.DISABLED) {
return;
}
// Fire progress callbacks for every 3% of uploaded content
System.setProperty("in.yuvi.http.fluent.PROGRESS_TRIGGER_THRESHOLD", "3.0");
}
/**
* Plants debug and file logging tree.
* Timber lets you plant your own logging trees.
*
*/
private void initTimber() {
boolean isBeta = ConfigUtils.isBetaFlavour();
String logFileName = isBeta ? "CommonsBetaAppLogs" : "CommonsAppLogs";
String logDirectory = LogUtils.getLogDirectory();
FileLoggingTree tree = new FileLoggingTree(
Log.VERBOSE,
logFileName,
logDirectory,
1000,
getFileLoggingThreadPool());
Timber.plant(tree);
Timber.plant(new Timber.DebugTree());
}
public static boolean isRoboUnitTest() {
return "robolectric".equals(Build.FINGERPRINT);
}
private ThreadPoolService getFileLoggingThreadPool() {
return new ThreadPoolService.Builder("file-logging-thread")
.setPriority(Process.THREAD_PRIORITY_LOWEST)
.setPoolSize(1)
.setExceptionHandler(new BackgroundPoolExceptionHandler())
.build();
}
public static void createNotificationChannel(@NonNull Context context) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
NotificationChannel channel = manager.getNotificationChannel(NOTIFICATION_CHANNEL_ID_ALL);
if (channel == null) {
channel = new NotificationChannel(NOTIFICATION_CHANNEL_ID_ALL,
context.getString(R.string.notifications_channel_name_all), NotificationManager.IMPORTANCE_DEFAULT);
manager.createNotificationChannel(channel);
}
}
}
public String getUserAgent() {
return "Commons/" + ConfigUtils.getVersionNameWithSha(this) + " (https://mediawiki.org/wiki/Apps/Commons) Android/" + Build.VERSION.RELEASE;
}
/**
* Helps in setting up LeakCanary library
* @return instance of LeakCanary
*/
protected RefWatcher setupLeakCanary() {
if (LeakCanary.isInAnalyzerProcess(this)) {
return RefWatcher.DISABLED;
}
return LeakCanary.install(this);
}
/**
* Provides a way to get member refWatcher
*
* @param context Application context
* @return application member refWatcher
*/
public static RefWatcher getRefWatcher(Context context) {
CommonsApplication application = (CommonsApplication) context.getApplicationContext();
return application.refWatcher;
}
/**
* clears data of current application
* @param context Application context
* @param logoutListener Implementation of interface LogoutListener
*/
@SuppressLint("CheckResult")
public void clearApplicationData(Context context, LogoutListener logoutListener) {
File cacheDirectory = context.getCacheDir();
File applicationDirectory = new File(cacheDirectory.getParent());
if (applicationDirectory.exists()) {
String[] fileNames = applicationDirectory.list();
for (String fileName : fileNames) {
if (!fileName.equals("lib")) {
FileUtils.deleteFile(new File(applicationDirectory, fileName));
}
}
}
sessionManager.logout()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(() -> {
Timber.d("All accounts have been removed");
clearImageCache();
//TODO: fix preference manager
defaultPrefs.clearAll();
defaultPrefs.putBoolean("firstrun", false);
updateAllDatabases();
logoutListener.onLogoutComplete();
});
}
/**
* Clear all images cache held by Fresco
*/
private void clearImageCache() {
ImagePipeline imagePipeline = Fresco.getImagePipeline();
imagePipeline.clearCaches();
}
/**
* Deletes all tables and re-creates them.
*/
private void updateAllDatabases() {
dbOpenHelper.getReadableDatabase().close();
SQLiteDatabase db = dbOpenHelper.getWritableDatabase();
CategoryDao.Table.onDelete(db);
ContributionDao.Table.onDelete(db);
BookmarkPicturesDao.Table.onDelete(db);
BookmarkLocationsDao.Table.onDelete(db);
}
/**
* Interface used to get log-out events
*/
public interface LogoutListener {
void onLogoutComplete();
}
}

View file

@ -0,0 +1,417 @@
package fr.free.nrw.commons
import android.annotation.SuppressLint
import android.app.Activity
import android.app.NotificationChannel
import android.app.NotificationManager
import android.content.Context
import android.content.Intent
import android.database.sqlite.SQLiteException
import android.os.Build
import android.os.Process
import android.util.Log
import androidx.multidex.MultiDexApplication
import com.facebook.drawee.backends.pipeline.Fresco
import com.facebook.imagepipeline.core.ImagePipelineConfig
import fr.free.nrw.commons.auth.LoginActivity
import fr.free.nrw.commons.auth.SessionManager
import fr.free.nrw.commons.bookmarks.items.BookmarkItemsTable
import fr.free.nrw.commons.bookmarks.pictures.BookmarksTable
import fr.free.nrw.commons.category.CategoryDao
import fr.free.nrw.commons.concurrency.BackgroundPoolExceptionHandler
import fr.free.nrw.commons.concurrency.ThreadPoolService
import fr.free.nrw.commons.contributions.ContributionDao
import fr.free.nrw.commons.data.DBOpenHelper
import fr.free.nrw.commons.di.ApplicationlessInjection
import fr.free.nrw.commons.kvstore.JsonKvStore
import fr.free.nrw.commons.language.AppLanguageLookUpTable
import fr.free.nrw.commons.logging.FileLoggingTree
import fr.free.nrw.commons.logging.LogUtils
import fr.free.nrw.commons.media.CustomOkHttpNetworkFetcher
import fr.free.nrw.commons.settings.Prefs
import fr.free.nrw.commons.upload.FileUtils
import fr.free.nrw.commons.utils.ConfigUtils.getVersionNameWithSha
import fr.free.nrw.commons.utils.ConfigUtils.isBetaFlavour
import fr.free.nrw.commons.wikidata.cookies.CommonsCookieJar
import io.reactivex.Completable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.internal.functions.Functions
import io.reactivex.plugins.RxJavaPlugins
import io.reactivex.schedulers.Schedulers
import org.acra.ACRA.init
import org.acra.ReportField
import org.acra.annotation.AcraCore
import org.acra.annotation.AcraDialog
import org.acra.annotation.AcraMailSender
import org.acra.data.StringFormat
import timber.log.Timber
import timber.log.Timber.DebugTree
import java.io.File
import javax.inject.Inject
import javax.inject.Named
@AcraCore(
buildConfigClass = BuildConfig::class,
resReportSendSuccessToast = R.string.crash_dialog_ok_toast,
reportFormat = StringFormat.KEY_VALUE_LIST,
reportContent = [ReportField.USER_COMMENT, ReportField.APP_VERSION_CODE, ReportField.APP_VERSION_NAME, ReportField.ANDROID_VERSION, ReportField.PHONE_MODEL, ReportField.STACK_TRACE]
)
@AcraMailSender(mailTo = "commons-app-android-private@googlegroups.com", reportAsFile = false)
@AcraDialog(
resTheme = R.style.Theme_AppCompat_Dialog,
resText = R.string.crash_dialog_text,
resTitle = R.string.crash_dialog_title,
resCommentPrompt = R.string.crash_dialog_comment_prompt
)
class CommonsApplication : MultiDexApplication() {
@Inject
lateinit var sessionManager: SessionManager
@Inject
lateinit var dbOpenHelper: DBOpenHelper
@Inject
@field:Named("default_preferences")
lateinit var defaultPrefs: JsonKvStore
@Inject
lateinit var cookieJar: CommonsCookieJar
@Inject
lateinit var customOkHttpNetworkFetcher: CustomOkHttpNetworkFetcher
var languageLookUpTable: AppLanguageLookUpTable? = null
private set
@Inject
lateinit var contributionDao: ContributionDao
/**
* Used to declare and initialize various components and dependencies
*/
override fun onCreate() {
super.onCreate()
instance = this
init(this)
ApplicationlessInjection
.getInstance(this)
.commonsApplicationComponent
.inject(this)
initTimber()
if (!defaultPrefs.getBoolean("has_user_manually_removed_location")) {
var defaultExifTagsSet = defaultPrefs.getStringSet(Prefs.MANAGED_EXIF_TAGS)
if (null == defaultExifTagsSet) {
defaultExifTagsSet = HashSet()
}
defaultExifTagsSet.add(getString(R.string.exif_tag_location))
defaultPrefs.putStringSet(Prefs.MANAGED_EXIF_TAGS, defaultExifTagsSet)
}
// Set DownsampleEnabled to True to downsample the image in case it's heavy
val config = ImagePipelineConfig.newBuilder(this)
.setNetworkFetcher(customOkHttpNetworkFetcher)
.setDownsampleEnabled(true)
.build()
try {
Fresco.initialize(this, config)
} catch (e: Exception) {
Timber.e(e)
// TODO: Remove when we're able to initialize Fresco in test builds.
}
createNotificationChannel(this)
languageLookUpTable = AppLanguageLookUpTable(this)
// This handler will catch exceptions thrown from Observables after they are disposed,
// or from Observables that are (deliberately or not) missing an onError handler.
RxJavaPlugins.setErrorHandler(Functions.emptyConsumer())
// Fire progress callbacks for every 3% of uploaded content
System.setProperty("in.yuvi.http.fluent.PROGRESS_TRIGGER_THRESHOLD", "3.0")
}
/**
* Plants debug and file logging tree. Timber lets you plant your own logging trees.
*/
private fun initTimber() {
val isBeta = isBetaFlavour
val logFileName =
if (isBeta) "CommonsBetaAppLogs" else "CommonsAppLogs"
val logDirectory = LogUtils.getLogDirectory()
//Delete stale logs if they have exceeded the specified size
deleteStaleLogs(logFileName, logDirectory)
val tree = FileLoggingTree(
Log.VERBOSE,
logFileName,
logDirectory,
1000,
fileLoggingThreadPool
)
Timber.plant(tree)
Timber.plant(DebugTree())
}
/**
* Deletes the logs zip file at the specified directory and file locations specified in the
* params
*
* @param logFileName
* @param logDirectory
*/
private fun deleteStaleLogs(logFileName: String, logDirectory: String) {
try {
val file = File("$logDirectory/zip/$logFileName.zip")
if (file.exists() && file.totalSpace > 1000000) { // In Kbs
file.delete()
}
} catch (e: Exception) {
Timber.e(e)
}
}
private val fileLoggingThreadPool: ThreadPoolService
get() = ThreadPoolService.Builder("file-logging-thread")
.setPriority(Process.THREAD_PRIORITY_LOWEST)
.setPoolSize(1)
.setExceptionHandler(BackgroundPoolExceptionHandler())
.build()
val userAgent: String
get() = ("Commons/" + this.getVersionNameWithSha()
+ " (https://mediawiki.org/wiki/Apps/Commons) Android/" + Build.VERSION.RELEASE)
/**
* clears data of current application
*
* @param context Application context
* @param logoutListener Implementation of interface LogoutListener
*/
@SuppressLint("CheckResult")
fun clearApplicationData(context: Context, logoutListener: LogoutListener) {
val cacheDirectory = context.cacheDir
val applicationDirectory = File(cacheDirectory.parent)
if (applicationDirectory.exists()) {
val fileNames = applicationDirectory.list()
for (fileName in fileNames) {
if (fileName != "lib") {
FileUtils.deleteFile(File(applicationDirectory, fileName))
}
}
}
sessionManager.logout()
.andThen(Completable.fromAction { cookieJar.clear() })
.andThen(Completable.fromAction {
Timber.d("All accounts have been removed")
clearImageCache()
//TODO: fix preference manager
defaultPrefs.clearAll()
defaultPrefs.putBoolean("firstrun", false)
updateAllDatabases()
})
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe({ logoutListener.onLogoutComplete() }, { t: Throwable? -> Timber.e(t) })
}
/**
* Clear all images cache held by Fresco
*/
private fun clearImageCache() {
val imagePipeline = Fresco.getImagePipeline()
imagePipeline.clearCaches()
}
/**
* Deletes all tables and re-creates them.
*/
private fun updateAllDatabases() {
dbOpenHelper.readableDatabase.close()
val db = dbOpenHelper.writableDatabase
CategoryDao.Table.onDelete(db)
dbOpenHelper.deleteTable(
db,
DBOpenHelper.CONTRIBUTIONS_TABLE
) //Delete the contributions table in the existing db on older versions
dbOpenHelper.deleteTable(
db,
DBOpenHelper.BOOKMARKS_LOCATIONS
)
try {
contributionDao.deleteAll()
} catch (e: SQLiteException) {
Timber.e(e)
}
BookmarksTable.onDelete(db)
BookmarkItemsTable.onDelete(db)
}
/**
* Interface used to get log-out events
*/
interface LogoutListener {
fun onLogoutComplete()
}
/**
* This listener is responsible for handling post-logout actions, specifically invoking the LoginActivity
* with relevant intent parameters. It does not perform the actual logout operation.
*/
open class BaseLogoutListener : LogoutListener {
var ctx: Context
var loginMessage: String? = null
var userName: String? = null
/**
* Constructor for BaseLogoutListener.
*
* @param ctx Application context
*/
constructor(ctx: Context) {
this.ctx = ctx
}
/**
* Constructor for BaseLogoutListener
*
* @param ctx The application context, used for invoking the LoginActivity and passing relevant intent parameters as part of the post-logout process.
* @param loginMessage Message to be displayed on the login page
* @param loginUsername Username to be pre-filled on the login page
*/
constructor(
ctx: Context, loginMessage: String?,
loginUsername: String?
) {
this.ctx = ctx
this.loginMessage = loginMessage
this.userName = loginUsername
}
override fun onLogoutComplete() {
Timber.d("Logout complete callback received.")
val loginIntent = Intent(ctx, LoginActivity::class.java)
loginIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK)
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
if (loginMessage != null) {
loginIntent.putExtra(LOGIN_MESSAGE_INTENT_KEY, loginMessage)
}
if (userName != null) {
loginIntent.putExtra(LOGIN_USERNAME_INTENT_KEY, userName)
}
ctx.startActivity(loginIntent)
}
}
/**
* This class is an extension of BaseLogoutListener, providing additional functionality or customization
* for the logout process. It includes specific actions to be taken during logout, such as handling redirection to the login screen.
*/
class ActivityLogoutListener : BaseLogoutListener {
var activity: Activity
/**
* Constructor for ActivityLogoutListener.
*
* @param activity The activity context from which the logout is initiated. Used to perform actions such as finishing the activity.
* @param ctx The application context, used for invoking the LoginActivity and passing relevant intent parameters as part of the post-logout process.
*/
constructor(activity: Activity, ctx: Context) : super(ctx) {
this.activity = activity
}
/**
* Constructor for ActivityLogoutListener with additional parameters for the login screen.
*
* @param activity The activity context from which the logout is initiated. Used to perform actions such as finishing the activity.
* @param ctx The application context, used for invoking the LoginActivity and passing relevant intent parameters as part of the post-logout process.
* @param loginMessage Message to be displayed on the login page after logout.
* @param loginUsername Username to be pre-filled on the login page after logout.
*/
constructor(
activity: Activity, ctx: Context?,
loginMessage: String?, loginUsername: String?
) : super(activity, loginMessage, loginUsername) {
this.activity = activity
}
override fun onLogoutComplete() {
super.onLogoutComplete()
activity.finish()
}
}
companion object {
const val LOGIN_MESSAGE_INTENT_KEY: String = "loginMessage"
const val LOGIN_USERNAME_INTENT_KEY: String = "loginUsername"
const val IS_LIMITED_CONNECTION_MODE_ENABLED: String = "is_limited_connection_mode_enabled"
/**
* Constants begin
*/
const val OPEN_APPLICATION_DETAIL_SETTINGS: Int = 1001
const val DEFAULT_EDIT_SUMMARY: String = "Uploaded using [[COM:MOA|Commons Mobile App]]"
const val FEEDBACK_EMAIL: String = "commons-app-android@googlegroups.com"
const val FEEDBACK_EMAIL_SUBJECT: String = "Commons Android App Feedback"
const val REPORT_EMAIL: String = "commons-app-android-private@googlegroups.com"
const val REPORT_EMAIL_SUBJECT: String = "Report a violation"
const val NOTIFICATION_CHANNEL_ID_ALL: String = "CommonsNotificationAll"
const val FEEDBACK_EMAIL_TEMPLATE_HEADER: String = "-- Technical information --"
/**
* Constants End
*/
@JvmStatic
lateinit var instance: CommonsApplication
private set
@JvmField
var isPaused: Boolean = false
@JvmStatic
fun createNotificationChannel(context: Context) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
val manager = context
.getSystemService(NOTIFICATION_SERVICE) as NotificationManager
var channel = manager
.getNotificationChannel(NOTIFICATION_CHANNEL_ID_ALL)
if (channel == null) {
channel = NotificationChannel(
NOTIFICATION_CHANNEL_ID_ALL,
context.getString(R.string.notifications_channel_name_all),
NotificationManager.IMPORTANCE_DEFAULT
)
manager.createNotificationChannel(channel)
}
}
}
}
}

View file

@ -1,74 +0,0 @@
package fr.free.nrw.commons;
import android.content.Intent;
import android.os.Binder;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import fr.free.nrw.commons.di.CommonsDaggerService;
public abstract class HandlerService<T> extends CommonsDaggerService {
private volatile Looper threadLooper;
private volatile ServiceHandler threadHandler;
private String serviceName;
private final class ServiceHandler extends Handler {
public ServiceHandler(Looper looper) {
super(looper);
}
@Override
public void handleMessage(Message msg) {
//FIXME: Google Photos bug
handle(msg.what, (T)msg.obj);
stopSelf(msg.arg1);
}
}
@Override
public void onDestroy() {
threadLooper.quit();
super.onDestroy();
}
public class HandlerServiceLocalBinder extends Binder {
public HandlerService getService() {
return HandlerService.this;
}
}
private final IBinder localBinder = new HandlerServiceLocalBinder();
@Override
public IBinder onBind(Intent intent) {
return localBinder;
}
protected HandlerService(String serviceName) {
this.serviceName = serviceName;
}
@Override
public void onCreate() {
super.onCreate();
HandlerThread thread = new HandlerThread(serviceName);
thread.start();
threadLooper = thread.getLooper();
threadHandler = new ServiceHandler(threadLooper);
}
private void postMessage(int type, T t) {
Message msg = threadHandler.obtainMessage(type);
msg.obj = t;
threadHandler.sendMessage(msg);
}
public void queue(int what, T t) {
postMessage(what, t);
}
protected abstract void handle(int what, T t);
}

View file

@ -1,79 +0,0 @@
package fr.free.nrw.commons;
import androidx.annotation.Nullable;
/**
* represents Licence object
*/
public class License {
private String key;
private String template;
private String url;
private String name;
/**
* Constructs a new instance of License.
*
* @param key license key
* @param template license template
* @param url license URL
* @param name licence name
*
* @throws RuntimeException if License.key or Licence.template is null
*/
public License(String key, String template, String url, String name) {
if (key == null) {
throw new RuntimeException("License.key must not be null");
}
if (template == null) {
throw new RuntimeException("License.template must not be null");
}
this.key = key;
this.template = template;
this.url = url;
this.name = name;
}
/**
* Gets the license key.
* @return license key as a String.
*/
public String getKey() {
return key;
}
/**
* Gets the license template.
* @return license template as a String.
*/
public String getTemplate() {
return template;
}
/**
* Gets the license name. If name is null, return license key.
* @return license name as string. if name null, license key as String
*/
public String getName() {
if (name == null) {
// hack
return getKey();
} else {
return name;
}
}
/**
* Gets the license URL
*
* @param language license language
* @return URL
*/
public @Nullable String getUrl(String language) {
if (url == null) {
return null;
} else {
return url.replace("$lang", language);
}
}
}

View file

@ -0,0 +1,46 @@
package fr.free.nrw.commons
import fr.free.nrw.commons.location.LatLng
import fr.free.nrw.commons.nearby.Place
abstract class MapController {
/**
* We pass this variable as a group of placeList and boundaryCoordinates
*/
inner class NearbyPlacesInfo {
@JvmField
var placeList: List<Place> = emptyList() // List of nearby places
@JvmField
var boundaryCoordinates: Array<LatLng> = emptyArray() // Corners of nearby area
@JvmField
var currentLatLng: LatLng? = null // Current location when this places are populated
@JvmField
var searchLatLng: LatLng? = null // Search location for finding this places
@JvmField
var mediaList: List<Media>? = null // Search location for finding this places
}
/**
* We pass this variable as a group of placeList and boundaryCoordinates
*/
inner class ExplorePlacesInfo {
@JvmField
var explorePlaceList: List<Place> = emptyList() // List of nearby places
@JvmField
var boundaryCoordinates: Array<LatLng> = emptyArray() // Corners of nearby area
@JvmField
var currentLatLng: LatLng? = null // Current location when this places are populated
@JvmField
var searchLatLng: LatLng? = null // Search location for finding this places
@JvmField
var mediaList: List<Media> = emptyList() // Search location for finding this places
}
}

View file

@ -1,559 +0,0 @@
package fr.free.nrw.commons;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import org.apache.commons.lang3.StringUtils;
import org.wikipedia.dataclient.mwapi.MwQueryPage;
import org.wikipedia.gallery.ExtMetadata;
import org.wikipedia.gallery.ImageInfo;
import org.wikipedia.page.PageTitle;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import fr.free.nrw.commons.location.LatLng;
import fr.free.nrw.commons.utils.CommonsDateUtil;
import fr.free.nrw.commons.utils.MediaDataExtractorUtil;
public class Media implements Parcelable {
public static final Media EMPTY = new Media("");
public static Creator<Media> CREATOR = new Creator<Media>() {
@Override
public Media createFromParcel(Parcel parcel) {
return new Media(parcel);
}
@Override
public Media[] newArray(int i) {
return new Media[0];
}
};
// Primary metadata fields
protected Uri localUri;
private String thumbUrl;
protected String imageUrl;
protected String filename;
protected String description; // monolingual description on input...
protected String discussion;
protected long dataLength;
protected Date dateCreated;
protected @Nullable Date dateUploaded;
protected int width;
protected int height;
protected String license;
protected String licenseUrl;
protected String creator;
protected ArrayList<String> categories; // as loaded at runtime?
protected boolean requestedDeletion;
private Map<String, String> descriptions; // multilingual descriptions as loaded
private HashMap<String, Object> tags = new HashMap<>();
private @Nullable LatLng coordinates;
/**
* Provides local constructor
*/
protected Media() {
this.categories = new ArrayList<>();
this.descriptions = new HashMap<>();
}
/**
* Provides a minimal constructor
*
* @param filename Media filename
*/
public Media(String filename) {
this();
this.filename = filename;
}
/**
* Provide Media constructor
* @param localUri Media URI
* @param imageUrl Media image URL
* @param filename Media filename
* @param description Media description
* @param dataLength Media date length
* @param dateCreated Media creation date
* @param dateUploaded Media date uploaded
* @param creator Media creator
*/
public Media(Uri localUri, String imageUrl, String filename, String description,
long dataLength, Date dateCreated, Date dateUploaded, String creator) {
this();
this.localUri = localUri;
this.thumbUrl = imageUrl;
this.imageUrl = imageUrl;
this.filename = filename;
this.description = description;
this.dataLength = dataLength;
this.dateCreated = dateCreated;
this.dateUploaded = dateUploaded;
this.creator = creator;
this.categories = new ArrayList<>();
this.descriptions = new HashMap<>();
}
@SuppressWarnings("unchecked")
public Media(Parcel in) {
localUri = in.readParcelable(Uri.class.getClassLoader());
thumbUrl = in.readString();
imageUrl = in.readString();
filename = in.readString();
description = in.readString();
dataLength = in.readLong();
dateCreated = (Date) in.readSerializable();
dateUploaded = (Date) in.readSerializable();
creator = in.readString();
tags = (HashMap<String, Object>) in.readSerializable();
width = in.readInt();
height = in.readInt();
license = in.readString();
if (categories != null) {
in.readStringList(categories);
}
descriptions = in.readHashMap(ClassLoader.getSystemClassLoader());
}
/**
* Creating Media object from MWQueryPage.
* Earlier only basic details were set for the media object but going forward,
* a full media object(with categories, descriptions, coordinates etc) can be constructed using this method
*
* @param page response from the API
* @return Media object
*/
@Nullable
public static Media from(MwQueryPage page) {
ImageInfo imageInfo = page.imageInfo();
if (imageInfo == null) {
return null;
}
ExtMetadata metadata = imageInfo.getMetadata();
if (metadata == null) {
Media media = new Media(null, imageInfo.getOriginalUrl(),
page.title(), "", 0, null, null, null);
if (!StringUtils.isBlank(imageInfo.getThumbUrl())) {
media.setThumbUrl(imageInfo.getThumbUrl());
}
return media;
}
Media media = new Media(null,
imageInfo.getOriginalUrl(),
page.title(),
"",
0,
safeParseDate(metadata.dateTime()),
safeParseDate(metadata.dateTime()),
getArtist(metadata)
);
if (!StringUtils.isBlank(imageInfo.getThumbUrl())) {
media.setThumbUrl(imageInfo.getThumbUrl());
}
String language = Locale.getDefault().getLanguage();
if (StringUtils.isBlank(language)) {
language = "default";
}
media.setDescriptions(Collections.singletonMap(language, metadata.imageDescription()));
media.setCategories(MediaDataExtractorUtil.extractCategoriesFromList(metadata.getCategories()));
String latitude = metadata.getGpsLatitude();
String longitude = metadata.getGpsLongitude();
if (!StringUtils.isBlank(latitude) && !StringUtils.isBlank(longitude)) {
LatLng latLng = new LatLng(Double.parseDouble(latitude), Double.parseDouble(longitude), 0);
media.setCoordinates(latLng);
}
media.setLicenseInformation(metadata.licenseShortName(), metadata.licenseUrl());
return media;
}
/**
* This method extracts the Commons Username from the artist HTML information
* @param metadata
* @return
*/
private static String getArtist(ExtMetadata metadata) {
try {
String artistHtml = metadata.artist();
return artistHtml.substring(artistHtml.indexOf("title=\""), artistHtml.indexOf("\">"))
.replace("title=\"User:", "");
} catch (Exception ex) {
return "";
}
}
public String getThumbUrl() {
return thumbUrl;
}
/**
* Gets tag of media
* @param key Media key
* @return Media tag
*/
public Object getTag(String key) {
return tags.get(key);
}
/**
* Modifies( or creates a) tag of media
* @param key Media key
* @param value Media value
*/
public void setTag(String key, Object value) {
tags.put(key, value);
}
/**
* Gets media display title
* @return Media title
*/
@NonNull public String getDisplayTitle() {
return filename != null ? getPageTitle().getDisplayTextWithoutNamespace().replaceFirst("[.][^.]+$", "") : "";
}
/**
* Gets file page title
* @return New media page title
*/
@NonNull public PageTitle getPageTitle() {
return Utils.getPageTitle(getFilename());
}
/**
* Gets local URI
* @return Media local URI
*/
public Uri getLocalUri() {
return localUri;
}
/**
* Gets image URL
* can be null.
* @return Image URL
*/
@Nullable
public String getImageUrl() {
return imageUrl;
}
/**
* Gets the name of the file.
* @return file name as a string
*/
public String getFilename() {
return filename;
}
/**
* Sets the name of the file.
* @param filename the new name of the file
*/
public void setFilename(String filename) {
this.filename = filename;
}
/**
* Sets the discussion of the file.
* @param discussion
*/
public void setDiscussion(String discussion) {
this.discussion = discussion;
}
/**
* Gets the file discussion as a string.
* @return file discussion as a string
*/
public String getDiscussion() {
return discussion;
}
/**
* Gets the file description.
* @return file description as a string
*/
public String getDescription() {
return description;
}
/**
* Sets the file description.
* @param description the new description of the file
*/
public void setDescription(String description) {
this.description = description;
}
/**
* Gets the dataLength of the file.
* @return file dataLength as a long
*/
public long getDataLength() {
return dataLength;
}
/**
* Sets the dataLength of the file.
* @param dataLength as a long
*/
public void setDataLength(long dataLength) {
this.dataLength = dataLength;
}
/**
* Gets the creation date of the file.
* @return creation date as a Date
*/
public Date getDateCreated() {
return dateCreated;
}
/**
* Sets the creation date of the file.
* @param date creation date as a Date
*/
public void setDateCreated(Date date) {
this.dateCreated = date;
}
/**
* Gets the upload date of the file.
* Can be null.
* @return upload date as a Date
*/
public @Nullable
Date getDateUploaded() {
return dateUploaded;
}
/**
* Gets the name of the creator of the file.
* @return creator name as a String
*/
public String getCreator() {
return creator;
}
/**
* Sets the creator name of the file.
* @param creator creator name as a string
*/
public void setCreator(String creator) {
this.creator = creator;
}
/**
* Gets the width of the media.
* @return file width as an int
*/
public int getWidth() {
return width;
}
/**
* Sets the width of the media.
* @param width file width as an int
*/
public void setWidth(int width) {
this.width = width;
}
/**
* Gets the height of the media.
* @return file height as an int
*/
public int getHeight() {
return height;
}
/**
* Sets the height of the media.
* @param height file height as an int
*/
public void setHeight(int height) {
this.height = height;
}
/**
* Gets the license name of the file.
* @return license as a String
*/
public String getLicense() {
return license;
}
public void setThumbUrl(String thumbUrl) {
this.thumbUrl = thumbUrl;
}
public String getLicenseUrl() {
return licenseUrl;
}
/**
* Sets the license name of the file.
* @param license license name as a String
*/
public void setLicenseInformation(String license, String licenseUrl) {
this.license = license;
if (!licenseUrl.startsWith("http://") && !licenseUrl.startsWith("https://")) {
licenseUrl = "https://" + licenseUrl;
}
this.licenseUrl = licenseUrl;
}
/**
* Gets the coordinates of where the file was created.
* @return file coordinates as a LatLng
*/
public @Nullable
LatLng getCoordinates() {
return coordinates;
}
/**
* Sets the coordinates of where the file was created.
* @param coordinates file coordinates as a LatLng
*/
public void setCoordinates(@Nullable LatLng coordinates) {
this.coordinates = coordinates;
}
/**
* Gets the categories the file falls under.
* @return file categories as an ArrayList of Strings
*/
@SuppressWarnings("unchecked")
public ArrayList<String> getCategories() {
return (ArrayList<String>) categories.clone(); // feels dirty
}
/**
* Sets the categories the file falls under.
* </p>
* Does not append: i.e. will clear the current categories
* and then add the specified ones.
* @param categories file categories as a list of Strings
*/
public void setCategories(List<String> categories) {
this.categories.clear();
this.categories.addAll(categories);
}
/**
* Modifies (or sets) media descriptions
* @param descriptions Media descriptions
*/
void setDescriptions(Map<String, String> descriptions) {
this.descriptions.clear();
this.descriptions.putAll(descriptions);
}
/**
* Gets media description in preferred language
* @param preferredLanguage Language preferred
* @return Description in preferred language
*/
public String getDescription(String preferredLanguage) {
if (descriptions.containsKey(preferredLanguage)) {
// See if the requested language is there.
return descriptions.get(preferredLanguage);
} else if (descriptions.containsKey("en")) {
// Ah, English. Language of the world, until the Chinese crush us.
return descriptions.get("en");
} else if (descriptions.containsKey("default")) {
// No languages marked...
return descriptions.get("default");
} else {
// FIXME: return the first available non-English description?
return "";
}
}
@Nullable private static Date safeParseDate(String dateStr) {
try {
return CommonsDateUtil.getIso8601DateFormatShort().parse(dateStr);
} catch (ParseException e) {
return null;
}
}
/**
* Method of Parcelable interface
* @return zero
*/
@Override
public int describeContents() {
return 0;
}
/**
* Creates a way to transfer information between two or more
* activities.
* @param parcel Instance of Parcel
* @param flags Parcel flag
*/
@Override
public void writeToParcel(Parcel parcel, int flags) {
parcel.writeParcelable(localUri, flags);
parcel.writeString(thumbUrl);
parcel.writeString(imageUrl);
parcel.writeString(filename);
parcel.writeString(description);
parcel.writeLong(dataLength);
parcel.writeSerializable(dateCreated);
parcel.writeSerializable(dateUploaded);
parcel.writeString(creator);
parcel.writeSerializable(tags);
parcel.writeInt(width);
parcel.writeInt(height);
parcel.writeString(license);
parcel.writeStringList(categories);
parcel.writeMap(descriptions);
}
/**
* Set requested deletion to true
*/
public void setRequestedDeletion(){
requestedDeletion = true;
}
/**
* Get the value of requested deletion
* @return boolean requestedDeletion
*/
public boolean getRequestedDeletion(){
return requestedDeletion;
}
/**
* Sets the license name of the file.
*
* @param license license name as a String
*/
public void setLicense(String license) {
this.license = license;
}
}

View file

@ -0,0 +1,206 @@
package fr.free.nrw.commons
import android.os.Parcelable
import fr.free.nrw.commons.BuildConfig.COMMONS_URL
import fr.free.nrw.commons.location.LatLng
import fr.free.nrw.commons.wikidata.model.WikiSite
import fr.free.nrw.commons.wikidata.model.page.PageTitle
import kotlinx.parcelize.IgnoredOnParcel
import kotlinx.parcelize.Parcelize
import java.util.Date
import java.util.Locale
import java.util.UUID
@Parcelize
class Media constructor(
/**
* @return pageId for the current media object
* Wikibase Identifier associated with media files
*/
var pageId: String = UUID.randomUUID().toString(),
var thumbUrl: String? = null,
/**
* Gets image URL
* @return Image URL
*/
var imageUrl: String? = null,
/**
* Gets the name of the file.
* @return file name as a string
*/
var filename: String? = null,
/**
* The fallback description of the file, used if no other description is provided.
*/
var fallbackDescription: String? = null,
/**
* Gets the upload date of the file.
* Can be null.
* @return upload date as a Date
*/
var dateUploaded: Date? = null,
/**
* The license name of the file.
*/
var license: String? = null,
/**
* The URL corresponding to the license.
*/
var licenseUrl: String? = null,
/**
* The name of the creator of the file.
*/
var author: String? = null,
/**
* The username of the uploader.
*/
var user: String? = null,
/**
* The full name of the file's creator, if different from username.
*/
var creatorName: String? = null,
/**
* Gets the categories the file falls under.
* @return file categories as an ArrayList of Strings
*/
var categories: List<String>? = null,
/**
* Gets the coordinates of where the file was created.
* @return file coordinates as a LatLng
*/
var coordinates: LatLng? = null,
var captions: Map<String, String> = emptyMap(),
var descriptions: Map<String, String> = emptyMap(),
var depictionIds: List<String> = emptyList(),
var creatorIds: List<String> = emptyList(),
/**
* This field was added to find non-hidden categories
* Stores the mapping of category title to hidden attribute
* Example: "Mountains" => false, "CC-BY-SA-2.0" => true
*/
var categoriesHiddenStatus: Map<String, Boolean> = emptyMap(),
) : Parcelable {
constructor(
captions: Map<String, String>,
categories: List<String>?,
filename: String?,
fallbackDescription: String?,
author: String?,
user: String?,
) : this(
filename = filename,
fallbackDescription = fallbackDescription,
dateUploaded = Date(),
author = author,
user = user,
categories = categories,
captions = captions,
)
constructor(
captions: Map<String, String>,
categories: List<String>?,
filename: String?,
fallbackDescription: String?,
author: String?,
user: String?,
dateUploaded: Date? = Date(),
license: String? = null,
licenseUrl: String? = null,
imageUrl: String? = null,
thumbUrl: String? = null,
coordinates: LatLng? = null,
descriptions: Map<String, String> = emptyMap(),
depictionIds: List<String> = emptyList(),
categoriesHiddenStatus: Map<String, Boolean> = emptyMap()
) : this(
pageId = UUID.randomUUID().toString(),
filename = filename,
fallbackDescription = fallbackDescription,
dateUploaded = dateUploaded,
author = author,
user = user,
categories = categories,
captions = captions,
license = license,
licenseUrl = licenseUrl,
imageUrl = imageUrl,
thumbUrl = thumbUrl,
coordinates = coordinates,
descriptions = descriptions,
depictionIds = depictionIds,
categoriesHiddenStatus = categoriesHiddenStatus
)
/**
* Returns Author if it's not null or empty, otherwise
* returns user
* @return Author or User
*/
@Deprecated("Use user for uploader username. Use attributedAuthor() for attribution. Note that the uploader may not be the creator/author.")
fun getAuthorOrUser(): String? {
return if (!author.isNullOrEmpty()) {
author
} else{
user
}
}
/**
* Returns author if it's not null or empty, otherwise
* returns creator name
* @return name of author or creator
*/
fun getAttributedAuthor(): String? {
return if (!author.isNullOrEmpty()) {
author
} else{
creatorName
}
}
/**
* Gets media display title
* @return Media title
*/
val displayTitle: String
get() =
if (filename != null) {
pageTitle.displayTextWithoutNamespace.replaceFirst("[.][^.]+$".toRegex(), "")
} else {
""
}
/**
* Gets file page title
* @return New media page title
*/
val pageTitle: PageTitle
get() = PageTitle(filename!!, WikiSite(COMMONS_URL))
/**
* Returns wikicode to use the media file on a MediaWiki site
* @return
*/
val wikiCode: String
get() = String.format("[[%s|thumb|%s]]", filename, mostRelevantCaption)
val mostRelevantCaption: String
get() =
captions[Locale.getDefault().language]
?: captions.values.firstOrNull()
?: displayTitle
/**
* Gets the categories the file falls under.
* @return file categories as an ArrayList of Strings
*/
@IgnoredOnParcel
var addedCategories: List<String>? = null
// TODO added categories should be removed. It is added for a short fix. On category update,
// categories should be re-fetched instead
get() = field // getter
set(value) {
field = value
} // setter
}

View file

@ -1,72 +0,0 @@
package fr.free.nrw.commons;
import androidx.core.text.HtmlCompat;
import javax.inject.Inject;
import javax.inject.Singleton;
import fr.free.nrw.commons.media.MediaClient;
import fr.free.nrw.commons.mwapi.OkHttpJsonApiClient;
import io.reactivex.Single;
import timber.log.Timber;
/**
* Fetch additional media data from the network that we don't store locally.
*
* This includes things like category lists and multilingual descriptions,
* which are not intrinsic to the media and may change due to editing.
*/
@Singleton
public class MediaDataExtractor {
private final OkHttpJsonApiClient okHttpJsonApiClient;
private final MediaClient mediaClient;
@Inject
public MediaDataExtractor(OkHttpJsonApiClient okHttpJsonApiClient,
MediaClient mediaClient) {
this.okHttpJsonApiClient = okHttpJsonApiClient;
this.mediaClient = mediaClient;
}
/**
* Simplified method to extract all details required to show media details.
* It fetches media object, deletion status and talk page for the filename
* @param filename for which the details are to be fetched
* @return full Media object with all details including deletion status and talk page
*/
public Single<Media> fetchMediaDetails(String filename) {
Single<Media> mediaSingle = getMediaFromFileName(filename);
Single<Boolean> pageExistsSingle = mediaClient.checkPageExistsUsingTitle("Commons:Deletion_requests/" + filename);
Single<String> discussionSingle = getDiscussion(filename);
return Single.zip(mediaSingle, pageExistsSingle, discussionSingle, (media, deletionStatus, discussion) -> {
media.setDiscussion(discussion);
if (deletionStatus) {
media.setRequestedDeletion();
}
return media;
});
}
/**
* Method can be used to fetch media for a given filename
* @param filename Eg. File:Test.jpg
* @return return data rich Media object
*/
public Single<Media> getMediaFromFileName(String filename) {
return mediaClient.getMedia(filename);
}
/**
* Fetch talk page from the MediaWiki API
* @param filename
* @return
*/
private Single<String> getDiscussion(String filename) {
return mediaClient.getPageHtml(filename.replace("File", "File talk"))
.map(discussion -> HtmlCompat.fromHtml(discussion, HtmlCompat.FROM_HTML_MODE_LEGACY).toString())
.onErrorReturn(throwable -> {
Timber.e(throwable, "Error occurred while fetching discussion");
return "";
});
}
}

View file

@ -0,0 +1,72 @@
package fr.free.nrw.commons
import androidx.core.text.HtmlCompat
import fr.free.nrw.commons.media.IdAndLabels
import fr.free.nrw.commons.media.MediaClient
import fr.free.nrw.commons.media.PAGE_ID_PREFIX
import io.reactivex.Single
import timber.log.Timber
import javax.inject.Inject
import javax.inject.Singleton
/**
* Fetch additional media data from the network that we don't store locally.
*
*
* This includes things like category lists and multilingual descriptions, which are not intrinsic
* to the media and may change due to editing.
*/
@Singleton
class MediaDataExtractor
@Inject
constructor(
private val mediaClient: MediaClient,
) {
fun fetchDepictionIdsAndLabels(media: Media) =
mediaClient
.getEntities(media.depictionIds)
.map {
it
.entities()
.mapValues { entry -> entry.value.labels().mapValues { it.value.value() } }
}.map { it.map { (key, value) -> IdAndLabels(key, value) } }
.onErrorReturn { emptyList() }
fun fetchCreatorIdsAndLabels(media: Media) =
mediaClient
.getEntities(media.creatorIds)
.map {
it
.entities()
.mapValues { entry -> entry.value.labels().mapValues { it.value.value() } }
}.map { it.map { (key, value) -> IdAndLabels(key, value) } }
.onErrorReturn { emptyList() }
fun checkDeletionRequestExists(media: Media) = mediaClient.checkPageExistsUsingTitle("Commons:Deletion_requests/" + media.filename)
fun fetchDiscussion(media: Media) =
mediaClient
.getPageHtml(media.filename!!.replace("File", "File talk"))
.map { HtmlCompat.fromHtml(it, HtmlCompat.FROM_HTML_MODE_LEGACY).toString() }
.onErrorReturn {
Timber.d("Error occurred while fetching discussion")
""
}
fun refresh(media: Media): Single<Media> =
Single.ambArray(
mediaClient
.getMediaById(PAGE_ID_PREFIX + media.pageId)
.onErrorResumeNext { Single.never() },
mediaClient
.getMediaSuppressingErrors(media.filename)
.onErrorResumeNext { Single.never() },
)
fun getHtmlOfPage(title: String) = mediaClient.getPageHtml(title)
/**
* Fetches wikitext from mediaClient
*/
fun getCurrentWikiText(title: String) = mediaClient.getCurrentWikiText(title)
}

View file

@ -1,8 +0,0 @@
package fr.free.nrw.commons;
/**
* Base interface for all the views
*/
public interface MvpView {
void showMessage(String message);
}

View file

@ -1,72 +0,0 @@
package fr.free.nrw.commons;
import androidx.annotation.NonNull;
import org.wikipedia.dataclient.SharedPreferenceCookieManager;
import org.wikipedia.dataclient.okhttp.HttpStatusException;
import java.io.File;
import java.io.IOException;
import okhttp3.Cache;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import okhttp3.logging.HttpLoggingInterceptor;
public final class OkHttpConnectionFactory {
private static final String CACHE_DIR_NAME = "okhttp-cache";
private static final long NET_CACHE_SIZE = 64 * 1024 * 1024;
@NonNull private static final Cache NET_CACHE = new Cache(new File(CommonsApplication.getInstance().getCacheDir(),
CACHE_DIR_NAME), NET_CACHE_SIZE);
@NonNull private static OkHttpClient CLIENT = createClient();
@NonNull public static OkHttpClient getClient() {
return CLIENT;
}
@NonNull
private static OkHttpClient createClient() {
return new OkHttpClient.Builder()
.cookieJar(SharedPreferenceCookieManager.getInstance())
.cache(NET_CACHE)
.addInterceptor(getLoggingInterceptor())
.addInterceptor(new UnsuccessfulResponseInterceptor())
.addInterceptor(new CommonHeaderRequestInterceptor())
.build();
}
private static HttpLoggingInterceptor getLoggingInterceptor() {
HttpLoggingInterceptor httpLoggingInterceptor = new HttpLoggingInterceptor()
.setLevel(HttpLoggingInterceptor.Level.BASIC);
httpLoggingInterceptor.redactHeader("Authorization");
httpLoggingInterceptor.redactHeader("Cookie");
return httpLoggingInterceptor;
}
private static class CommonHeaderRequestInterceptor implements Interceptor {
@Override @NonNull public Response intercept(@NonNull Chain chain) throws IOException {
Request request = chain.request().newBuilder()
.header("User-Agent", CommonsApplication.getInstance().getUserAgent())
.build();
return chain.proceed(request);
}
}
public static class UnsuccessfulResponseInterceptor implements Interceptor {
@Override @NonNull public Response intercept(@NonNull Chain chain) throws IOException {
Response rsp = chain.proceed(chain.request());
if (rsp.isSuccessful()) {
return rsp;
}
throw new HttpStatusException(rsp);
}
}
private OkHttpConnectionFactory() {
}
}

View file

@ -0,0 +1,135 @@
package fr.free.nrw.commons
import androidx.annotation.VisibleForTesting
import fr.free.nrw.commons.wikidata.GsonUtil
import fr.free.nrw.commons.wikidata.cookies.CommonsCookieJar
import fr.free.nrw.commons.wikidata.mwapi.MwErrorResponse
import fr.free.nrw.commons.wikidata.mwapi.MwIOException
import fr.free.nrw.commons.wikidata.mwapi.MwLegacyServiceError
import okhttp3.Cache
import okhttp3.Interceptor
import okhttp3.OkHttpClient
import okhttp3.Request
import okhttp3.Response
import okhttp3.logging.HttpLoggingInterceptor
import timber.log.Timber
import java.io.File
import java.io.IOException
import java.util.concurrent.TimeUnit
object OkHttpConnectionFactory {
private const val CACHE_DIR_NAME = "okhttp-cache"
private const val NET_CACHE_SIZE = (64 * 1024 * 1024).toLong()
@VisibleForTesting
var CLIENT: OkHttpClient? = null
fun getClient(cookieJar: CommonsCookieJar): OkHttpClient {
if (CLIENT == null) {
CLIENT = createClient(cookieJar)
}
return CLIENT!!
}
private fun createClient(cookieJar: CommonsCookieJar): OkHttpClient {
return OkHttpClient.Builder()
.cookieJar(cookieJar)
.cache(
if (CommonsApplication.instance != null) Cache(
File(CommonsApplication.instance.cacheDir, CACHE_DIR_NAME),
NET_CACHE_SIZE
) else null
)
.connectTimeout(120, TimeUnit.SECONDS)
.writeTimeout(120, TimeUnit.SECONDS)
.readTimeout(120, TimeUnit.SECONDS)
.addInterceptor(HttpLoggingInterceptor().apply {
setLevel(HttpLoggingInterceptor.Level.BASIC)
redactHeader("Authorization")
redactHeader("Cookie")
})
.addInterceptor(UnsuccessfulResponseInterceptor())
.addInterceptor(CommonHeaderRequestInterceptor())
.build()
}
}
class CommonHeaderRequestInterceptor : Interceptor {
@Throws(IOException::class)
override fun intercept(chain: Interceptor.Chain): Response {
val request = chain.request().newBuilder()
.header("User-Agent", CommonsApplication.instance.userAgent)
.build()
return chain.proceed(request)
}
}
private const val SUPPRESS_ERROR_LOG = "x-commons-suppress-error-log"
const val SUPPRESS_ERROR_LOG_HEADER: String = "$SUPPRESS_ERROR_LOG: true"
private class UnsuccessfulResponseInterceptor : Interceptor {
@Throws(IOException::class)
override fun intercept(chain: Interceptor.Chain): Response {
val rq = chain.request()
// If the request contains our special "suppress errors" header, make note of it
// but don't pass that on to the server.
val suppressErrors = rq.headers.names().contains(SUPPRESS_ERROR_LOG)
val request = rq.newBuilder()
.removeHeader(SUPPRESS_ERROR_LOG)
.build()
val rsp = chain.proceed(request)
// Do not intercept certain requests and let the caller handle the errors
if (isExcludedUrl(chain.request())) {
return rsp
}
if (rsp.isSuccessful) {
try {
rsp.peekBody(ERRORS_PREFIX.length.toLong()).use { responseBody ->
if (ERRORS_PREFIX == responseBody.string()) {
rsp.body.use { body ->
val bodyString = body!!.string()
throw MwIOException(
"MediaWiki API returned error: $bodyString",
GsonUtil.defaultGson.fromJson(
bodyString,
MwErrorResponse::class.java
).error!!,
)
}
}
}
} catch (e: MwIOException) {
// Log the error as debug (and therefore, "expected") or at error level
if (suppressErrors) {
Timber.d(e, "Suppressed (known / expected) error")
} else {
Timber.e(e)
throw e
}
}
return rsp
}
throw IOException("Unsuccessful response")
}
private fun isExcludedUrl(request: Request): Boolean {
val requestUrl = request.url.toString()
for (url in DO_NOT_INTERCEPT) {
if (requestUrl.contains(url)) {
return true
}
}
return false
}
companion object {
val DO_NOT_INTERCEPT = listOf(
"api.php?format=json&formatversion=2&errorformat=plaintext&action=upload&ignorewarnings=1"
)
const val ERRORS_PREFIX = "{\"error"
}
}

View file

@ -1,14 +0,0 @@
package fr.free.nrw.commons;
class Urls {
static final String NEW_ISSUE_URL = "https://github.com/commons-app/apps-android-commons/issues";
static final String GITHUB_REPO_URL = "https://github.com/commons-app/apps-android-commons";
static final String WEBSITE_URL = "https://commons-app.github.io";
static final String CREDITS_URL = "https://github.com/commons-app/apps-android-commons/blob/master/CREDITS";
static final String FAQ_URL = "https://github.com/commons-app/apps-android-commons/wiki/Frequently-Asked-Questions";
static final String PLAY_STORE_URL = "https://play.google.com/store/apps/details?id=fr.free.nrw.commons";
static final String TRANSLATE_WIKI_URL = "https://translatewiki.net/w/i.php?title=Special:Translate&group=commons-android-strings&filter=%21translated&action=translate&language=";
static final String FACEBOOK_WEB_URL = "https://www.facebook.com/1921335171459985";
static final String FACEBOOK_APP_URL = "fb://page/1921335171459985";
static final String FACEBOOK_PACKAGE_NAME = "com.facebook.katana";
}

View file

@ -0,0 +1,19 @@
package fr.free.nrw.commons
internal object Urls {
const val NEW_ISSUE_URL = "https://github.com/commons-app/apps-android-commons/issues"
const val GITHUB_REPO_URL = "https://github.com/commons-app/apps-android-commons"
const val GITHUB_PACKAGE_NAME = "com.github.android"
const val WEBSITE_URL = "https://commons-app.github.io"
const val CREDITS_URL = "https://github.com/commons-app/apps-android-commons/blob/master/CREDITS"
const val USER_GUIDE_URL = "https://commons-app.github.io/docs.html"
const val FAQ_URL = "https://github.com/commons-app/commons-app-documentation/blob/master/android/Frequently-Asked-Questions.md"
const val PLAY_STORE_PREFIX = "market://details?id="
const val PLAY_STORE_URL_PREFIX = "https://play.google.com/store/apps/details?id="
const val TRANSLATE_WIKI_URL =
"https://translatewiki.net/w/i.php?title=Special:Translate" +
"&group=commons-android-strings&filter=%21translated&action=translate&language="
const val FACEBOOK_WEB_URL = "https://www.facebook.com/1921335171459985"
const val FACEBOOK_APP_URL = "fb://page/1921335171459985"
const val FACEBOOK_PACKAGE_NAME = "com.facebook.katana"
}

View file

@ -1,187 +0,0 @@
package fr.free.nrw.commons;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.view.View;
import android.widget.Toast;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.page.PageTitle;
import fr.free.nrw.commons.location.LatLng;
import fr.free.nrw.commons.utils.ViewUtil;
import java.util.Locale;
import java.util.regex.Pattern;
import androidx.annotation.NonNull;
import androidx.browser.customtabs.CustomTabsIntent;
import androidx.core.content.ContextCompat;
import fr.free.nrw.commons.settings.Prefs;
import timber.log.Timber;
import static android.widget.Toast.LENGTH_SHORT;
public class Utils {
public static PageTitle getPageTitle(@NonNull String title) {
return new PageTitle(title, new WikiSite(BuildConfig.COMMONS_URL));
}
/**
* Generates licence name with given ID
* @param license License ID
* @return Name of license
*/
public static int licenseNameFor(String license) {
switch (license) {
case Prefs.Licenses.CC_BY_3:
return R.string.license_name_cc_by;
case Prefs.Licenses.CC_BY_4:
return R.string.license_name_cc_by_four;
case Prefs.Licenses.CC_BY_SA_3:
return R.string.license_name_cc_by_sa;
case Prefs.Licenses.CC_BY_SA_4:
return R.string.license_name_cc_by_sa_four;
case Prefs.Licenses.CC0:
return R.string.license_name_cc0;
}
throw new IllegalStateException("Unrecognized license value: " + license);
}
/**
* Generates license url with given ID
* @param license License ID
* @return Url of license
*/
@NonNull
public static String licenseUrlFor(String license) {
switch (license) {
case Prefs.Licenses.CC_BY_3:
return "https://creativecommons.org/licenses/by/3.0/";
case Prefs.Licenses.CC_BY_4:
return "https://creativecommons.org/licenses/by/4.0/";
case Prefs.Licenses.CC_BY_SA_3:
return "https://creativecommons.org/licenses/by-sa/3.0/";
case Prefs.Licenses.CC_BY_SA_4:
return "https://creativecommons.org/licenses/by-sa/4.0/";
case Prefs.Licenses.CC0:
return "https://creativecommons.org/publicdomain/zero/1.0/";
default:
throw new IllegalStateException("Unrecognized license value: " + license);
}
}
/**
* Adds extension to filename. Converts to .jpg if system provides .jpeg, adds .jpg if no extension detected
* @param title File name
* @param extension Correct extension
* @return File with correct extension
*/
public static String fixExtension(String title, String extension) {
Pattern jpegPattern = Pattern.compile("\\.jpeg$", Pattern.CASE_INSENSITIVE);
// People are used to ".jpg" more than ".jpeg" which the system gives us.
if (extension != null && extension.toLowerCase(Locale.ENGLISH).equals("jpeg")) {
extension = "jpg";
}
title = jpegPattern.matcher(title).replaceFirst(".jpg");
if (extension != null && !title.toLowerCase(Locale.getDefault())
.endsWith("." + extension.toLowerCase(Locale.ENGLISH))) {
title += "." + extension;
}
// If extension is still null, make it jpg. (Hotfix for https://github.com/commons-app/apps-android-commons/issues/228)
// If title has an extension in it, if won't be true
if (extension == null && title.lastIndexOf(".")<=0) {
extension = "jpg";
title += "." + extension;
}
return title;
}
/**
* Launches intent to rate app
* @param context
*/
public static void rateApp(Context context) {
final String appPackageName = BuildConfig.class.getPackage().getName();
try {
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("market://details?id=" + appPackageName)));
}
catch (android.content.ActivityNotFoundException anfe) {
handleWebUrl(context, Uri.parse("https://play.google.com/store/apps/details?id=" + appPackageName));
}
}
/**
* Opens Custom Tab Activity with in-app browser for the specified URL.
* Launches intent for web URL
* @param context
* @param url
*/
public static void handleWebUrl(Context context, Uri url) {
Timber.d("Launching web url %s", url.toString());
Intent browserIntent = new Intent(Intent.ACTION_VIEW, url);
if (browserIntent.resolveActivity(context.getPackageManager()) == null) {
Toast toast = Toast.makeText(context, context.getString(R.string.no_web_browser), LENGTH_SHORT);
toast.show();
return;
}
CustomTabsIntent.Builder builder = new CustomTabsIntent.Builder();
builder.setToolbarColor(ContextCompat.getColor(context, R.color.primaryColor));
builder.setSecondaryToolbarColor(ContextCompat.getColor(context, R.color.primaryDarkColor));
builder.setExitAnimations(context, android.R.anim.slide_in_left, android.R.anim.slide_out_right);
CustomTabsIntent customTabsIntent = builder.build();
// Clear previous browser tasks, so that back/exit buttons work as intended.
customTabsIntent.intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
customTabsIntent.launchUrl(context, url);
}
/**
* Util function to handle geo coordinates
* It no longer depends on google maps and any app capable of handling the map intent can handle it
* @param context
* @param latLng
*/
public static void handleGeoCoordinates(Context context, LatLng latLng) {
Intent mapIntent = new Intent(Intent.ACTION_VIEW, latLng.getGmmIntentUri());
if (mapIntent.resolveActivity(context.getPackageManager()) != null) {
context.startActivity(mapIntent);
} else {
ViewUtil.showShortToast(context, context.getString(R.string.map_application_missing));
}
}
/**
* To take screenshot of the screen and return it in Bitmap format
*
* @param view
* @return
*/
public static Bitmap getScreenShot(View view) {
View screenView = view.getRootView();
screenView.setDrawingCacheEnabled(true);
Bitmap bitmap = Bitmap.createBitmap(screenView.getDrawingCache());
screenView.setDrawingCacheEnabled(false);
return bitmap;
}
/*
*Copies the content to the clipboard
*
*/
public static void copy(String label,String text, Context context){
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText(label, text);
clipboard.setPrimaryClip(clip);
}
}

View file

@ -1,7 +0,0 @@
package fr.free.nrw.commons;
import android.content.Context;
public interface ViewHolder<T> {
void bindModel(Context context, T model);
}

View file

@ -0,0 +1,44 @@
package fr.free.nrw.commons
import android.content.Context
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentPagerAdapter
import java.util.Locale
/**
* This adapter will be used to display fragments in a ViewPager
*/
class ViewPagerAdapter : FragmentPagerAdapter {
private val context: Context
private var fragmentList: List<Fragment> = emptyList()
private var fragmentTitleList: List<String> = emptyList()
constructor(context: Context, manager: FragmentManager) : super(manager) {
this.context = context
}
constructor(context: Context, manager: FragmentManager, behavior: Int) : super(manager, behavior) {
this.context = context
}
override fun getItem(position: Int): Fragment = fragmentList[position]
override fun getPageTitle(position: Int): CharSequence = fragmentTitleList[position]
override fun getCount(): Int = fragmentList.size
fun setTabs(vararg titlesToFragments: Pair<Int, Fragment>) {
// Enforce that every title must come from strings.xml and all will consistently be uppercase
fragmentTitleList = titlesToFragments.map {
context.getString(it.first).uppercase(Locale.ROOT)
}
fragmentList = titlesToFragments.map { it.second }
}
companion object {
// Convenience method for Java callers, can be removed when everything is migrated
@JvmStatic
fun pairOf(first: Int, second: Fragment) = first to second
}
}

View file

@ -1,97 +0,0 @@
package fr.free.nrw.commons;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import com.viewpagerindicator.CirclePageIndicator;
import androidx.viewpager.widget.ViewPager;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import fr.free.nrw.commons.quiz.QuizActivity;
import fr.free.nrw.commons.theme.BaseActivity;
import fr.free.nrw.commons.utils.ConfigUtils;
public class WelcomeActivity extends BaseActivity {
@BindView(R.id.welcomePager)
ViewPager pager;
@BindView(R.id.welcomePagerIndicator)
CirclePageIndicator indicator;
private WelcomePagerAdapter adapter = new WelcomePagerAdapter();
private boolean isQuiz;
/**
* Initialises exiting fields and dependencies
*
* @param savedInstanceState WelcomeActivity bundled data
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_welcome);
if (getIntent() != null) {
Bundle bundle = getIntent().getExtras();
if (bundle != null) {
isQuiz = bundle.getBoolean("isQuiz");
}
} else {
isQuiz = false;
}
// Enable skip button if beta flavor
if (ConfigUtils.isBetaFlavour()) {
findViewById(R.id.finishTutorialButton).setVisibility(View.VISIBLE);
}
ButterKnife.bind(this);
pager.setAdapter(adapter);
indicator.setViewPager(pager);
}
/**
* References WelcomePageAdapter to null before the activity is destroyed
*/
@Override
public void onDestroy() {
if (isQuiz) {
Intent i = new Intent(WelcomeActivity.this, QuizActivity.class);
startActivity(i);
}
super.onDestroy();
}
/**
* Creates a way to change current activity to WelcomeActivity
*
* @param context Activity context
*/
public static void startYourself(Context context) {
Intent welcomeIntent = new Intent(context, WelcomeActivity.class);
context.startActivity(welcomeIntent);
}
/**
* Override onBackPressed() to go to previous tutorial 'pages' if not on first page
*/
@Override
public void onBackPressed() {
if (pager.getCurrentItem() != 0) {
pager.setCurrentItem(pager.getCurrentItem() - 1, true);
} else {
finish();
}
}
@OnClick(R.id.finishTutorialButton)
public void finishTutorial() {
defaultKvStore.putBoolean("firstrun", false);
finish();
}
}

View file

@ -0,0 +1,80 @@
package fr.free.nrw.commons
import android.app.AlertDialog
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.View
import fr.free.nrw.commons.databinding.ActivityWelcomeBinding
import fr.free.nrw.commons.databinding.PopupForCopyrightBinding
import fr.free.nrw.commons.quiz.QuizActivity
import fr.free.nrw.commons.theme.BaseActivity
import fr.free.nrw.commons.utils.applyEdgeToEdgeAllInsets
import fr.free.nrw.commons.utils.ConfigUtils.isBetaFlavour
class WelcomeActivity : BaseActivity() {
private var binding: ActivityWelcomeBinding? = null
private var isQuiz = false
/**
* Initialises exiting fields and dependencies
*
* @param savedInstanceState WelcomeActivity bundled data
*/
public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityWelcomeBinding.inflate(layoutInflater)
applyEdgeToEdgeAllInsets(binding!!.welcomePager.rootView)
setContentView(binding!!.root)
isQuiz = intent?.extras?.getBoolean("isQuiz", false) ?: false
// Enable skip button if beta flavor
if (isBetaFlavour) {
binding!!.finishTutorialButton.visibility = View.VISIBLE
val copyrightBinding = PopupForCopyrightBinding.inflate(layoutInflater)
val dialog = AlertDialog.Builder(this)
.setView(copyrightBinding.root)
.setCancelable(false)
.create()
dialog.show()
copyrightBinding.buttonOk.setOnClickListener { v: View? -> dialog.dismiss() }
}
val adapter = WelcomePagerAdapter()
binding!!.welcomePager.adapter = adapter
binding!!.welcomePagerIndicator.setViewPager(binding!!.welcomePager)
binding!!.finishTutorialButton.setOnClickListener { v: View? -> finishTutorial() }
}
public override fun onDestroy() {
if (isQuiz) {
startActivity(Intent(this, QuizActivity::class.java))
}
super.onDestroy()
}
override fun onBackPressed() {
if (binding!!.welcomePager.currentItem != 0) {
binding!!.welcomePager.setCurrentItem(binding!!.welcomePager.currentItem - 1, true)
} else {
if (defaultKvStore.getBoolean("firstrun", true)) {
finishAffinity()
} else {
super.onBackPressed()
}
}
}
fun finishTutorial() {
defaultKvStore.putBoolean("firstrun", false)
finish()
}
}
fun Context.startWelcome() {
startActivity(Intent(this, WelcomeActivity::class.java))
}

View file

@ -1,77 +0,0 @@
package fr.free.nrw.commons;
import android.net.Uri;
import android.text.Html;
import androidx.annotation.Nullable;
import androidx.viewpager.widget.PagerAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.viewpager.widget.PagerAdapter;
import org.wikipedia.util.StringUtil;
public class WelcomePagerAdapter extends PagerAdapter {
private static final int[] PAGE_LAYOUTS = new int[]{
R.layout.welcome_wikipedia,
R.layout.welcome_do_upload,
R.layout.welcome_dont_upload,
R.layout.welcome_image_example,
R.layout.welcome_final
};
/**
* Gets total number of layouts
* @return Number of layouts
*/
@Override
public int getCount() {
return PAGE_LAYOUTS.length;
}
/**
* Compares given view with provided object
* @param view Adapter view
* @param object Adapter object
* @return Equality between view and object
*/
@Override
public boolean isViewFromObject(View view, Object object) {
return (view == object);
}
@Override
public Object instantiateItem(ViewGroup container, int position) {
LayoutInflater inflater = LayoutInflater.from(container.getContext());
ViewGroup layout = (ViewGroup) inflater.inflate(PAGE_LAYOUTS[position], container, false);
// If final page
if (position == PAGE_LAYOUTS.length - 1) {
// Add link to more information
TextView moreInfo = layout.findViewById(R.id.welcomeInfo);
moreInfo.setText(Html.fromHtml(container.getContext().getString(R.string.welcome_help_button_text)));
moreInfo.setOnClickListener(view -> Utils.handleWebUrl(
container.getContext(),
Uri.parse("https://commons.wikimedia.org/wiki/Help:Contents")
));
// Handle click of finishTutorialButton ("YES!" button) inside layout
layout.findViewById(R.id.finishTutorialButton)
.setOnClickListener(view -> ((WelcomeActivity) container.getContext()).finishTutorial());
}
container.addView(layout);
return layout;
}
/**
* Provides a way to remove an item from container
* @param container Adapter view group container
* @param position Index of item
* @param obj Adapter object
*/
@Override
public void destroyItem(ViewGroup container, int position, Object obj) {
container.removeView((View) obj);
}
}

View file

@ -0,0 +1,70 @@
package fr.free.nrw.commons
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import androidx.core.net.toUri
import androidx.viewpager.widget.PagerAdapter
import fr.free.nrw.commons.utils.UnderlineUtils.setUnderlinedText
import fr.free.nrw.commons.utils.handleWebUrl
class WelcomePagerAdapter : PagerAdapter() {
/**
* Gets total number of layouts
* @return Number of layouts
*/
override fun getCount(): Int = PAGE_LAYOUTS.size
/**
* Compares given view with provided object
* @param view Adapter view
* @param obj Adapter object
* @return Equality between view and object
*/
override fun isViewFromObject(view: View, obj: Any): Boolean = (view === obj)
/**
* Provides a way to remove an item from container
* @param container Adapter view group container
* @param position Index of item
* @param obj Adapter object
*/
override fun destroyItem(container: ViewGroup, position: Int, obj: Any) =
container.removeView(obj as View)
override fun instantiateItem(container: ViewGroup, position: Int): Any {
val inflater = LayoutInflater.from(container.context)
val layout = inflater.inflate(PAGE_LAYOUTS[position], container, false) as ViewGroup
// If final page
if (position == PAGE_LAYOUTS.size - 1) {
// Add link to more information
val moreInfo = layout.findViewById<TextView>(R.id.welcomeInfo)
setUnderlinedText(moreInfo, R.string.welcome_help_button_text)
moreInfo.setOnClickListener {
handleWebUrl(
container.context,
"https://commons.wikimedia.org/wiki/Help:Contents".toUri()
)
}
// Handle click of finishTutorialButton ("YES!" button) inside layout
layout.findViewById<View>(R.id.finishTutorialButton)
.setOnClickListener { view: View? -> (container.context as WelcomeActivity).finishTutorial() }
}
container.addView(layout)
return layout
}
companion object {
private val PAGE_LAYOUTS = intArrayOf(
R.layout.welcome_wikipedia,
R.layout.welcome_do_upload,
R.layout.welcome_dont_upload,
R.layout.welcome_image_example,
R.layout.welcome_final
)
}
}

View file

@ -1,161 +0,0 @@
package fr.free.nrw.commons.achievements;
/**
* Represents Achievements class and stores all the parameters
*/
public class Achievements {
private int uniqueUsedImages;
private int articlesUsingImages;
private int thanksReceived;
private int imagesEditedBySomeoneElse;
private int featuredImages;
private int imagesUploaded;
private int revertCount;
public Achievements(){
}
/**
* constructor for achievements class to set its data members
* @param uniqueUsedImages
* @param articlesUsingImages
* @param thanksReceived
* @param imagesEditedBySomeoneElse
* @param featuredImages
* @param imagesUploaded
* @param revertCount
*/
public Achievements(int uniqueUsedImages,
int articlesUsingImages,
int thanksReceived,
int imagesEditedBySomeoneElse,
int featuredImages,
int imagesUploaded,
int revertCount) {
this.uniqueUsedImages = uniqueUsedImages;
this.articlesUsingImages = articlesUsingImages;
this.thanksReceived = thanksReceived;
this.imagesEditedBySomeoneElse = imagesEditedBySomeoneElse;
this.featuredImages = featuredImages;
this.imagesUploaded = imagesUploaded;
this.revertCount = revertCount;
}
/**
* Get Achievements object from FeedbackResponse
*
* @param response
* @return
*/
public static Achievements from(FeedbackResponse response) {
return new Achievements(response.getUniqueUsedImages(),
response.getArticlesUsingImages(),
response.getThanksReceived(),
response.getImagesEditedBySomeoneElse(),
response.getFeaturedImages().getQualityImages()
+ response.getFeaturedImages().getFeaturedPicturesOnWikimediaCommons(),
0,
response.getDeletedUploads());
}
/**
* getter function to get count of images uploaded
* @return
*/
public int getImagesUploaded() {
return imagesUploaded;
}
/**
* getter function to get count of featured images
* @return
*/
public int getFeaturedImages() {
return featuredImages;
}
/**
* getter function to get count of thanks received
* @return
*/
public int getThanksReceived() {
return thanksReceived;
}
/**
* getter function to get count of unique images used by wiki
* @return
*/
public int getUniqueUsedImages() {
return uniqueUsedImages;
}
/**
* setter function to count of images uploaded
* @param imagesUploaded
*/
public void setImagesUploaded(int imagesUploaded) {
this.imagesUploaded = imagesUploaded;
}
/**
* setter function to set count of featured images
* @param featuredImages
*/
public void setFeaturedImages(int featuredImages) {
this.featuredImages = featuredImages;
}
/**
* setter function to set the count of images edited by someone
* @param imagesEditedBySomeoneElse
*/
public void setImagesEditedBySomeoneElse(int imagesEditedBySomeoneElse) {
this.imagesEditedBySomeoneElse = imagesEditedBySomeoneElse;
}
/**
* setter function to set count of thanks received
* @param thanksReceived
*/
public void setThanksReceived(int thanksReceived) {
this.thanksReceived = thanksReceived;
}
/**
* setter function to count of articles using images uploaded
* @param articlesUsingImages
*/
public void setArticlesUsingImages(int articlesUsingImages) {
this.articlesUsingImages = articlesUsingImages;
}
/**
* setter function to set count of uniques images used by wiki
* @param uniqueUsedImages
*/
public void setUniqueUsedImages(int uniqueUsedImages) {
this.uniqueUsedImages = uniqueUsedImages;
}
/**
* to set count of images reverted
* @param revertCount
*/
public void setRevertCount(int revertCount) {
this.revertCount = revertCount;
}
/**
* used to calculate the percentages of images that haven't been reverted
* @return
*/
public int getNotRevertPercentage(){
try {
return ((imagesUploaded - revertCount) * 100)/imagesUploaded;
} catch (ArithmeticException divideByZero ){
return 100;
}
}
}

View file

@ -1,494 +0,0 @@
package fr.free.nrw.commons.achievements;
import android.accounts.Account;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.FileProvider;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.Toolbar;
import android.util.DisplayMetrics;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.dinuscxj.progressbar.CircleProgressBar;
import org.apache.commons.lang3.StringUtils;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Objects;
import javax.inject.Inject;
import androidx.vectordrawable.graphics.drawable.VectorDrawableCompat;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import fr.free.nrw.commons.R;
import fr.free.nrw.commons.Utils;
import fr.free.nrw.commons.auth.SessionManager;
import fr.free.nrw.commons.mwapi.OkHttpJsonApiClient;
import fr.free.nrw.commons.theme.NavigationBaseActivity;
import fr.free.nrw.commons.utils.ViewUtil;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.disposables.CompositeDisposable;
import io.reactivex.schedulers.Schedulers;
import timber.log.Timber;
/**
* activity for sharing feedback on uploaded activity
*/
public class AchievementsActivity extends NavigationBaseActivity {
private static final double BADGE_IMAGE_WIDTH_RATIO = 0.4;
private static final double BADGE_IMAGE_HEIGHT_RATIO = 0.3;
private LevelController.LevelInfo levelInfo;
@BindView(R.id.achievement_badge_image)
ImageView imageView;
@BindView(R.id.achievement_badge_text)
TextView badgeText;
@BindView(R.id.achievement_level)
TextView levelNumber;
@BindView(R.id.toolbar)
Toolbar toolbar;
@BindView(R.id.thanks_received)
TextView thanksReceived;
@BindView(R.id.images_uploaded_progressbar)
CircleProgressBar imagesUploadedProgressbar;
@BindView(R.id.images_used_by_wiki_progress_bar)
CircleProgressBar imagesUsedByWikiProgressBar;
@BindView(R.id.image_reverts_progressbar)
CircleProgressBar imageRevertsProgressbar;
@BindView(R.id.image_featured)
TextView imagesFeatured;
@BindView(R.id.images_revert_limit_text)
TextView imagesRevertLimitText;
@BindView(R.id.progressBar)
ProgressBar progressBar;
@BindView(R.id.layout_image_uploaded)
RelativeLayout layoutImageUploaded;
@BindView(R.id.layout_image_reverts)
RelativeLayout layoutImageReverts;
@BindView(R.id.layout_image_used_by_wiki)
RelativeLayout layoutImageUsedByWiki;
@BindView(R.id.layout_statistics)
LinearLayout layoutStatistics;
@BindView(R.id.images_used_by_wiki_text)
TextView imageByWikiText;
@BindView(R.id.images_reverted_text)
TextView imageRevertedText;
@BindView(R.id.images_upload_text_param)
TextView imageUploadedText;
@BindView(R.id.wikidata_edits)
TextView wikidataEditsText;
@Inject
SessionManager sessionManager;
@Inject
OkHttpJsonApiClient okHttpJsonApiClient;
MenuItem item;
private CompositeDisposable compositeDisposable = new CompositeDisposable();
/**
* This method helps in the creation Achievement screen and
* dynamically set the size of imageView
*
* @param savedInstanceState Data bundle
*/
@Override
@SuppressLint("StringFormatInvalid")
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_achievements);
ButterKnife.bind(this);
// DisplayMetrics used to fetch the size of the screen
DisplayMetrics displayMetrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
int height = displayMetrics.heightPixels;
int width = displayMetrics.widthPixels;
// Used for the setting the size of imageView at runtime
ConstraintLayout.LayoutParams params = (ConstraintLayout.LayoutParams)
imageView.getLayoutParams();
params.height = (int) (height * BADGE_IMAGE_HEIGHT_RATIO);
params.width = (int) (width * BADGE_IMAGE_WIDTH_RATIO);
imageView.requestLayout();
setSupportActionBar(toolbar);
progressBar.setVisibility(View.VISIBLE);
hideLayouts();
setAchievements();
setWikidataEditCount();
initDrawer();
}
@Override
public void onDestroy() {
super.onDestroy();
compositeDisposable.clear();
}
/**
* To invoke the AlertDialog on clicking info button
*/
@OnClick(R.id.achievement_info)
public void showInfoDialog(){
launchAlert(getResources().getString(R.string.Achievements)
,getResources().getString(R.string.achievements_info_message));
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.menu_about, menu);
item=menu.getItem(0);
item.setVisible(false);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.share_app_icon) {
View rootView = getWindow().getDecorView().findViewById(android.R.id.content);
Bitmap screenShot = Utils.getScreenShot(rootView);
showAlert(screenShot);
}
return super.onOptionsItemSelected(item);
}
/**
* To take bitmap and store it temporary storage and share it
* @param bitmap
*/
void shareScreen(Bitmap bitmap) {
try {
File file = new File(this.getExternalCacheDir(), "screen.png");
FileOutputStream fOut = new FileOutputStream(file);
bitmap.compress(Bitmap.CompressFormat.PNG, 100, fOut);
fOut.flush();
fOut.close();
file.setReadable(true, false);
Uri fileUri = FileProvider.getUriForFile(getApplicationContext(), getPackageName()+".provider", file);
grantUriPermission(getPackageName(), fileUri, Intent.FLAG_GRANT_READ_URI_PERMISSION);
final Intent intent = new Intent(android.content.Intent.ACTION_SEND);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.putExtra(Intent.EXTRA_STREAM, fileUri);
intent.setType("image/png");
startActivity(Intent.createChooser(intent, getString(R.string.share_image_via)));
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* To call the API to get results in form Single<JSONObject>
* which then calls parseJson when results are fetched
*/
private void setAchievements() {
progressBar.setVisibility(View.VISIBLE);
if (checkAccount()) {
try{
compositeDisposable.add(okHttpJsonApiClient
.getAchievements(Objects.requireNonNull(sessionManager.getCurrentAccount()).name)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
response -> {
if (response != null) {
setUploadCount(Achievements.from(response));
} else {
Timber.d("success");
layoutImageReverts.setVisibility(View.INVISIBLE);
imageView.setVisibility(View.INVISIBLE);
showSnackBarWithRetry();
}
},
t -> {
Timber.e(t, "Fetching achievements statistics failed");
showSnackBarWithRetry();
}
));
}
catch (Exception e){
Timber.d(e+"success");
}
}
}
@SuppressLint("CheckResult")
private void setWikidataEditCount() {
String userName = sessionManager.getUserName();
if (StringUtils.isBlank(userName)) {
return;
}
compositeDisposable.add(okHttpJsonApiClient.getWikidataEdits(userName)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(edits -> wikidataEditsText.setText(String.valueOf(edits)), e -> {
Timber.e("Error:" + e);
}));
}
private void showSnackBarWithRetry() {
progressBar.setVisibility(View.GONE);
ViewUtil.showDismissibleSnackBar(findViewById(android.R.id.content),
R.string.achievements_fetch_failed, R.string.retry, view -> setAchievements());
}
/**
* Shows a generic error toast when error occurs while loading achievements or uploads
*/
private void onError() {
ViewUtil.showLongToast(this, getResources().getString(R.string.error_occurred));
progressBar.setVisibility(View.GONE);
}
/**
* used to the count of images uploaded by user
*/
private void setUploadCount(Achievements achievements) {
if (checkAccount()) {
compositeDisposable.add(okHttpJsonApiClient
.getUploadCount(Objects.requireNonNull(sessionManager.getCurrentAccount()).name)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
uploadCount -> setAchievementsUploadCount(achievements, uploadCount),
t -> {
Timber.e(t, "Fetching upload count failed");
onError();
}
));
}
}
/**
* used to set achievements upload count and call hideProgressbar
* @param uploadCount
*/
private void setAchievementsUploadCount(Achievements achievements, int uploadCount) {
achievements.setImagesUploaded(uploadCount);
hideProgressBar(achievements);
}
/**
* used to the uploaded images progressbar
* @param uploadCount
*/
private void setUploadProgress(int uploadCount){
if (uploadCount==0){
setZeroAchievements();
}else {
imagesUploadedProgressbar.setProgress
(100*uploadCount/levelInfo.getMaxUploadCount());
imagesUploadedProgressbar.setProgressTextFormatPattern
(uploadCount +"/" + levelInfo.getMaxUploadCount() );
}
}
private void setZeroAchievements() {
AlertDialog.Builder builder=new AlertDialog.Builder(this)
.setMessage(getString(R.string.no_achievements_yet))
.setPositiveButton(getString(R.string.ok), (dialog, which) -> {
});
AlertDialog dialog = builder.create();
dialog.show();
imagesUploadedProgressbar.setVisibility(View.INVISIBLE);
imageRevertsProgressbar.setVisibility(View.INVISIBLE);
imagesUsedByWikiProgressBar.setVisibility(View.INVISIBLE);
imageView.setVisibility(View.INVISIBLE);
imageByWikiText.setText(R.string.no_image);
imageRevertedText.setText(R.string.no_image_reverted);
imageUploadedText.setText(R.string.no_image_uploaded);
imageView.setVisibility(View.INVISIBLE);
}
/**
* used to set the non revert image percentage
* @param notRevertPercentage
*/
private void setImageRevertPercentage(int notRevertPercentage){
imageRevertsProgressbar.setProgress(notRevertPercentage);
String revertPercentage = Integer.toString(notRevertPercentage);
imageRevertsProgressbar.setProgressTextFormatPattern(revertPercentage + "%%");
imagesRevertLimitText.setText(getResources().getString(R.string.achievements_revert_limit_message)+ levelInfo.getMinNonRevertPercentage() + "%");
}
/**
* Used the inflate the fetched statistics of the images uploaded by user
* and assign badge and level
* @param achievements
*/
private void inflateAchievements(Achievements achievements) {
thanksReceived.setText(String.valueOf(achievements.getThanksReceived()));
imagesUsedByWikiProgressBar.setProgress
(100*achievements.getUniqueUsedImages()/levelInfo.getMaxUniqueImages() );
imagesUsedByWikiProgressBar.setProgressTextFormatPattern
(achievements.getUniqueUsedImages() + "/" + levelInfo.getMaxUniqueImages());
imagesFeatured.setText(String.valueOf(achievements.getFeaturedImages()));
String levelUpInfoString = getString(R.string.level).toUpperCase();
levelUpInfoString += " " + levelInfo.getLevelNumber();
levelNumber.setText(levelUpInfoString);
imageView.setImageDrawable(VectorDrawableCompat.create(getResources(), R.drawable.badge,
new ContextThemeWrapper(this, levelInfo.getLevelStyle()).getTheme()));
badgeText.setText(Integer.toString(levelInfo.getLevelNumber()));
}
/**
* Creates a way to change current activity to AchievementActivity
* @param context
*/
public static void startYourself(Context context) {
Intent intent = new Intent(context, AchievementsActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT | Intent.FLAG_ACTIVITY_SINGLE_TOP);
context.startActivity(intent);
}
/**
* to hide progressbar
*/
private void hideProgressBar(Achievements achievements) {
if (progressBar != null) {
levelInfo = LevelController.LevelInfo.from(achievements.getImagesUploaded(),
achievements.getUniqueUsedImages(),
achievements.getNotRevertPercentage());
inflateAchievements(achievements);
setUploadProgress(achievements.getImagesUploaded());
setImageRevertPercentage(achievements.getNotRevertPercentage());
progressBar.setVisibility(View.GONE);
item.setVisible(true);
layoutImageReverts.setVisibility(View.VISIBLE);
layoutImageUploaded.setVisibility(View.VISIBLE);
layoutImageUsedByWiki.setVisibility(View.VISIBLE);
layoutStatistics.setVisibility(View.VISIBLE);
imageView.setVisibility(View.VISIBLE);
levelNumber.setVisibility(View.VISIBLE);
}
}
/**
* used to hide the layouts while fetching results from api
*/
private void hideLayouts(){
layoutImageUsedByWiki.setVisibility(View.INVISIBLE);
layoutImageUploaded.setVisibility(View.INVISIBLE);
layoutImageReverts.setVisibility(View.INVISIBLE);
layoutStatistics.setVisibility(View.INVISIBLE);
imageView.setVisibility(View.INVISIBLE);
levelNumber.setVisibility(View.INVISIBLE);
}
/**
* It display the alertDialog with Image of screenshot
* @param screenshot
*/
public void showAlert(Bitmap screenshot){
AlertDialog.Builder alertadd = new AlertDialog.Builder(AchievementsActivity.this);
LayoutInflater factory = LayoutInflater.from(AchievementsActivity.this);
final View view = factory.inflate(R.layout.image_alert_layout, null);
ImageView screenShotImage = view.findViewById(R.id.alert_image);
screenShotImage.setImageBitmap(screenshot);
TextView shareMessage = view.findViewById(R.id.alert_text);
shareMessage.setText(R.string.achievements_share_message);
alertadd.setView(view);
alertadd.setPositiveButton(R.string.about_translate_proceed, (dialog, which) -> shareScreen(screenshot));
alertadd.setNegativeButton(android.R.string.cancel, (dialog, which) -> dialog.cancel());
alertadd.show();
}
@OnClick(R.id.images_upload_info)
public void showUploadInfo(){
launchAlert(getResources().getString(R.string.images_uploaded)
,getResources().getString(R.string.images_uploaded_explanation));
}
@OnClick(R.id.images_reverted_info)
public void showRevertedInfo(){
launchAlert(getResources().getString(R.string.image_reverts)
,getResources().getString(R.string.images_reverted_explanation));
}
@OnClick(R.id.images_used_by_wiki_info)
public void showUsedByWikiInfo(){
launchAlert(getResources().getString(R.string.images_used_by_wiki)
,getResources().getString(R.string.images_used_explanation));
}
@OnClick(R.id.images_nearby_info)
public void showImagesViaNearbyInfo(){
launchAlert(getResources().getString(R.string.statistics_wikidata_edits)
,getResources().getString(R.string.images_via_nearby_explanation));
}
@OnClick(R.id.images_featured_info)
public void showFeaturedImagesInfo(){
launchAlert(getResources().getString(R.string.statistics_featured)
,getResources().getString(R.string.images_featured_explanation));
}
@OnClick(R.id.thanks_received_info)
public void showThanksReceivedInfo(){
launchAlert(getResources().getString(R.string.statistics_thanks)
,getResources().getString(R.string.thanks_received_explanation));
}
/**
* takes title and message as input to display alerts
* @param title
* @param message
*/
private void launchAlert(String title, String message){
new AlertDialog.Builder(AchievementsActivity.this)
.setTitle(title)
.setMessage(message)
.setCancelable(true)
.setPositiveButton(android.R.string.ok, (dialog, id) -> dialog.cancel())
.create()
.show();
}
/**
* check to ensure that user is logged in
* @return
*/
private boolean checkAccount(){
Account currentAccount = sessionManager.getCurrentAccount();
if (currentAccount == null) {
Timber.d("Current account is null");
ViewUtil.showLongToast(this, getResources().getString(R.string.user_not_logged_in));
sessionManager.forceLogin(this);
return false;
}
return true;
}
}

View file

@ -1,25 +0,0 @@
package fr.free.nrw.commons.achievements;
import com.google.gson.annotations.SerializedName;
public class FeaturedImages {
@SerializedName("Quality_images")
private final int qualityImages;
@SerializedName("Featured_pictures_on_Wikimedia_Commons")
private final int featuredPicturesOnWikimediaCommons;
public FeaturedImages(int qualityImages, int featuredPicturesOnWikimediaCommons) {
this.qualityImages = qualityImages;
this.featuredPicturesOnWikimediaCommons = featuredPicturesOnWikimediaCommons;
}
public int getQualityImages() {
return qualityImages;
}
public int getFeaturedPicturesOnWikimediaCommons() {
return featuredPicturesOnWikimediaCommons;
}
}

View file

@ -1,64 +0,0 @@
package fr.free.nrw.commons.achievements;
public class FeedbackResponse {
private final String status;
private final int uniqueUsedImages;
private final int articlesUsingImages;
private final int deletedUploads;
private final FeaturedImages featuredImages;
private final int thanksReceived;
private final String user;
private final int imagesEditedBySomeoneElse;
public FeedbackResponse(String status,
int uniqueUsedImages,
int articlesUsingImages,
int deletedUploads,
FeaturedImages featuredImages,
int thanksReceived,
String user,
int imagesEditedBySomeoneElse) {
this.status = status;
this.uniqueUsedImages = uniqueUsedImages;
this.articlesUsingImages = articlesUsingImages;
this.deletedUploads = deletedUploads;
this.featuredImages = featuredImages;
this.thanksReceived = thanksReceived;
this.user = user;
this.imagesEditedBySomeoneElse = imagesEditedBySomeoneElse;
}
public String getStatus() {
return status;
}
public int getUniqueUsedImages() {
return uniqueUsedImages;
}
public int getArticlesUsingImages() {
return articlesUsingImages;
}
public int getDeletedUploads() {
return deletedUploads;
}
public FeaturedImages getFeaturedImages() {
return featuredImages;
}
public int getThanksReceived() {
return thanksReceived;
}
public String getUser() {
return user;
}
public int getImagesEditedBySomeoneElse() {
return imagesEditedBySomeoneElse;
}
}

View file

@ -1,95 +0,0 @@
package fr.free.nrw.commons.achievements;
import fr.free.nrw.commons.R;
/**
* calculates the level of the user
*/
public class LevelController {
public LevelInfo level;
public enum LevelInfo{
LEVEL_1(1, R.style.LevelOne, 5, 20, 85),
LEVEL_2(2, R.style.LevelTwo, 10, 30, 86),
LEVEL_3(3, R.style.LevelThree, 15,40, 87),
LEVEL_4(4, R.style.LevelFour,20,50, 88),
LEVEL_5(5, R.style.LevelFive, 25, 60, 89),
LEVEL_6(6,R.style.LevelOne,30,70, 90),
LEVEL_7(7, R.style.LevelTwo, 40, 80, 90),
LEVEL_8(8, R.style.LevelThree, 45, 90, 90),
LEVEL_9(9, R.style.LevelFour, 50, 100, 90),
LEVEL_10(10, R.style.LevelFive, 55, 110, 90),
LEVEL_11(11,R.style.LevelOne, 60, 120, 90),
LEVEL_12(12,R.style.LevelTwo,65 , 130, 90),
LEVEL_13(13,R.style.LevelThree, 70, 140, 90),
LEVEL_14(14,R.style.LevelFour, 75 , 150, 90),
LEVEL_15(15,R.style.LevelFive, 80, 160, 90),
LEVEL_16(16,R.style.LevelOne, 160, 320, 91),
LEVEL_17(17,R.style.LevelTwo, 320, 640, 92),
LEVEL_18(18,R.style.LevelThree, 640, 1280, 93),
LEVEL_19(19,R.style.LevelFour, 1280, 2560, 94),
LEVEL_20(20,R.style.LevelFive, 2560, 5120, 95),
LEVEL_21(21,R.style.LevelOne, 5120, 10240, 96),
LEVEL_22(22,R.style.LevelTwo, 10240, 20480, 97),
LEVEL_23(23,R.style.LevelThree, 20480, 40960, 98),
LEVEL_24(24,R.style.LevelFour, 40960, 81920, 98),
LEVEL_25(25,R.style.LevelFive, 81920, 163840, 98),
LEVEL_26(26,R.style.LevelOne, 163840, 327680, 98),
LEVEL_27(27,R.style.LevelTwo, 327680, 655360, 98);
private int levelNumber;
private int levelStyle;
private int maxUniqueImages;
private int maxUploadCount;
private int minNonRevertPercentage;
LevelInfo(int levelNumber,
int levelStyle,
int maxUniqueImages,
int maxUploadCount,
int minNonRevertPercentage) {
this.levelNumber = levelNumber;
this.levelStyle = levelStyle;
this.maxUniqueImages = maxUniqueImages;
this.maxUploadCount = maxUploadCount;
this.minNonRevertPercentage = minNonRevertPercentage;
}
public static LevelInfo from(int imagesUploaded,
int uniqueImagesUsed,
int nonRevertRate) {
LevelInfo level = LEVEL_15;
for (LevelInfo levelInfo : LevelInfo.values()) {
if (imagesUploaded < levelInfo.maxUploadCount
|| uniqueImagesUsed < levelInfo.maxUniqueImages
|| nonRevertRate < levelInfo.minNonRevertPercentage ) {
level = levelInfo;
return level;
}
}
return level;
}
public int getLevelStyle() {
return levelStyle;
}
public int getLevelNumber() {
return levelNumber;
}
public int getMaxUniqueImages() {
return maxUniqueImages;
}
public int getMaxUploadCount() {
return maxUploadCount;
}
public int getMinNonRevertPercentage(){
return minNonRevertPercentage;
}
}
}

View file

@ -0,0 +1,18 @@
package fr.free.nrw.commons.actions
import fr.free.nrw.commons.wikidata.mwapi.MwResponse
/**
* Response of the Thanks API.
* Context:
* The Commons Android app lets you thank other contributors who have uploaded a great picture.
* See https://www.mediawiki.org/wiki/Extension:Thanks
*/
class MwThankPostResponse : MwResponse() {
var result: Result? = null
inner class Result {
var success: Int? = null
var recipient: String? = null
}
}

View file

@ -1,58 +0,0 @@
package fr.free.nrw.commons.actions;
import org.wikipedia.csrf.CsrfTokenClient;
import org.wikipedia.dataclient.Service;
import io.reactivex.Observable;
import timber.log.Timber;
public class PageEditClient {
private final CsrfTokenClient csrfTokenClient;
private final PageEditInterface pageEditInterface;
private final Service service;
public PageEditClient(CsrfTokenClient csrfTokenClient,
PageEditInterface pageEditInterface,
Service service) {
this.csrfTokenClient = csrfTokenClient;
this.pageEditInterface = pageEditInterface;
this.service = service;
}
public Observable<Boolean> edit(String pageTitle, String text, String summary) {
try {
return pageEditInterface.postEdit(pageTitle, summary, text, csrfTokenClient.getTokenBlocking())
.map(editResponse -> editResponse.edit().editSucceeded());
} catch (Throwable throwable) {
return Observable.just(false);
}
}
public Observable<Boolean> appendEdit(String pageTitle, String appendText, String summary) {
try {
return pageEditInterface.postAppendEdit(pageTitle, summary, appendText, csrfTokenClient.getTokenBlocking())
.map(editResponse -> editResponse.edit().editSucceeded());
} catch (Throwable throwable) {
return Observable.just(false);
}
}
public Observable<Boolean> prependEdit(String pageTitle, String prependText, String summary) {
try {
return pageEditInterface.postPrependEdit(pageTitle, summary, prependText, csrfTokenClient.getTokenBlocking())
.map(editResponse -> editResponse.edit().editSucceeded());
} catch (Throwable throwable) {
return Observable.just(false);
}
}
public Observable<Integer> addEditTag(long revisionId, String tagName, String reason) {
try {
return service.addEditTag(String.valueOf(revisionId), tagName, reason, csrfTokenClient.getTokenBlocking())
.map(mwPostResponse -> mwPostResponse.getSuccessVal());
} catch (Throwable throwable) {
return Observable.just(-1);
}
}
}

View file

@ -0,0 +1,201 @@
package fr.free.nrw.commons.actions
import fr.free.nrw.commons.auth.csrf.CsrfTokenClient
import fr.free.nrw.commons.auth.csrf.InvalidLoginTokenException
import io.reactivex.Observable
import io.reactivex.Single
/**
* This class acts as a Client to facilitate wiki page editing
* services to various dependency providing modules such as the Network module, the Review Controller, etc.
*
* The methods provided by this class will post to the Media wiki api
* documented at: https://commons.wikimedia.org/w/api.php?action=help&modules=edit
*/
class PageEditClient(
private val csrfTokenClient: CsrfTokenClient,
private val pageEditInterface: PageEditInterface,
) {
/**
* Replace the content of a wiki page
* @param pageTitle Title of the page to edit
* @param text Holds the page content
* @param summary Edit summary
* @return whether the edit was successful
*/
fun edit(
pageTitle: String,
text: String,
summary: String,
): Observable<Boolean> =
try {
pageEditInterface
.postEdit(pageTitle, summary, text, csrfTokenClient.getTokenBlocking())
.map { editResponse ->
editResponse.edit()!!.editSucceeded()
}
} catch (throwable: Throwable) {
if (throwable is InvalidLoginTokenException) {
throw throwable
} else {
Observable.just(false)
}
}
/**
* Creates a new page with the given title, text, and summary.
*
* @param pageTitle The title of the page to be created.
* @param text The content of the page in wikitext format.
* @param summary The edit summary for the page creation.
* @return An observable that emits true if the page creation succeeded, false otherwise.
* @throws InvalidLoginTokenException If an invalid login token is encountered during the process.
*/
fun postCreate(
pageTitle: String,
text: String,
summary: String,
): Observable<Boolean> =
try {
pageEditInterface
.postCreate(
pageTitle,
summary,
text,
"text/x-wiki",
"wikitext",
true,
true,
csrfTokenClient.getTokenBlocking(),
).map { editResponse ->
editResponse.edit()!!.editSucceeded()
}
} catch (throwable: Throwable) {
if (throwable is InvalidLoginTokenException) {
throw throwable
} else {
Observable.just(false)
}
}
/**
* Append text to the end of a wiki page
* @param pageTitle Title of the page to edit
* @param appendText The received page content is added to the end of the page
* @param summary Edit summary
* @return whether the edit was successful
*/
fun appendEdit(
pageTitle: String,
appendText: String,
summary: String,
): Observable<Boolean> =
try {
pageEditInterface
.postAppendEdit(pageTitle, summary, appendText, csrfTokenClient.getTokenBlocking())
.map { editResponse -> editResponse.edit()!!.editSucceeded() }
} catch (throwable: Throwable) {
if (throwable is InvalidLoginTokenException) {
throw throwable
} else {
Observable.just(false)
}
}
/**
* Prepend text to the beginning of a wiki page
* @param pageTitle Title of the page to edit
* @param prependText The received page content is added to the beginning of the page
* @param summary Edit summary
* @return whether the edit was successful
*/
fun prependEdit(
pageTitle: String,
prependText: String,
summary: String,
): Observable<Boolean> =
try {
pageEditInterface
.postPrependEdit(pageTitle, summary, prependText, csrfTokenClient.getTokenBlocking())
.map { editResponse -> editResponse.edit()?.editSucceeded() ?: false }
} catch (throwable: Throwable) {
if (throwable is InvalidLoginTokenException) {
throw throwable
} else {
Observable.just(false)
}
}
/**
* Appends a new section to the wiki page
* @param pageTitle Title of the page to edit
* @param sectionTitle Title of the new section that needs to be created
* @param sectionText The page content that is to be added to the section
* @param summary Edit summary
* @return whether the edit was successful
*/
fun createNewSection(
pageTitle: String,
sectionTitle: String,
sectionText: String,
summary: String,
): Observable<Boolean> =
try {
pageEditInterface
.postNewSection(pageTitle, summary, sectionTitle, sectionText, csrfTokenClient.getTokenBlocking())
.map { editResponse -> editResponse.edit()!!.editSucceeded() }
} catch (throwable: Throwable) {
if (throwable is InvalidLoginTokenException) {
throw throwable
} else {
Observable.just(false)
}
}
/**
* Set new labels to Wikibase server of commons
* @param summary Edit summary
* @param title Title of the page to edit
* @param language Corresponding language of label
* @param value label
* @return 1 when the edit was successful
*/
fun setCaptions(
summary: String,
title: String,
language: String,
value: String,
): Observable<Int> =
try {
pageEditInterface
.postCaptions(
summary,
title,
language,
value,
csrfTokenClient.getTokenBlocking(),
).map { it.success }
} catch (throwable: Throwable) {
if (throwable is InvalidLoginTokenException) {
throw throwable
} else {
Observable.just(0)
}
}
/**
* Get whole WikiText of required file
* @param title : Name of the file
* @return Observable<MwQueryResult>
*/
fun getCurrentWikiText(title: String): Single<String?> =
pageEditInterface.getWikiText(title).map {
it
.query()
?.pages()
?.get(0)
?.revisions()
?.get(0)
?.content()
}
}

View file

@ -1,41 +0,0 @@
package fr.free.nrw.commons.actions;
import androidx.annotation.NonNull;
import org.wikipedia.edit.Edit;
import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import static org.wikipedia.dataclient.Service.MW_API_PREFIX;
public interface PageEditInterface {
@FormUrlEncoded
@Headers("Cache-Control: no-cache")
@POST(MW_API_PREFIX + "action=edit")
@NonNull
Observable<Edit> postEdit(@NonNull @Field("title") String title,
@NonNull @Field("summary") String summary,
@NonNull @Field("text") String text,
@NonNull @Field("token") String token);
@FormUrlEncoded
@Headers("Cache-Control: no-cache")
@POST(MW_API_PREFIX + "action=edit")
@NonNull Observable<Edit> postAppendEdit(@NonNull @Field("title") String title,
@NonNull @Field("summary") String summary,
@NonNull @Field("appendtext") String text,
@NonNull @Field("token") String token);
@FormUrlEncoded
@Headers("Cache-Control: no-cache")
@POST(MW_API_PREFIX + "action=edit")
@NonNull Observable<Edit> postPrependEdit(@NonNull @Field("title") String title,
@NonNull @Field("summary") String summary,
@NonNull @Field("prependtext") String text,
@NonNull @Field("token") String token);
}

View file

@ -0,0 +1,141 @@
package fr.free.nrw.commons.actions
import fr.free.nrw.commons.wikidata.WikidataConstants.MW_API_PREFIX
import fr.free.nrw.commons.wikidata.model.Entities
import fr.free.nrw.commons.wikidata.model.edit.Edit
import fr.free.nrw.commons.wikidata.mwapi.MwQueryResponse
import io.reactivex.Observable
import io.reactivex.Single
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.POST
import retrofit2.http.Query
/**
* This interface facilitates wiki commons page editing services to the Networking module
* which provides all network related services used by the app.
*
* This interface posts a form encoded request to the wikimedia API
* with editing action as argument to edit a particular page
*/
interface PageEditInterface {
/**
* This method posts such that the Content which the page
* has will be completely replaced by the value being passed to the
* "text" field of the encoded form data
* @param title Title of the page to edit. Cannot be used together with pageid.
* @param summary Edit summary. Also section title when section=new and sectiontitle is not set
* @param text Holds the page content
* @param token A "csrf" token
*/
@FormUrlEncoded
@Headers("Cache-Control: no-cache")
@POST(MW_API_PREFIX + "action=edit")
fun postEdit(
@Field("title") title: String,
@Field("summary") summary: String,
@Field("text") text: String,
// NOTE: This csrf shold always be sent as the last field of form data
@Field("token") token: String,
): Observable<Edit>
/**
* This method creates or edits a page for nearby items.
*
* @param title Title of the page to edit. Cannot be used together with pageid.
* @param summary Edit summary. Also used as the section title when section=new and sectiontitle is not set.
* @param text Text of the page.
* @param contentformat Format of the content (e.g., "text/x-wiki").
* @param contentmodel Model of the content (e.g., "wikitext").
* @param minor Whether the edit is a minor edit.
* @param recreate Whether to recreate the page if it does not exist.
* @param token A "csrf" token. This should always be sent as the last field of form data.
*/
@FormUrlEncoded
@Headers("Cache-Control: no-cache")
@POST(MW_API_PREFIX + "action=edit")
fun postCreate(
@Field("title") title: String,
@Field("summary") summary: String,
@Field("text") text: String,
@Field("contentformat") contentformat: String,
@Field("contentmodel") contentmodel: String,
@Field("minor") minor: Boolean,
@Field("recreate") recreate: Boolean,
// NOTE: This csrf shold always be sent as the last field of form data
@Field("token") token: String,
): Observable<Edit>
/**
* This method posts such that the Content which the page
* has will be appended with the value being passed to the
* "appendText" field of the encoded form data
* @param title Title of the page to edit. Cannot be used together with pageid.
* @param summary Edit summary. Also section title when section=new and sectiontitle is not set
* @param appendText Text to add to the end of the page
* @param token A "csrf" token
*/
@FormUrlEncoded
@Headers("Cache-Control: no-cache")
@POST(MW_API_PREFIX + "action=edit")
fun postAppendEdit(
@Field("title") title: String,
@Field("summary") summary: String,
@Field("appendtext") appendText: String,
@Field("token") token: String,
): Observable<Edit>
/**
* This method posts such that the Content which the page
* has will be prepended with the value being passed to the
* "prependText" field of the encoded form data
* @param title Title of the page to edit. Cannot be used together with pageid.
* @param summary Edit summary. Also section title when section=new and sectiontitle is not set
* @param prependText Text to add to the beginning of the page
* @param token A "csrf" token
*/
@FormUrlEncoded
@Headers("Cache-Control: no-cache")
@POST(MW_API_PREFIX + "action=edit")
fun postPrependEdit(
@Field("title") title: String,
@Field("summary") summary: String,
@Field("prependtext") prependText: String,
@Field("token") token: String,
): Observable<Edit>
@FormUrlEncoded
@Headers("Cache-Control: no-cache")
@POST(MW_API_PREFIX + "action=edit&section=new")
fun postNewSection(
@Field("title") title: String,
@Field("summary") summary: String,
@Field("sectiontitle") sectionTitle: String,
@Field("text") sectionText: String,
@Field("token") token: String,
): Observable<Edit>
@FormUrlEncoded
@Headers("Cache-Control: no-cache")
@POST(MW_API_PREFIX + "action=wbsetlabel&format=json&site=commonswiki&formatversion=2")
fun postCaptions(
@Field("summary") summary: String,
@Field("title") title: String,
@Field("language") language: String,
@Field("value") value: String,
@Field("token") token: String,
): Observable<Entities>
/**
* Gets the wiki text for the provided file name.
*
* @param title The title (name) of the file to fetch wiki text for.
* @return A Single emitting the wiki query response.
*/
@GET(MW_API_PREFIX + "action=query&prop=revisions&rvprop=content|timestamp&rvlimit=1&converttitles=")
fun getWikiText(
@Query("titles") title: String,
): Single<MwQueryResponse?>
}

View file

@ -1,36 +0,0 @@
package fr.free.nrw.commons.actions;
import org.wikipedia.csrf.CsrfTokenClient;
import org.wikipedia.dataclient.Service;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import fr.free.nrw.commons.CommonsApplication;
import io.reactivex.Observable;
@Singleton
public class ThanksClient {
private final CsrfTokenClient csrfTokenClient;
private final Service service;
@Inject
public ThanksClient(@Named("commons-csrf") CsrfTokenClient csrfTokenClient,
@Named("commons-service") Service service) {
this.csrfTokenClient = csrfTokenClient;
this.service = service;
}
public Observable<Boolean> thank(long revisionId) {
try {
return service.thank(String.valueOf(revisionId), null,
csrfTokenClient.getTokenBlocking(),
CommonsApplication.getInstance().getUserAgent())
.map(mwQueryResponse -> mwQueryResponse.getSuccessVal() == 1);
} catch (Throwable throwable) {
return Observable.just(false);
}
}
}

View file

@ -0,0 +1,46 @@
package fr.free.nrw.commons.actions
import fr.free.nrw.commons.CommonsApplication
import fr.free.nrw.commons.auth.csrf.CsrfTokenClient
import fr.free.nrw.commons.auth.csrf.InvalidLoginTokenException
import fr.free.nrw.commons.di.NetworkingModule.Companion.NAMED_COMMONS_CSRF
import io.reactivex.Observable
import javax.inject.Inject
import javax.inject.Named
import javax.inject.Singleton
/**
* Client for the Wkikimedia Thanks API extension
* Thanks are used by a user to show gratitude to another user for their contributions
*/
@Singleton
class ThanksClient
@Inject
constructor(
@param:Named(NAMED_COMMONS_CSRF) private val csrfTokenClient: CsrfTokenClient,
private val service: ThanksInterface,
) {
/**
* Thanks a user for a particular revision
* @param revisionId The revision ID the user would like to thank someone for
* @return if thanks was successfully sent to intended recipient
*/
fun thank(revisionId: Long): Observable<Boolean> =
try {
service
.thank(
revisionId.toString(), // Rev
null, // Log
csrfTokenClient.getTokenBlocking(), // Token
CommonsApplication.instance.userAgent, // Source
).map { mwThankPostResponse ->
mwThankPostResponse.result?.success == 1
}
} catch (throwable: Throwable) {
if (throwable is InvalidLoginTokenException) {
Observable.error(throwable)
} else {
Observable.just(false)
}
}
}

View file

@ -0,0 +1,24 @@
package fr.free.nrw.commons.actions
import fr.free.nrw.commons.wikidata.WikidataConstants.MW_API_PREFIX
import io.reactivex.Observable
import retrofit2.http.Field
import retrofit2.http.FormUrlEncoded
import retrofit2.http.POST
/**
* Thanks API.
* Context:
* The Commons Android app lets you thank another contributor who has uploaded a great picture.
* See https://www.mediawiki.org/wiki/Extension:Thanks
*/
interface ThanksInterface {
@FormUrlEncoded
@POST(MW_API_PREFIX + "action=thank")
fun thank(
@Field("rev") rev: String?,
@Field("log") log: String?,
@Field("token") token: String,
@Field("source") source: String?,
): Observable<MwThankPostResponse?>
}

View file

@ -0,0 +1,218 @@
package fr.free.nrw.commons.activity
import android.annotation.SuppressLint
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.webkit.ConsoleMessage
import android.webkit.CookieManager
import android.webkit.WebChromeClient
import android.webkit.WebResourceRequest
import android.webkit.WebView
import android.webkit.WebViewClient
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.filled.ArrowBack
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.viewinterop.AndroidView
import fr.free.nrw.commons.CommonsApplication
import fr.free.nrw.commons.CommonsApplication.ActivityLogoutListener
import fr.free.nrw.commons.R
import fr.free.nrw.commons.di.ApplicationlessInjection
import fr.free.nrw.commons.wikidata.cookies.CommonsCookieJar
import okhttp3.HttpUrl.Companion.toHttpUrl
import timber.log.Timber
import javax.inject.Inject
/**
* SingleWebViewActivity is a reusable activity webView based on a given url(initial url) and
* closes itself when a specified success URL is reached to success url.
*/
class SingleWebViewActivity : ComponentActivity() {
@Inject
lateinit var cookieJar: CommonsCookieJar
@OptIn(ExperimentalMaterial3Api::class)
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val url = intent.getStringExtra(VANISH_ACCOUNT_URL)
val successUrl = intent.getStringExtra(VANISH_ACCOUNT_SUCCESS_URL)
if (url == null || successUrl == null) {
finish()
return
}
ApplicationlessInjection
.getInstance(applicationContext)
.commonsApplicationComponent
.inject(this)
setCookies(url)
enableEdgeToEdge()
setContent {
Scaffold(
topBar = {
TopAppBar(
modifier = Modifier,
title = { Text(getString(R.string.vanish_account)) },
navigationIcon = {
IconButton(
onClick = {
// Close the WebView Activity if the user taps the back button
finish()
},
) {
Icon(
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
// TODO("Add contentDescription)
contentDescription = ""
)
}
}
)
},
content = {
WebViewComponent(
url = url,
successUrl = successUrl,
onSuccess = {
//Redirect the user to login screen like we do when the user logout's
val app = applicationContext as CommonsApplication
app.clearApplicationData(
applicationContext,
ActivityLogoutListener(activity = this, ctx = applicationContext)
)
finish()
},
modifier = Modifier
.fillMaxSize()
.padding(it)
)
}
)
}
}
/**
* @param url The initial URL which we are loading in the WebView.
* @param successUrl The URL that, when reached, triggers the `onSuccess` callback.
* @param onSuccess A callback that is invoked when the current url of webView is successUrl.
* This is used when we want to close when the webView once a success url is hit.
* @param modifier An optional [Modifier] to customize the layout or appearance of the WebView.
*/
@SuppressLint("SetJavaScriptEnabled")
@Composable
private fun WebViewComponent(
url: String,
successUrl: String,
onSuccess: () -> Unit,
modifier: Modifier = Modifier
) {
val webView = remember { mutableStateOf<WebView?>(null) }
AndroidView(
modifier = modifier,
factory = {
WebView(it).apply {
settings.apply {
javaScriptEnabled = true
domStorageEnabled = true
javaScriptCanOpenWindowsAutomatically = true
}
webViewClient = object : WebViewClient() {
override fun shouldOverrideUrlLoading(
view: WebView?,
request: WebResourceRequest?
): Boolean {
request?.url?.let { url ->
Timber.d("URL Loading: $url")
if (url.toString() == successUrl) {
Timber.d("Success URL detected. Closing WebView.")
onSuccess() // Close the activity
return true
}
return false
}
return false
}
override fun onPageFinished(view: WebView?, url: String?) {
super.onPageFinished(view, url)
setCookies(url.orEmpty())
}
}
webChromeClient = object : WebChromeClient() {
override fun onConsoleMessage(message: ConsoleMessage): Boolean {
Timber.d("%s%s",
"Console: ${message.message()} -- From line ",
"${message.lineNumber()} of ${message.sourceId()}")
return true
}
}
loadUrl(url)
}
},
update = {
webView.value = it
}
)
}
/**
* Sets cookies for the given URL using the cookies stored in the `CommonsCookieJar`.
*
* @param url The URL for which cookies need to be set.
*/
private fun setCookies(url: String) {
CookieManager.getInstance().let {
val cookies = cookieJar.loadForRequest(url.toHttpUrl())
for (cookie in cookies) {
it.setCookie(url, cookie.toString())
}
}
}
companion object {
private const val VANISH_ACCOUNT_URL = "VanishAccountUrl"
private const val VANISH_ACCOUNT_SUCCESS_URL = "vanishAccountSuccessUrl"
/**
* Launch the WebViewActivity with the specified URL and success URL.
* @param context The context from which the activity is launched.
* @param url The initial URL to load in the WebView.
* @param successUrl The URL that triggers the WebView to close when matched.
*/
fun showWebView(
context: Context,
url: String,
successUrl: String
) {
val intent = Intent(
context,
SingleWebViewActivity::class.java
).apply {
putExtra(VANISH_ACCOUNT_URL, url)
putExtra(VANISH_ACCOUNT_SUCCESS_URL, successUrl)
}
context.startActivity(intent)
}
}
}

View file

@ -1,50 +0,0 @@
package fr.free.nrw.commons.auth;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.content.Context;
import androidx.annotation.Nullable;
import fr.free.nrw.commons.BuildConfig;
import timber.log.Timber;
public class AccountUtil {
public static final String AUTH_COOKIE = "authCookie";
public static final String AUTH_TOKEN_TYPE = "CommonsAndroid";
public AccountUtil() {
}
/**
* @return Account|null
*/
@Nullable
public static Account account(Context context) {
try {
Account[] accounts = accountManager(context).getAccountsByType(BuildConfig.ACCOUNT_TYPE);
if (accounts.length > 0) {
return accounts[0];
}
} catch (SecurityException e) {
Timber.e(e);
}
return null;
}
@Nullable
public static String getUserName(Context context) {
Account account = account(context);
return account == null ? null : account.name;
}
@Nullable
public static String getPassword(Context context) {
Account account = account(context);
return account == null ? null : accountManager(context).getPassword(account);
}
private static AccountManager accountManager(Context context) {
return AccountManager.get(context);
}
}

View file

@ -0,0 +1,24 @@
package fr.free.nrw.commons.auth
import android.accounts.Account
import android.accounts.AccountManager
import android.content.Context
import androidx.annotation.VisibleForTesting
import fr.free.nrw.commons.BuildConfig.ACCOUNT_TYPE
import timber.log.Timber
const val AUTH_TOKEN_TYPE: String = "CommonsAndroid"
fun getUserName(context: Context): String? {
return account(context)?.name
}
@VisibleForTesting
fun account(context: Context): Account? = try {
val accountManager = AccountManager.get(context)
val accounts = accountManager.getAccountsByType(ACCOUNT_TYPE)
if (accounts.isNotEmpty()) accounts[0] else null
} catch (e: SecurityException) {
Timber.e(e)
null
}

View file

@ -1,462 +0,0 @@
package fr.free.nrw.commons.auth;
import android.accounts.AccountAuthenticatorActivity;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.KeyEvent;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import androidx.annotation.ColorRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.StringRes;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatDelegate;
import androidx.core.app.NavUtils;
import androidx.core.content.ContextCompat;
import com.google.android.material.textfield.TextInputLayout;
import org.wikipedia.AppAdapter;
import org.wikipedia.dataclient.ServiceFactory;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.dataclient.mwapi.MwQueryResponse;
import org.wikipedia.login.LoginClient;
import org.wikipedia.login.LoginClient.LoginCallback;
import org.wikipedia.login.LoginResult;
import javax.inject.Inject;
import javax.inject.Named;
import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.OnEditorAction;
import butterknife.OnFocusChange;
import fr.free.nrw.commons.BuildConfig;
import fr.free.nrw.commons.R;
import fr.free.nrw.commons.Utils;
import fr.free.nrw.commons.WelcomeActivity;
import fr.free.nrw.commons.contributions.MainActivity;
import fr.free.nrw.commons.di.ApplicationlessInjection;
import fr.free.nrw.commons.explore.categories.ExploreActivity;
import fr.free.nrw.commons.kvstore.JsonKvStore;
import fr.free.nrw.commons.theme.NavigationBaseActivity;
import fr.free.nrw.commons.utils.ConfigUtils;
import fr.free.nrw.commons.utils.ViewUtil;
import io.reactivex.disposables.CompositeDisposable;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import timber.log.Timber;
import static android.view.KeyEvent.KEYCODE_ENTER;
import static android.view.View.VISIBLE;
import static android.view.inputmethod.EditorInfo.IME_ACTION_DONE;
import static fr.free.nrw.commons.di.NetworkingModule.NAMED_COMMONS_WIKI_SITE;
public class LoginActivity extends AccountAuthenticatorActivity {
@Inject
SessionManager sessionManager;
@Inject
@Named(NAMED_COMMONS_WIKI_SITE)
WikiSite commonsWikiSite;
@Inject
@Named("default_preferences")
JsonKvStore applicationKvStore;
@Inject
LoginClient loginClient;
@BindView(R.id.login_button)
Button loginButton;
@BindView(R.id.login_username)
EditText usernameEdit;
@BindView(R.id.login_password)
EditText passwordEdit;
@BindView(R.id.login_two_factor)
EditText twoFactorEdit;
@BindView(R.id.error_message_container)
ViewGroup errorMessageContainer;
@BindView(R.id.error_message)
TextView errorMessage;
@BindView(R.id.login_credentials)
TextView loginCredentials;
@BindView(R.id.two_factor_container)
TextInputLayout twoFactorContainer;
ProgressDialog progressDialog;
private AppCompatDelegate delegate;
private LoginTextWatcher textWatcher = new LoginTextWatcher();
private CompositeDisposable compositeDisposable = new CompositeDisposable();
private Call<MwQueryResponse> loginToken;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ApplicationlessInjection
.getInstance(this.getApplicationContext())
.getCommonsApplicationComponent()
.inject(this);
boolean isDarkTheme = applicationKvStore.getBoolean("theme", false);
setTheme(isDarkTheme ? R.style.DarkAppTheme : R.style.LightAppTheme);
getDelegate().installViewFactory();
getDelegate().onCreate(savedInstanceState);
setContentView(R.layout.activity_login);
ButterKnife.bind(this);
usernameEdit.addTextChangedListener(textWatcher);
passwordEdit.addTextChangedListener(textWatcher);
twoFactorEdit.addTextChangedListener(textWatcher);
if (ConfigUtils.isBetaFlavour()) {
loginCredentials.setText(getString(R.string.login_credential));
} else {
loginCredentials.setVisibility(View.GONE);
}
}
@OnFocusChange(R.id.login_username)
void onUsernameFocusChanged(View view, boolean hasFocus) {
if (!hasFocus) {
ViewUtil.hideKeyboard(view);
}
}
@OnFocusChange(R.id.login_password)
void onPasswordFocusChanged(View view, boolean hasFocus) {
if (!hasFocus) {
ViewUtil.hideKeyboard(view);
}
}
@OnEditorAction(R.id.login_password)
boolean onEditorAction(int actionId, KeyEvent keyEvent) {
if (loginButton.isEnabled()) {
if (actionId == IME_ACTION_DONE) {
performLogin();
return true;
} else if ((keyEvent != null) && keyEvent.getKeyCode() == KEYCODE_ENTER) {
performLogin();
return true;
}
}
return false;
}
@OnClick(R.id.skip_login)
void skipLogin() {
new AlertDialog.Builder(this).setTitle(R.string.skip_login_title)
.setMessage(R.string.skip_login_message)
.setCancelable(false)
.setPositiveButton(R.string.yes, (dialog, which) -> {
dialog.cancel();
performSkipLogin();
})
.setNegativeButton(R.string.no, (dialog, which) -> dialog.cancel())
.show();
}
@OnClick(R.id.forgot_password)
void forgotPassword() {
Utils.handleWebUrl(this, Uri.parse(BuildConfig.FORGOT_PASSWORD_URL));
}
@OnClick(R.id.about_privacy_policy)
void onPrivacyPolicyClicked() {
Utils.handleWebUrl(this, Uri.parse(BuildConfig.PRIVACY_POLICY_URL));
}
@OnClick(R.id.sign_up_button)
void signUp() {
Intent intent = new Intent(this, SignupActivity.class);
startActivity(intent);
}
@Override
protected void onPostCreate(Bundle savedInstanceState) {
super.onPostCreate(savedInstanceState);
getDelegate().onPostCreate(savedInstanceState);
}
@Override
protected void onResume() {
super.onResume();
if (applicationKvStore.getBoolean("firstrun", true)) {
WelcomeActivity.startYourself(this);
}
if (sessionManager.getCurrentAccount() != null
&& sessionManager.isUserLoggedIn()) {
applicationKvStore.putBoolean("login_skipped", false);
startMainActivity();
}
if (applicationKvStore.getBoolean("login_skipped", false)) {
performSkipLogin();
}
}
@Override
protected void onDestroy() {
compositeDisposable.clear();
try {
// To prevent leaked window when finish() is called, see http://stackoverflow.com/questions/32065854/activity-has-leaked-window-at-alertdialog-show-method
if (progressDialog != null && progressDialog.isShowing()) {
progressDialog.dismiss();
}
} catch (Exception e) {
e.printStackTrace();
}
usernameEdit.removeTextChangedListener(textWatcher);
passwordEdit.removeTextChangedListener(textWatcher);
twoFactorEdit.removeTextChangedListener(textWatcher);
delegate.onDestroy();
if(null!=loginClient) {
loginClient.cancel();
}
super.onDestroy();
}
@OnClick(R.id.login_button)
public void performLogin() {
Timber.d("Login to start!");
final String username = usernameEdit.getText().toString();
final String rawUsername = usernameEdit.getText().toString().trim();
final String password = passwordEdit.getText().toString();
String twoFactorCode = twoFactorEdit.getText().toString();
showLoggingProgressBar();
doLogin(username, password, twoFactorCode);
}
private void doLogin(String username, String password, String twoFactorCode) {
progressDialog.show();
loginToken = ServiceFactory.get(commonsWikiSite).getLoginToken();
loginToken.enqueue(
new Callback<MwQueryResponse>() {
@Override
public void onResponse(Call<MwQueryResponse> call,
Response<MwQueryResponse> response) {
loginClient.login(commonsWikiSite, username, password, null, twoFactorCode,
response.body().query().loginToken(), new LoginCallback() {
@Override
public void success(@NonNull LoginResult result) {
Timber.d("Login Success");
onLoginSuccess(result);
}
@Override
public void twoFactorPrompt(@NonNull Throwable caught,
@Nullable String token) {
Timber.d("Requesting 2FA prompt");
hideProgress();
askUserForTwoFactorAuth();
}
@Override
public void passwordResetPrompt(@Nullable String token) {
Timber.d("Showing password reset prompt");
hideProgress();
showPasswordResetPrompt();
}
@Override
public void error(@NonNull Throwable caught) {
Timber.e(caught);
hideProgress();
showMessageAndCancelDialog(caught.getLocalizedMessage());
}
});
}
@Override
public void onFailure(Call<MwQueryResponse> call, Throwable t) {
Timber.e(t);
showMessageAndCancelDialog(t.getLocalizedMessage());
}
});
}
private void hideProgress() {
progressDialog.dismiss();
}
private void showPasswordResetPrompt() {
showMessageAndCancelDialog(getString(R.string.you_must_reset_your_passsword));
}
/**
* This function is called when user skips the login.
* It redirects the user to Explore Activity.
*/
private void performSkipLogin() {
applicationKvStore.putBoolean("login_skipped", true);
ExploreActivity.startYourself(this);
finish();
}
private void showLoggingProgressBar() {
progressDialog = new ProgressDialog(this);
progressDialog.setIndeterminate(true);
progressDialog.setTitle(getString(R.string.logging_in_title));
progressDialog.setMessage(getString(R.string.logging_in_message));
progressDialog.setCanceledOnTouchOutside(false);
progressDialog.show();
}
private void onLoginSuccess(LoginResult loginResult) {
if (!progressDialog.isShowing()) {
// no longer attached to activity!
return;
}
sessionManager.setUserLoggedIn(true);
AppAdapter.get().updateAccount(loginResult);
progressDialog.dismiss();
showSuccessAndDismissDialog();
startMainActivity();
}
@Override
protected void onStart() {
super.onStart();
delegate.onStart();
}
@Override
protected void onStop() {
super.onStop();
delegate.onStop();
}
@Override
protected void onPostResume() {
super.onPostResume();
getDelegate().onPostResume();
}
@Override
public void setContentView(View view, ViewGroup.LayoutParams params) {
getDelegate().setContentView(view, params);
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
NavUtils.navigateUpFromSameTask(this);
return true;
}
return super.onOptionsItemSelected(item);
}
@Override
@NonNull
public MenuInflater getMenuInflater() {
return getDelegate().getMenuInflater();
}
public void askUserForTwoFactorAuth() {
progressDialog.dismiss();
twoFactorContainer.setVisibility(VISIBLE);
twoFactorEdit.setVisibility(VISIBLE);
twoFactorEdit.requestFocus();
InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
showMessageAndCancelDialog(R.string.login_failed_2fa_needed);
}
public void showMessageAndCancelDialog(@StringRes int resId) {
showMessage(resId, R.color.secondaryDarkColor);
if (progressDialog != null) {
progressDialog.cancel();
}
}
public void showMessageAndCancelDialog(String error) {
showMessage(error, R.color.secondaryDarkColor);
if (progressDialog != null) {
progressDialog.cancel();
}
}
public void showSuccessAndDismissDialog() {
showMessage(R.string.login_success, R.color.primaryDarkColor);
progressDialog.dismiss();
}
public void startMainActivity() {
NavigationBaseActivity.startActivityWithFlags(this, MainActivity.class, Intent.FLAG_ACTIVITY_SINGLE_TOP);
finish();
}
private void showMessage(@StringRes int resId, @ColorRes int colorResId) {
errorMessage.setText(getString(resId));
errorMessage.setTextColor(ContextCompat.getColor(this, colorResId));
errorMessageContainer.setVisibility(VISIBLE);
}
private void showMessage(String message, @ColorRes int colorResId) {
errorMessage.setText(message);
errorMessage.setTextColor(ContextCompat.getColor(this, colorResId));
errorMessageContainer.setVisibility(VISIBLE);
}
private AppCompatDelegate getDelegate() {
if (delegate == null) {
delegate = AppCompatDelegate.create(this, null);
}
return delegate;
}
private class LoginTextWatcher implements TextWatcher {
@Override
public void beforeTextChanged(CharSequence charSequence, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence charSequence, int start, int count, int after) {
}
@Override
public void afterTextChanged(Editable editable) {
boolean enabled = usernameEdit.getText().length() != 0 && passwordEdit.getText().length() != 0
&& (BuildConfig.DEBUG || twoFactorEdit.getText().length() != 0 || twoFactorEdit.getVisibility() != VISIBLE);
loginButton.setEnabled(enabled);
}
}
public static void startYourself(Context context) {
Intent intent = new Intent(context, LoginActivity.class);
context.startActivity(intent);
}
}

View file

@ -0,0 +1,489 @@
package fr.free.nrw.commons.auth
import android.accounts.AccountAuthenticatorActivity
import android.app.ProgressDialog
import android.content.Context
import android.content.DialogInterface
import android.content.Intent
import android.net.Uri
import android.os.Bundle
import android.view.KeyEvent
import android.view.MenuInflater
import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
import android.view.inputmethod.EditorInfo
import android.view.inputmethod.InputMethodManager
import android.widget.TextView
import androidx.annotation.ColorRes
import androidx.annotation.StringRes
import androidx.annotation.VisibleForTesting
import androidx.appcompat.app.AlertDialog
import androidx.appcompat.app.AppCompatDelegate
import androidx.core.app.NavUtils
import androidx.core.content.ContextCompat
import androidx.core.view.WindowCompat
import fr.free.nrw.commons.BuildConfig
import fr.free.nrw.commons.CommonsApplication
import fr.free.nrw.commons.R
import fr.free.nrw.commons.auth.login.LoginCallback
import fr.free.nrw.commons.auth.login.LoginClient
import fr.free.nrw.commons.auth.login.LoginResult
import fr.free.nrw.commons.contributions.MainActivity
import fr.free.nrw.commons.databinding.ActivityLoginBinding
import fr.free.nrw.commons.di.ApplicationlessInjection
import fr.free.nrw.commons.kvstore.JsonKvStore
import fr.free.nrw.commons.utils.applyEdgeToEdgeAllInsets
import fr.free.nrw.commons.utils.AbstractTextWatcher
import fr.free.nrw.commons.utils.ActivityUtils.startActivityWithFlags
import fr.free.nrw.commons.utils.ConfigUtils.isBetaFlavour
import fr.free.nrw.commons.utils.SystemThemeUtils
import fr.free.nrw.commons.utils.ViewUtil.hideKeyboard
import fr.free.nrw.commons.utils.handleKeyboardInsets
import fr.free.nrw.commons.utils.handleWebUrl
import io.reactivex.disposables.CompositeDisposable
import timber.log.Timber
import java.util.Locale
import javax.inject.Inject
import javax.inject.Named
class LoginActivity : AccountAuthenticatorActivity() {
@Inject
lateinit var sessionManager: SessionManager
@Inject
@field:Named("default_preferences")
lateinit var applicationKvStore: JsonKvStore
@Inject
lateinit var loginClient: LoginClient
@Inject
lateinit var systemThemeUtils: SystemThemeUtils
private var binding: ActivityLoginBinding? = null
private var progressDialog: ProgressDialog? = null
private val textWatcher = AbstractTextWatcher(::onTextChanged)
private val compositeDisposable = CompositeDisposable()
private val delegate: AppCompatDelegate by lazy {
AppCompatDelegate.create(this, null)
}
private var lastLoginResult: LoginResult? = null
public override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
ApplicationlessInjection
.getInstance(this.applicationContext)
.commonsApplicationComponent
.inject(this)
val isDarkTheme = systemThemeUtils.isDeviceInNightMode()
setTheme(if (isDarkTheme) R.style.DarkAppTheme else R.style.LightAppTheme)
delegate.installViewFactory()
delegate.onCreate(savedInstanceState)
WindowCompat.getInsetsController(window, window.decorView)
.isAppearanceLightStatusBars = !isDarkTheme
WindowCompat.setDecorFitsSystemWindows(window, false)
binding = ActivityLoginBinding.inflate(layoutInflater)
applyEdgeToEdgeAllInsets(binding!!.root)
binding!!.root.handleKeyboardInsets()
with(binding!!) {
setContentView(root)
loginUsername.addTextChangedListener(textWatcher)
loginPassword.addTextChangedListener(textWatcher)
loginTwoFactor.addTextChangedListener(textWatcher)
skipLogin.setOnClickListener { skipLogin() }
forgotPassword.setOnClickListener { forgotPassword() }
aboutPrivacyPolicy.setOnClickListener { onPrivacyPolicyClicked() }
signUpButton.setOnClickListener { signUp() }
loginButton.setOnClickListener { performLogin() }
loginPassword.setOnEditorActionListener { textView, actionId, keyEvent ->
if (binding!!.loginButton.isEnabled && isTriggerAction(actionId, keyEvent)) {
if (actionId == EditorInfo.IME_ACTION_NEXT && lastLoginResult != null) {
askUserForTwoFactorAuthWithKeyboard()
true
} else {
performLogin()
true
}
} else {
false
}
}
loginPassword.onFocusChangeListener =
View.OnFocusChangeListener(::onPasswordFocusChanged)
if (isBetaFlavour) {
loginCredentials.text = getString(R.string.login_credential)
} else {
loginCredentials.visibility = View.GONE
}
intent.getStringExtra(CommonsApplication.LOGIN_MESSAGE_INTENT_KEY)?.let {
showMessage(it, R.color.secondaryDarkColor)
}
intent.getStringExtra(CommonsApplication.LOGIN_USERNAME_INTENT_KEY)?.let {
loginUsername.setText(it)
}
}
}
@VisibleForTesting
fun askUserForTwoFactorAuthWithKeyboard() {
if (binding == null) {
Timber.w("Binding is null, reinitializing in askUserForTwoFactorAuthWithKeyboard")
binding = ActivityLoginBinding.inflate(layoutInflater)
setContentView(binding!!.root)
}
progressDialog!!.dismiss()
if (binding != null) {
with(binding!!) {
twoFactorContainer.visibility = View.VISIBLE
twoFactorContainer.hint = getString(if (lastLoginResult is LoginResult.EmailAuthResult) R.string.email_auth_code else R.string._2fa_code)
loginTwoFactor.visibility = View.VISIBLE
loginTwoFactor.requestFocus()
val imm = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
imm.showSoftInput(loginTwoFactor, InputMethodManager.SHOW_IMPLICIT)
loginTwoFactor.setOnEditorActionListener { _, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_DONE ||
(event != null && event.keyCode == KeyEvent.KEYCODE_ENTER && event.action == KeyEvent.ACTION_DOWN)) {
performLogin()
true
} else {
false
}
}
}
} else {
Timber.e("Binding is null in askUserForTwoFactorAuthWithKeyboard after reinitialization attempt")
}
showMessageAndCancelDialog(getString(if (lastLoginResult is LoginResult.EmailAuthResult) R.string.login_failed_email_auth_needed else R.string.login_failed_2fa_needed))
}
override fun onPostCreate(savedInstanceState: Bundle?) {
super.onPostCreate(savedInstanceState)
delegate.onPostCreate(savedInstanceState)
}
override fun onResume() {
super.onResume()
if (sessionManager.currentAccount != null && sessionManager.isUserLoggedIn) {
applicationKvStore.putBoolean("login_skipped", false)
startMainActivity()
}
if (applicationKvStore.getBoolean("login_skipped", false)) {
performSkipLogin()
}
}
override fun onDestroy() {
compositeDisposable.clear()
try {
// To prevent leaked window when finish() is called, see http://stackoverflow.com/questions/32065854/activity-has-leaked-window-at-alertdialog-show-method
if (progressDialog?.isShowing == true) {
progressDialog!!.dismiss()
}
} catch (e: Exception) {
e.printStackTrace()
}
with(binding!!) {
loginUsername.removeTextChangedListener(textWatcher)
loginPassword.removeTextChangedListener(textWatcher)
loginTwoFactor.removeTextChangedListener(textWatcher)
}
delegate.onDestroy()
loginClient.cancel()
binding = null
super.onDestroy()
}
override fun onStart() {
super.onStart()
delegate.onStart()
}
override fun onStop() {
super.onStop()
delegate.onStop()
}
override fun onPostResume() {
super.onPostResume()
delegate.onPostResume()
}
override fun setContentView(view: View, params: ViewGroup.LayoutParams) {
delegate.setContentView(view, params)
}
override fun onOptionsItemSelected(item: MenuItem): Boolean {
when (item.itemId) {
android.R.id.home -> {
NavUtils.navigateUpFromSameTask(this)
return true
}
}
return super.onOptionsItemSelected(item)
}
override fun onSaveInstanceState(outState: Bundle) {
// if progressDialog is visible during the configuration change then store state as true else false so that
// we maintain visibility of progressDialog after configuration change
if (progressDialog != null && progressDialog!!.isShowing) {
outState.putBoolean(SAVE_PROGRESS_DIALOG, true)
} else {
outState.putBoolean(SAVE_PROGRESS_DIALOG, false)
}
outState.putString(
SAVE_ERROR_MESSAGE,
binding!!.errorMessage.text.toString()
) //Save the errorMessage
outState.putString(
SAVE_USERNAME,
binding!!.loginUsername.text.toString()
) // Save the username
outState.putString(
SAVE_PASSWORD,
binding!!.loginPassword.text.toString()
) // Save the password
}
override fun onRestoreInstanceState(savedInstanceState: Bundle) {
super.onRestoreInstanceState(savedInstanceState)
binding!!.loginUsername.setText(savedInstanceState.getString(SAVE_USERNAME))
binding!!.loginPassword.setText(savedInstanceState.getString(SAVE_PASSWORD))
if (savedInstanceState.getBoolean(SAVE_PROGRESS_DIALOG)) {
performLogin()
}
val errorMessage = savedInstanceState.getString(SAVE_ERROR_MESSAGE)
if (sessionManager.isUserLoggedIn) {
showMessage(R.string.login_success, R.color.primaryDarkColor)
} else {
showMessage(errorMessage, R.color.secondaryDarkColor)
}
}
/**
* Hides the keyboard if the user's focus is not on the password (hasFocus is false).
* @param view The keyboard
* @param hasFocus Set to true if the keyboard has focus
*/
private fun onPasswordFocusChanged(view: View, hasFocus: Boolean) {
if (!hasFocus) {
hideKeyboard(view)
}
}
private fun onEditorAction(textView: TextView, actionId: Int, keyEvent: KeyEvent?) =
if (binding!!.loginButton.isEnabled && isTriggerAction(actionId, keyEvent)) {
performLogin()
true
} else false
private fun isTriggerAction(actionId: Int, keyEvent: KeyEvent?) =
actionId == EditorInfo.IME_ACTION_NEXT || actionId == EditorInfo.IME_ACTION_DONE || keyEvent?.keyCode == KeyEvent.KEYCODE_ENTER
private fun skipLogin() {
AlertDialog.Builder(this)
.setTitle(R.string.skip_login_title)
.setMessage(R.string.skip_login_message)
.setCancelable(false)
.setPositiveButton(R.string.yes) { dialog: DialogInterface, which: Int ->
dialog.cancel()
performSkipLogin()
}
.setNegativeButton(R.string.no) { dialog: DialogInterface, which: Int ->
dialog.cancel()
}
.show()
}
private fun forgotPassword() =
handleWebUrl(this, Uri.parse(BuildConfig.FORGOT_PASSWORD_URL))
private fun onPrivacyPolicyClicked() =
handleWebUrl(this, Uri.parse(BuildConfig.PRIVACY_POLICY_URL))
private fun signUp() =
startActivity(Intent(this, SignupActivity::class.java))
@VisibleForTesting
fun performLogin() {
Timber.d("Login to start!")
val username = binding!!.loginUsername.text.toString()
val password = binding!!.loginPassword.text.toString()
val twoFactorCode = binding!!.loginTwoFactor.text.toString()
showLoggingProgressBar()
loginClient.doLogin(username,
password,
lastLoginResult,
twoFactorCode,
Locale.getDefault().language,
object : LoginCallback {
override fun success(loginResult: LoginResult) = runOnUiThread {
Timber.d("Login Success")
progressDialog!!.dismiss()
onLoginSuccess(loginResult)
}
override fun twoFactorPrompt(loginResult: LoginResult, caught: Throwable, token: String?) = runOnUiThread {
Timber.d("Requesting 2FA prompt")
progressDialog!!.dismiss()
lastLoginResult = loginResult
askUserForTwoFactorAuthWithKeyboard()
}
override fun emailAuthPrompt(loginResult: LoginResult, caught: Throwable, token: String?) = runOnUiThread {
Timber.d("Requesting email auth prompt")
progressDialog!!.dismiss()
lastLoginResult = loginResult
askUserForTwoFactorAuthWithKeyboard()
}
override fun passwordResetPrompt(token: String?) = runOnUiThread {
Timber.d("Showing password reset prompt")
progressDialog!!.dismiss()
showPasswordResetPrompt()
}
override fun error(caught: Throwable) = runOnUiThread {
Timber.e(caught)
progressDialog!!.dismiss()
showMessageAndCancelDialog(caught.localizedMessage ?: "")
}
}
)
}
private fun showPasswordResetPrompt() =
showMessageAndCancelDialog(getString(R.string.you_must_reset_your_passsword))
/**
* This function is called when user skips the login.
* It redirects the user to Explore Activity.
*/
private fun performSkipLogin() {
applicationKvStore.putBoolean("login_skipped", true)
MainActivity.startYourself(this)
finish()
}
private fun showLoggingProgressBar() {
progressDialog = ProgressDialog(this).apply {
isIndeterminate = true
setTitle(getString(R.string.logging_in_title))
setMessage(getString(R.string.logging_in_message))
setCancelable(false)
}
progressDialog!!.show()
}
private fun onLoginSuccess(loginResult: LoginResult) {
compositeDisposable.clear()
sessionManager.setUserLoggedIn(true)
sessionManager.updateAccount(loginResult)
progressDialog!!.dismiss()
showSuccessAndDismissDialog()
startMainActivity()
}
override fun getMenuInflater(): MenuInflater =
delegate.menuInflater
@VisibleForTesting
fun askUserForTwoFactorAuth() {
if (binding == null) {
Timber.w("Binding is null, reinitializing in askUserForTwoFactorAuth")
binding = ActivityLoginBinding.inflate(layoutInflater)
setContentView(binding!!.root)
}
progressDialog!!.dismiss()
if (binding != null) {
with(binding!!) {
twoFactorContainer.visibility = View.VISIBLE
twoFactorContainer.hint = getString(if (lastLoginResult is LoginResult.EmailAuthResult) R.string.email_auth_code else R.string._2fa_code)
loginTwoFactor.visibility = View.VISIBLE
loginTwoFactor.requestFocus()
loginTwoFactor.setOnEditorActionListener { _, actionId, event ->
if (actionId == EditorInfo.IME_ACTION_DONE ||
(event != null && event.keyCode == KeyEvent.KEYCODE_ENTER && event.action == KeyEvent.ACTION_DOWN)) {
performLogin()
true
} else {
false
}
}
}
} else {
Timber.e("Binding is null in askUserForTwoFactorAuth after reinitialization attempt")
}
val imm = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY)
showMessageAndCancelDialog(getString(if (lastLoginResult is LoginResult.EmailAuthResult) R.string.login_failed_email_auth_needed else R.string.login_failed_2fa_needed))
}
@VisibleForTesting
fun showMessageAndCancelDialog(@StringRes resId: Int) {
showMessage(resId, R.color.secondaryDarkColor)
progressDialog?.cancel()
}
@VisibleForTesting
fun showMessageAndCancelDialog(error: String) {
showMessage(error, R.color.secondaryDarkColor)
progressDialog?.cancel()
}
@VisibleForTesting
fun showSuccessAndDismissDialog() {
showMessage(R.string.login_success, R.color.primaryDarkColor)
progressDialog!!.dismiss()
}
@VisibleForTesting
fun startMainActivity() {
startActivityWithFlags(this, MainActivity::class.java, Intent.FLAG_ACTIVITY_SINGLE_TOP)
finish()
}
private fun showMessage(@StringRes resId: Int, @ColorRes colorResId: Int) = with(binding!!) {
errorMessage.text = getString(resId)
errorMessage.setTextColor(ContextCompat.getColor(this@LoginActivity, colorResId))
errorMessageContainer.visibility = View.VISIBLE
}
private fun showMessage(message: String?, @ColorRes colorResId: Int) = with(binding!!) {
errorMessage.text = message
errorMessage.setTextColor(ContextCompat.getColor(this@LoginActivity, colorResId))
errorMessageContainer.visibility = View.VISIBLE
}
private fun onTextChanged(text: String) {
val enabled =
binding!!.loginUsername.text!!.length != 0 && binding!!.loginPassword.text!!.length != 0 &&
(BuildConfig.DEBUG || binding!!.loginTwoFactor.text!!.length != 0 || binding!!.loginTwoFactor.visibility != View.VISIBLE)
binding!!.loginButton.isEnabled = enabled
}
companion object {
fun startYourself(context: Context) =
context.startActivity(Intent(context, LoginActivity::class.java))
const val SAVE_PROGRESS_DIALOG: String = "ProgressDialog_state"
const val SAVE_ERROR_MESSAGE: String = "errorMessage"
const val SAVE_USERNAME: String = "username"
const val SAVE_PASSWORD: String = "password"
}
}

View file

@ -1,36 +0,0 @@
package fr.free.nrw.commons.auth;
import io.reactivex.Observable;
import java.util.Objects;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import org.wikipedia.dataclient.Service;
import org.wikipedia.dataclient.ServiceFactory;
import org.wikipedia.dataclient.WikiSite;
import org.wikipedia.dataclient.mwapi.MwPostResponse;
/**
* Handler for logout
*/
@Singleton
public class LogoutClient {
private final Service service;
@Inject
public LogoutClient(@Named("commons-wikisite")
WikiSite commonsWikiSite) {
service = ServiceFactory.get(commonsWikiSite);
}
/**
* Fetches the CSRF token and uses that to post the logout api call
* @return
*/
public Observable<MwPostResponse> postLogout() {
return service.getCsrfToken().concatMap(tokenResponse -> service.postLogout(
Objects.requireNonNull(Objects.requireNonNull(tokenResponse.query()).csrfToken())));
}
}

View file

@ -1,149 +0,0 @@
package fr.free.nrw.commons.auth;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.content.Context;
import android.os.Build;
import android.text.TextUtils;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.imagepipeline.core.ImagePipeline;
import org.wikipedia.login.LoginResult;
import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Singleton;
import fr.free.nrw.commons.BuildConfig;
import fr.free.nrw.commons.kvstore.JsonKvStore;
import io.reactivex.Completable;
import io.reactivex.Observable;
/**
* Manage the current logged in user session.
*/
@Singleton
public class SessionManager {
private final Context context;
private Account currentAccount; // Unlike a savings account... ;-)
private JsonKvStore defaultKvStore;
private static final String KEY_RAWUSERNAME = "rawusername";
@Inject
public SessionManager(Context context,
@Named("default_preferences") JsonKvStore defaultKvStore) {
this.context = context;
this.currentAccount = null;
this.defaultKvStore = defaultKvStore;
}
private boolean createAccount(@NonNull String userName, @NonNull String password) {
Account account = getCurrentAccount();
if (account == null || TextUtils.isEmpty(account.name) || !account.name.equals(userName)) {
removeAccount();
account = new Account(userName, BuildConfig.ACCOUNT_TYPE);
return accountManager().addAccountExplicitly(account, password, null);
}
return true;
}
private void removeAccount() {
Account account = getCurrentAccount();
if (account != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
accountManager().removeAccountExplicitly(account);
} else {
//noinspection deprecation
accountManager().removeAccount(account, null, null);
}
}
}
public void updateAccount(LoginResult result) {
boolean accountCreated = createAccount(result.getUserName(), result.getPassword());
if (accountCreated) {
setPassword(result.getPassword());
}
}
private void setPassword(@NonNull String password) {
Account account = getCurrentAccount();
if (account != null) {
accountManager().setPassword(account, password);
}
}
/**
* @return Account|null
*/
@Nullable
public Account getCurrentAccount() {
if (currentAccount == null) {
AccountManager accountManager = AccountManager.get(context);
Account[] allAccounts = accountManager.getAccountsByType(BuildConfig.ACCOUNT_TYPE);
if (allAccounts.length != 0) {
currentAccount = allAccounts[0];
}
}
return currentAccount;
}
@Nullable
public String getUserName() {
Account account = getCurrentAccount();
return account == null ? null : account.name;
}
@Nullable
private String getRawUserName() {
Account account = getCurrentAccount();
return account == null ? null : accountManager().getUserData(account, KEY_RAWUSERNAME);
}
public String getAuthorName(){
return getRawUserName() == null ? getUserName() : getRawUserName();
}
@Nullable
public String getPassword() {
Account account = getCurrentAccount();
return account == null ? null : accountManager().getPassword(account);
}
private AccountManager accountManager() {
return AccountManager.get(context);
}
public boolean isUserLoggedIn() {
return defaultKvStore.getBoolean("isUserLoggedIn", false);
}
void setUserLoggedIn(boolean isLoggedIn) {
defaultKvStore.putBoolean("isUserLoggedIn", isLoggedIn);
}
public void forceLogin(Context context) {
if (context != null) {
LoginActivity.startYourself(context);
}
}
/**
* 1. Clears existing accounts from account manager
* 2. Calls MediaWikiApi's logout function to clear cookies
* @return
*/
public Completable logout() {
AccountManager accountManager = AccountManager.get(context);
Account[] allAccounts = accountManager.getAccountsByType(BuildConfig.ACCOUNT_TYPE);
return Completable.fromObservable(Observable.fromArray(allAccounts)
.map(a -> accountManager.removeAccount(a, null, null).getResult()))
.doOnComplete(() -> {
currentAccount = null;
});
}
}

Some files were not shown because too many files have changed in this diff Show more