Merge pull request #7623 from osmandapp/public_transport_profiles

Fix check for public transport profile
This commit is contained in:
max-klaus 2019-10-01 19:05:41 +03:00 committed by GitHub
commit daf2aecb72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View file

@ -567,7 +567,7 @@ public class MapActivity extends OsmandActionBarActivity implements DownloadEven
: ContextCompat.getColor(this, R.color.wikivoyage_active_light);
pb.setProgressDrawable(AndroidUtils.createProgressDrawable(bgColor, progressColor));
pb.setIndeterminate(getRoutingHelper().getAppMode() == ApplicationMode.PUBLIC_TRANSPORT);
pb.setIndeterminate(getRoutingHelper().isPublicTransportMode());
pb.getIndeterminateDrawable().setColorFilter(progressColor, android.graphics.PorterDuff.Mode.SRC_IN);
}

View file

@ -950,7 +950,7 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
View startButton = mainView.findViewById(R.id.start_button);
TextViewExProgress startButtonText = (TextViewExProgress) mainView.findViewById(R.id.start_button_descr);
ProgressBar progressBar = (ProgressBar) mainView.findViewById(R.id.progress_bar_button);
boolean publicTransportMode = helper.getAppMode() == ApplicationMode.PUBLIC_TRANSPORT;
boolean publicTransportMode = helper.isPublicTransportMode();
boolean routeCalculated = isRouteCalculated();
int iconId = publicTransportMode ? R.drawable.ic_map : R.drawable.ic_action_start_navigation;
int color1;

View file

@ -357,7 +357,7 @@ public class MapRouteInfoMenuFragment extends ContextMenuFragment {
private boolean isPublicTransportMode() {
OsmandApplication app = getMyApplication();
return app != null && app.getRoutingHelper().getAppMode() == ApplicationMode.PUBLIC_TRANSPORT;
return app != null && app.getRoutingHelper().isPublicTransportMode();
}
public void updateRouteCalculationProgress(int progress) {

View file

@ -1162,7 +1162,7 @@ public class RoutingHelper {
}
public boolean isPublicTransportMode() {
return mode == ApplicationMode.PUBLIC_TRANSPORT;
return mode.isDerivedRoutingFrom(ApplicationMode.PUBLIC_TRANSPORT);
}
public boolean isRouteBeingCalculated() {