Merge branch 'r3.3'

This commit is contained in:
crimean 2019-03-15 15:08:41 +03:00
commit 4c146f8ad7
6 changed files with 10 additions and 14 deletions

View file

@ -43,14 +43,14 @@ public class TransportRoute extends MapObject {
}
public List<Way> getForwardWays() {
return forwardWays;
return forwardWays == null ? Collections.emptyList() : forwardWays;
}
public void mergeForwardWays() {
boolean changed = true;
// combine as many ways as possible
while (changed) {
while (changed && forwardWays != null) {
changed = false;
for(int k = 0; k < forwardWays.size(); ) {
// scan to merge with the next segment
@ -113,7 +113,7 @@ public class TransportRoute extends MapObject {
if (forwardStops.size() > 0) {
// resort ways to stops order
final Map<Way, int[]> orderWays = new HashMap<Way, int[]>();
for (Way w : forwardWays) {
for (Way w : getForwardWays()) {
int[] pair = new int[] { 0, 0 };
Node firstNode = w.getFirstNode();
TransportStop st = forwardStops.get(0);

View file

@ -858,8 +858,8 @@ public class SearchUICore {
return cmp;
}
}
int st1 = Algorithms.extractFirstIntegerNumber(o1.localeName);
int st2 = Algorithms.extractFirstIntegerNumber(o2.localeName);
int st1 = o1.localeName == null ? -10000 : Algorithms.extractFirstIntegerNumber(o1.localeName);
int st2 = o2.localeName == null ? -10000 : Algorithms.extractFirstIntegerNumber(o2.localeName);
if (st1 != st2) {
return Algorithms.compare(st1, st2);
}

View file

@ -714,19 +714,15 @@ public class MapRouteInfoMenu implements IRouteInformationListener, CardListener
OnClickListener listener = new OnClickListener() {
@Override
public void onClick(View v) {
//MapActivity mapActivity = getMapActivity();
//if (mapActivity != null) {
MapActivity mapActivity = getMapActivity();
if (mapActivity != null) {
if (selected.size() > 0) {
// OsmandApplication app = mapActivity.getMyApplication();
ApplicationMode next = selected.iterator().next();
// if (app.getRoutingHelper().isRouteCalculated()) {
// app.getSettings().LAST_ROUTE_APPLICATION_MODE.set(next);
// }
updateApplicationMode(am, next);
}
updateFinishPointView();
updateOptionsButtons();
//}
}
}
};
final List<ApplicationMode> values = new ArrayList<ApplicationMode>(ApplicationMode.values(mapActivity.getMyApplication()));

View file

@ -23,7 +23,7 @@ import net.osmand.plus.wikipedia.WikipediaDialogFragment;
public class WarningCard extends BaseCard {
public static final String OSMAND_BLOG_LINK = "https://osmand.net/blog";
public static final String OSMAND_BLOG_LINK = "https://osmand.net/blog/guideline-pt";
public WarningCard(MapActivity mapActivity) {
super(mapActivity);

View file

@ -943,7 +943,6 @@ public class RoutingHelper {
public void recalculateRouteDueToSettingsChange() {
clearCurrentRoute(finalLocation, intermediatePoints);
getSettings().LAST_ROUTE_APPLICATION_MODE.set(getAppMode());
if (isPublicTransportMode()) {
Location start = lastFixedLocation;
LatLon finish = finalLocation;

View file

@ -158,6 +158,7 @@ public class TransportRoutingHelper {
private void startRouteCalculationThread(TransportRouteCalculationParams params) {
synchronized (this) {
final Thread prevRunningJob = currentRunningJob;
app.getSettings().LAST_ROUTE_APPLICATION_MODE.set(routingHelper.getAppMode());
RouteRecalculationThread newThread =
new RouteRecalculationThread("Calculating public transport route", params);
currentRunningJob = newThread;