Merge pull request #7990 from osmandapp/fix_7737

fix #7737 (my location icon in navigation screen)
This commit is contained in:
max-klaus 2019-11-27 18:49:30 +03:00 committed by GitHub
commit 1ae516ab16
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1704,10 +1704,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));