Issue #5996 - Fix Android Studio warnings in LocationPickerActivity.kt #6026
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description (required)
This fixes Android Studio warnings in app/src/main/java/fr/free/nrw/commons/LocationPicker/LocationPickerActivity.kt, as described in #5996
Note that just one weak warning remains:I didn't try to fix this because I believe that renaming the package falls outside of the scope of this issue (#5996). I request the reviewer to clarify whether this is the case or not.Edit: fixed. No warning or weak warning remains.
The changes made include:
Html.fromHtml(String)
call withHtmlCompat.fromHtml(String, HtmlCompat.FROM_HTML_MODE_LEGACY)
getParcelableExtra
method calls (forIntent
andBundle
) with corresponding calls inIntentCompat
andBundleCompat
.getZoomLevel
call withgetZoomLevelDouble
(fororg.osmdroid.views.MapView
)fr.free.nrw.commons.LocationPicker
tofr.free.nrw.commons.locationpicker
.Tests performed (required)
Tested BetaDebug on Medium Phone (AVD) with API level 34 and on a physical device with API Level 33. Also made sure LocationPickerActivityUnitTests pass.