Convert nearby package to kotlin
Parent issue: #5928
I believe this converts the last remaining Java files to Kotlin in the project. Submitting as a Draft PR for now, as I know it's a little on the large size, and happy to break it into pieces for review and merging, or, convert to actual PR if you prefer.
Tested on Pixel 9 pro XL, all unit tests pass.
https://github.com/user-attachments/assets/95ec2743-df9d-4819-9de7-4c821a21bfa5
On the opposite, on branch main, pins load to red or green and stay as such.
Thanks for the feedback - I'll dig into that!
I am getting this crash when trying to upload via Nearby:
https://github.com/user-attachments/assets/15a85281-3b1f-4425-ae63-f1cea5bbca0f
STACK_TRACE=java.lang.NullPointerException: Attempt to invoke virtual method 'double fr.free.nrw.commons.location.LatLng.getLatitude()' on a null object reference
at fr.free.nrw.commons.nearby.presenter.NearbyParentFragmentPresenter.searchCloseToCurrentLocation(NearbyParentFragmentPresenter.kt:610)
In branch main, the same picture's metadata is loaded fine, and caption is correctly filled with the selected item's label.
Would you mind checking? 🙂
There's an up-coming PR (https://github.com/commons-app/apps-android-commons/pull/6579) that I believe addresses this same issue in the existing Java code. I'll convert this PR to draft and let you merge that Java one, and I'll re-convert the Java afterwards so that we are starting from a definite fix for an existing problem.
Dont worry - not abandoning this PR - just making space for the other once to come through and not get lost in the shuffle!
Understood, I started testing pull request https://github.com/commons-app/apps-android-commons/pull/6579
By any chance, would you mind reviewing its code changes? I think you are a better judge than me. :-) Context: https://github.com/commons-app/apps-android-commons/issues/6538