fix #7737 (my location icon in navigation screen)

This commit is contained in:
Dmitriy Ruban 2019-11-27 14:18:32 +02:00
parent 3519ff0a57
commit c4eceebe1e

View file

@ -1703,10 +1703,12 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
public void updateFromIcon(View parentView) {
MapActivity mapActivity = getMapActivity();
int locationIconResByStatus = OsmAndLocationProvider.isLocationPermissionAvailable(mapActivity)
? R.drawable.ic_action_location_color : R.drawable.ic_action_location_color_lost;
if (mapActivity != null) {
OsmandApplication app = mapActivity.getMyApplication();
Location loc = app.getLocationProvider().getLastKnownLocation();
int locationIconResByStatus = OsmAndLocationProvider.isLocationPermissionAvailable(mapActivity) & loc != null
? R.drawable.ic_action_location_color : R.drawable.ic_action_location_color_lost;
((ImageView) parentView.findViewById(R.id.fromIcon)).setImageDrawable(ContextCompat.getDrawable(mapActivity,
mapActivity.getMyApplication().getTargetPointsHelper().getPointToStart() == null
? locationIconResByStatus : R.drawable.list_startpoint));