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
* 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"
* 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
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.
* 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
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>