-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement - Nearby banner shows Item without image #5468
Enhancement - Nearby banner shows Item without image #5468
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strangely I am getting the error below and the nearby banner never appears:
01-27 21:46:47.715 6819 7848 V OkHttp : }
01-27 21:46:47.715 6819 7848 V OkHttp : } ]
01-27 21:46:47.715 6819 7848 V OkHttp : }
01-27 21:46:47.715 6819 7848 V OkHttp : }
01-27 21:46:47.716 6819 7848 V OkHttp : <-- END HTTP (5810-byte body)
01-27 21:46:47.727 6819 7848 D NearbyPlaces: 5 results at radius: 0,300000
01-27 21:46:47.729 6819 7848 D NearbyController: Sorting places by distance...
01-27 21:46:47.736 6819 6819 D ContributionsFragment: java.lang.NullPointerException: Attempt to read from field 'fr.free.nrw.commons.location.LatLng fr.free.nrw.commons.nearby.Place.location' on a null object reference in method 'void fr.free.nrw.commons.contributions.ContributionsFragment.updateNearbyNotification(fr.free.nrw.commons.MapController$NearbyPlacesInfo)'
01-27 21:46:47.736 6819 6819 D ContributionsFragment: at fr.free.nrw.commons.contributions.ContributionsFragment.updateNearbyNotification(ContributionsFragment.java:549)
01-27 21:46:47.736 6819 6819 D ContributionsFragment: at fr.free.nrw.commons.contributions.ContributionsFragment.$r8$lambda$zEG6wE9BQmmzsblEEtr8iaGRb5k(Unknown Source:0)
01-27 21:46:47.736 6819 6819 D ContributionsFragment: at fr.free.nrw.commons.contributions.ContributionsFragment$$ExternalSyntheticLambda2.accept(Unknown Source:4)
01-27 21:46:47.736 6819 6819 D ContributionsFragment: at io.reactivex.internal.observers.LambdaObserver.onNext(LambdaObserver.java:63)
01-27 21:46:47.736 6819 6819 D ContributionsFragment: at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:201)
01-27 21:46:47.736 6819 6819 D ContributionsFragment: at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:255)
01-27 21:46:47.736 6819 6819 D ContributionsFragment: at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:124)
01-27 21:46:47.736 6819 6819 D ContributionsFragment: at android.os.Handler.handleCallback(Handler.java:958)
01-27 21:46:47.736 6819 6819 D ContributionsFragment: at android.os.Handler.dispatchMessage(Handler.java:99)
01-27 21:46:47.736 6819 6819 D ContributionsFragment: at android.os.Looper.loopOnce(Looper.java:205)
01-27 21:46:47.736 6819 6819 D ContributionsFragment: at android.os.Looper.loop(Looper.java:294)
01-27 21:46:47.736 6819 6819 D ContributionsFragment: at android.app.ActivityThread.main(ActivityThread.java:8248)
01-27 21:46:47.736 6819 6819 D ContributionsFragment: at java.lang.reflect.Method.invoke(Native Method)
01-27 21:46:47.736 6819 6819 D ContributionsFragment: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
01-27 21:46:47.736 6819 6819 D ContributionsFragment: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
In the main branch the nearby banner loads fine.
This may be due to very recent mapbox/osmdroid changes.
Would you mind rebasing (or pulling from main)?
Thanks! :-)
Sure, I will look into it |
…o Nearby_Banner_with_No_Image
This reverts commit a41c936.
Please Review it @nicolas-raoul , I think this solves the issue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this branch now.
Despite many items without image around me (shown in the Nearby activity), thee banner shows the closest item (which already has an image).
It may be because of how nearby locations are added to the list of the places (first only the first 5 are added ), I have made the necessary changes and tested it using fakeGPS too. @nicolas-raoul Please review it and let me know the location you are testing it from and screenshots if the issue persists (I believe it will not this time ) |
Would you mind pulling from the main branch and fixing the conflict? Thanks! :-) |
…_Image # Conflicts: # app/src/main/java/fr/free/nrw/commons/contributions/ContributionsFragment.java
Sure, Done! |
Done, Please Review it @nicolas-raoul |
Strangely, sometimes I do not see thee banner appear, despite many nearby existing items with no picture. Nearby banner is enabled in the app's settings. Did you test in many locations (using FakeGPS or similar) to check? Thanks! :-) |
Can you give me the location from where you are testing it? Does it not appear immediately or have you tried waiting on the screen for a few seconds? |
@shashankiitbhu Sure, can you send me an email at my address found at https://nicolasraoul.github.io? Thanks! |
Sent! :-) |
Oh you're right! Until recently Nearby was showing several pins with no picture, but I guess something changed. |
Description (required)
Fixes #5448
What changes did you make and why?
Changed the logic to show Nearby Banner on Contributions Page to show nearest Item without an Image
Tests performed (required)
Tested {build variant, e.g. ProdDebug} on Xaomi 11 Lite NE with API level 33.
Screenshots (for UI changes only)
Need help? See https://support.google.com/android/answer/9075928
Note: Please ensure that you have read CONTRIBUTING.md if this is your first pull request.