mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
Fixed flickering of nearby banner compass (#5486)
This commit is contained in:
parent
9e970123fd
commit
5661e8c332
2 changed files with 4 additions and 5 deletions
|
|
@ -542,7 +542,7 @@ public class ContributionsFragment
|
||||||
String distance = formatDistanceBetween(curLatLng, closestNearbyPlace.location);
|
String distance = formatDistanceBetween(curLatLng, closestNearbyPlace.location);
|
||||||
closestNearbyPlace.setDistance(distance);
|
closestNearbyPlace.setDistance(distance);
|
||||||
direction = (float) computeBearing(curLatLng, closestNearbyPlace.location);
|
direction = (float) computeBearing(curLatLng, closestNearbyPlace.location);
|
||||||
nearbyNotificationCardView.updateContent(closestNearbyPlace, direction);
|
nearbyNotificationCardView.updateContent(closestNearbyPlace);
|
||||||
} else {
|
} else {
|
||||||
// Means that no close nearby place is found
|
// Means that no close nearby place is found
|
||||||
nearbyNotificationCardView.setVisibility(View.GONE);
|
nearbyNotificationCardView.setVisibility(View.GONE);
|
||||||
|
|
|
||||||
|
|
@ -113,11 +113,11 @@ public class NearbyNotificationCardView extends SwipableCardView {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pass place information to views and set compass arrow direction
|
* Pass place information to views
|
||||||
|
*
|
||||||
* @param place Closes place where we will get information from
|
* @param place Closes place where we will get information from
|
||||||
* @param direction Direction in which compass arrow needs to be set
|
|
||||||
*/
|
*/
|
||||||
public void updateContent(Place place, float direction) {
|
public void updateContent(Place place) {
|
||||||
Timber.d("Update nearby card notification content");
|
Timber.d("Update nearby card notification content");
|
||||||
this.setVisibility(VISIBLE);
|
this.setVisibility(VISIBLE);
|
||||||
cardViewVisibilityState = CardViewVisibilityState.READY;
|
cardViewVisibilityState = CardViewVisibilityState.READY;
|
||||||
|
|
@ -132,7 +132,6 @@ public class NearbyNotificationCardView extends SwipableCardView {
|
||||||
notificationIcon.setVisibility(VISIBLE);
|
notificationIcon.setVisibility(VISIBLE);
|
||||||
notificationTitle.setText(place.name);
|
notificationTitle.setText(place.name);
|
||||||
notificationDistance.setText(place.distance);
|
notificationDistance.setText(place.distance);
|
||||||
notificationCompass.setRotation(direction);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue