Commit graph

359 commits

Author SHA1 Message Date
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
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
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
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
tamojitdas
74f2e9cd60
fix: unit tests for switching from MapBox to OpenStreetMap (#5536)
Fixes #5408
2024-02-18 14:06:40 +00:00
Adam Jones
1cbce77d5f
Migrate from Kotlin synthetics to Jetpack view binding (#5546) 2024-02-14 18:29:06 +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
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
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
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
Paul Hawke
84ffffbbe7
Create CsrfTokenClient and LoginClient by injection, along with a little cleanup (#5491) 2024-01-29 12:36:57 +09:00
Kaartic Sivaraam
805076ee6b Update test case for the toolforge URL change 2024-01-28 17:09:43 +05:30
Paul Hawke
9e970123fd
Removed references to the data-client Service interface (#5484) 2024-01-28 08:25:56 +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
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
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
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
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
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
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