Merge pull request #4586 from osmandapp/quick_action_fix

Quick action fix
This commit is contained in:
Alexey 2017-10-14 18:59:56 +03:00 committed by GitHub
commit 6adc66b7b4
2 changed files with 11 additions and 5 deletions

View file

@ -377,13 +377,13 @@ public class QuickActionFactory {
return R.drawable.ic_layer_bottom_dark;
case NavAddDestinationAction.TYPE:
return R.drawable.ic_action_target;
return R.drawable.ic_action_point_add_destination;
case NavAddFirstIntermediateAction.TYPE:
return R.drawable.ic_action_intermediate;
case NavReplaceDestinationAction.TYPE:
return R.drawable.ic_action_target;
return R.drawable.ic_action_point_add_destination;
case NavAutoZoomMapAction.TYPE:
return R.drawable.ic_action_search_dark;

View file

@ -81,11 +81,17 @@ public class NavStartStopAction extends QuickAction {
public int getIconRes(Context context) {
if (context instanceof MapActivity) {
RoutingHelper helper = ((MapActivity) context).getRoutingHelper();
if (helper.isPauseNavigation() || helper.isFollowingMode()) {
return R.drawable.ic_action_target;
if (!helper.isRoutePlanningMode() && !helper.isFollowingMode()) {
return ((MapActivity) context).getMapActions().getRouteMode(null).getSmallIconDark();
}
return R.drawable.ic_action_start_navigation;
return helper.getAppMode().getSmallIconDark();
}
return super.getIconRes(context);
}
@Override
public boolean isActionWithSlash(OsmandApplication application) {
RoutingHelper helper = application.getRoutingHelper();
return helper.isPauseNavigation() || helper.isFollowingMode();
}
}