diff --git a/src/com/dougkeen/bart/model/Departure.java b/src/com/dougkeen/bart/model/Departure.java index 95f1245..19ecc69 100644 --- a/src/com/dougkeen/bart/model/Departure.java +++ b/src/com/dougkeen/bart/model/Departure.java @@ -233,7 +233,7 @@ public class Departure implements Parcelable, Comparable { 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) { diff --git a/src/com/dougkeen/bart/model/Station.java b/src/com/dougkeen/bart/model/Station.java index 608b61b..06c3f59 100644 --- a/src/com/dougkeen/bart/model/Station.java +++ b/src/com/dougkeen/bart/model/Station.java @@ -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 getTransferRoutes(Station dest) { List returnList = new ArrayList(); - /** - * 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, diff --git a/src/com/dougkeen/bart/networktasks/GetRealTimeDeparturesTask.java b/src/com/dougkeen/bart/networktasks/GetRealTimeDeparturesTask.java index bf7fe98..9e1f003 100644 --- a/src/com/dougkeen/bart/networktasks/GetRealTimeDeparturesTask.java +++ b/src/com/dougkeen/bart/networktasks/GetRealTimeDeparturesTask.java @@ -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 { @@ -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())); }