Skip to content

Commit 5661e8c

Browse files
Fixed flickering of nearby banner compass (commons-app#5486)
1 parent 9e97012 commit 5661e8c

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

app/src/main/java/fr/free/nrw/commons/contributions/ContributionsFragment.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ private void updateNearbyNotification(@Nullable NearbyController.NearbyPlacesInf
542542
String distance = formatDistanceBetween(curLatLng, closestNearbyPlace.location);
543543
closestNearbyPlace.setDistance(distance);
544544
direction = (float) computeBearing(curLatLng, closestNearbyPlace.location);
545-
nearbyNotificationCardView.updateContent(closestNearbyPlace, direction);
545+
nearbyNotificationCardView.updateContent(closestNearbyPlace);
546546
} else {
547547
// Means that no close nearby place is found
548548
nearbyNotificationCardView.setVisibility(View.GONE);

app/src/main/java/fr/free/nrw/commons/nearby/NearbyNotificationCardView.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ private void succeeded() {
113113
}
114114

115115
/**
116-
* Pass place information to views and set compass arrow direction
116+
* Pass place information to views
117+
*
117118
* @param place Closes place where we will get information from
118-
* @param direction Direction in which compass arrow needs to be set
119119
*/
120-
public void updateContent(Place place, float direction) {
120+
public void updateContent(Place place) {
121121
Timber.d("Update nearby card notification content");
122122
this.setVisibility(VISIBLE);
123123
cardViewVisibilityState = CardViewVisibilityState.READY;
@@ -132,7 +132,6 @@ public void updateContent(Place place, float direction) {
132132
notificationIcon.setVisibility(VISIBLE);
133133
notificationTitle.setText(place.name);
134134
notificationDistance.setText(place.distance);
135-
notificationCompass.setRotation(direction);
136135
}
137136

138137
@Override

0 commit comments

Comments
 (0)