mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 12:23:58 +01:00
Enhancement - Nearby banner shows Item without image (#5468)
* Enhancement Nearby banner shows Item without image
* spacing
* Enhancement Nearby banner shows Item without image
* spacing
* Fix Crash
* Reverted "Fix Crash"
This reverts commit a41c9362bb.
* Fixed
* Fix null location
* Fix Conflict
* Show Only Items that exists
---------
Co-authored-by: shashankkumar <shashankkumar45556@gmail.com>
Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
This commit is contained in:
parent
60046f4881
commit
72a6fd2c90
1 changed files with 17 additions and 5 deletions
|
|
@ -538,11 +538,23 @@ public class ContributionsFragment
|
|||
|
||||
private void updateNearbyNotification(@Nullable NearbyController.NearbyPlacesInfo nearbyPlacesInfo) {
|
||||
if (nearbyPlacesInfo != null && nearbyPlacesInfo.placeList != null && nearbyPlacesInfo.placeList.size() > 0) {
|
||||
Place closestNearbyPlace = nearbyPlacesInfo.placeList.get(0);
|
||||
Place closestNearbyPlace = null;
|
||||
// Find the first nearby place that has no image and exists
|
||||
for (Place place : nearbyPlacesInfo.placeList) {
|
||||
if (place.pic.equals("") && place.exists) {
|
||||
closestNearbyPlace = place;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(closestNearbyPlace == null) {
|
||||
nearbyNotificationCardView.setVisibility(View.GONE);
|
||||
}else{
|
||||
String distance = formatDistanceBetween(curLatLng, closestNearbyPlace.location);
|
||||
closestNearbyPlace.setDistance(distance);
|
||||
direction = (float) computeBearing(curLatLng, closestNearbyPlace.location);
|
||||
nearbyNotificationCardView.updateContent(closestNearbyPlace);
|
||||
}
|
||||
} else {
|
||||
// Means that no close nearby place is found
|
||||
nearbyNotificationCardView.setVisibility(View.GONE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue