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