Commit graph

4200 commits

Author SHA1 Message Date
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
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