Fixed weird transfer behavior
This commit is contained in:
parent
ab7ab0a491
commit
41a4fc9932
@ -233,7 +233,7 @@ public class Departure implements Parcelable, Comparable<Departure> {
|
||||
public String getEstimatedArrivalMinutesLeftText() {
|
||||
long minutesLeft = getEstimatedArrivalMinutesLeft();
|
||||
if (minutesLeft < 0) {
|
||||
return "Arrived";
|
||||
return "Arrived at destination";
|
||||
} else if (minutesLeft == 0) {
|
||||
return "Estimated arrival in < 1 min.";
|
||||
} else if (minutesLeft == 1) {
|
||||
|
@ -2,9 +2,7 @@ package com.dougkeen.bart.model;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
@ -202,18 +200,6 @@ public enum Station {
|
||||
public List<Route> getTransferRoutes(Station dest) {
|
||||
List<Route> returnList = new ArrayList<Route>();
|
||||
|
||||
/**
|
||||
* Kind of gimpy logic... no transfers from lake or 12th if headed to
|
||||
* somewhere between woak and daly
|
||||
*/
|
||||
if (this.equals(LAKE) || this.equals(_12TH)) {
|
||||
int destIndex = Line.BLUE.stations.indexOf(dest);
|
||||
if (destIndex >= Line.BLUE.stations.indexOf(DALY)
|
||||
&& destIndex <= Line.BLUE.stations.indexOf(WOAK)) {
|
||||
return returnList;
|
||||
}
|
||||
}
|
||||
|
||||
if (dest.getInboundTransferStation() != null) {
|
||||
// Try getting to the destination's inbound xfer station first
|
||||
returnList.addAll(getDirectRoutesForDestination(this,
|
||||
|
@ -11,16 +11,15 @@ import org.apache.http.HttpResponse;
|
||||
import org.apache.http.HttpStatus;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpUriRequest;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import android.os.AsyncTask;
|
||||
import android.util.Log;
|
||||
import android.util.Xml;
|
||||
|
||||
import com.dougkeen.bart.model.Constants;
|
||||
import com.dougkeen.bart.model.StationPair;
|
||||
import com.dougkeen.bart.model.RealTimeDepartures;
|
||||
import com.dougkeen.bart.model.Route;
|
||||
import com.dougkeen.bart.model.StationPair;
|
||||
|
||||
public abstract class GetRealTimeDeparturesTask extends
|
||||
AsyncTask<StationPair, Integer, RealTimeDepartures> {
|
||||
@ -50,7 +49,16 @@ public abstract class GetRealTimeDeparturesTask extends
|
||||
mRoutes = params.getOrigin().getDirectRoutesForDestination(
|
||||
params.getDestination());
|
||||
|
||||
if (mRoutes.isEmpty() || params.getOrigin().transferFriendly) {
|
||||
boolean hasDirectLine = false;
|
||||
for (Route route : mRoutes) {
|
||||
if (!route.hasTransfer()) {
|
||||
hasDirectLine = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (mRoutes.isEmpty()
|
||||
|| (params.getOrigin().transferFriendly && !hasDirectLine)) {
|
||||
mRoutes.addAll(params.getOrigin().getTransferRoutes(
|
||||
params.getDestination()));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user