Commit graph

383 commits

Author SHA1 Message Date
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
Paul Hawke
56e21ab7c8
Removed butterknife and cleaned up the test (#5446) 2024-01-17 15:35:14 +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
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
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
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
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
Nicolas Raoul
1490710a51 Merge branch 'v4.2.0-release' 2023-10-20 13:51:30 +09:00
Srishti Rohatgi
c9dfc03a20
fixes unit tests (#5354)
* fixes unit tests

* fixes failing unit tests
2023-10-20 11:50:51 +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
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
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
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
AnkitThakur98
2593f4e1b6
Replaced junit.framework with org.junit (#5253) 2023-07-06 14:25:49 +09:00
Ritika Pahwa
4a9101c614
FilePickerTest: fix failing unit test (#5237) 2023-06-16 19:41:07 +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
Nicolas Raoul
1af3297ae3 Disabled failing unit test as a temporary measure 2023-04-09 19:22:17 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
c5b527f450
fix #4971 (#4974) 2022-05-29 12:01:03 +09:00
AlexMahlon
d8724f4541
Fixes #4934. Enforces Wikimedia character blocklisting on media titles. (#4955) 2022-05-15 19:33:08 +09: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
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