Skip to content

Commit

Permalink
ORCA: Chnage King County Water Taxi to Handheld (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
cookieguru authored and codebutler committed Oct 25, 2019
1 parent 18b347e commit fbfd9e2
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ sealed class TransactionViewModel(val context: Context) {
Trip.Mode.TICKET_MACHINE -> R.drawable.ic_transaction_tvm_32dp
Trip.Mode.VENDING_MACHINE -> R.drawable.ic_transaction_vend_32dp
Trip.Mode.POS -> R.drawable.ic_transaction_pos_32dp
Trip.Mode.HANDHELD -> R.drawable.ic_transaction_handheld_32dp
Trip.Mode.BANNED -> R.drawable.ic_transaction_banned_32dp
Trip.Mode.OTHER -> R.drawable.ic_transaction_unknown_32dp
else -> R.drawable.ic_transaction_unknown_32dp
Expand Down
18 changes: 18 additions & 0 deletions farebot-app/src/main/res/drawable/ic_transaction_handheld_32dp.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="100dp"
android:height="100dp"
android:viewportWidth="100"
android:viewportHeight="100">
<path
android:pathData="M69.2,43.4c0,-3.5 -2.9,-6.4 -6.4,-6.4H37.2c-3.5,0 -6.4,2.9 -6.4,6.4v36.2c0,3.5 2.9,6.4 6.4,6.4h25.7c3.5,0 6.4,-2.9 6.4,-6.4V43.4zM62.8,76.7c0,0.7 -0.5,1.2 -1.2,1.2H38.4c-0.7,0 -1.2,-0.5 -1.2,-1.2V44.9c0,-0.7 0.5,-1.2 1.2,-1.2h23.2c0.7,0 1.2,0.5 1.2,1.2V76.7z"
android:fillColor="#000000"/>
<path
android:pathData="M65.9,22.8c0.3,-0.3 0.4,-0.6 0.4,-1c0,-0.3 -0.1,-0.7 -0.4,-1c-4.2,-4.3 -9.9,-6.7 -15.8,-6.8s-11.7,2.3 -16,6.5c-0.6,0.6 -0.6,1.4 0,2c0.6,0.6 1.4,0.6 2,0c3.8,-3.7 8.7,-5.7 14,-5.7c5.3,0.1 10.2,2.1 13.9,5.9C64.5,23.3 65.3,23.3 65.9,22.8z"
android:fillColor="#000000"/>
<path
android:pathData="M60.9,27.7c0.3,-0.3 0.4,-0.6 0.4,-1s-0.1,-0.7 -0.4,-1c-2.9,-3 -6.8,-4.6 -10.9,-4.7c-4,0 -7.9,1.6 -10.9,4.5c-0.6,0.6 -0.6,1.4 0,2s1.4,0.6 2,0c2.4,-2.4 5.6,-3.7 9,-3.6c3.4,0 6.5,1.4 8.9,3.8C59.5,28.3 60.3,28.3 60.9,27.7z"
android:fillColor="#000000"/>
<path
android:pathData="M44,30.6c-0.5,0.5 -0.5,1.4 0.1,2s1.4,0.6 2,0c2.2,-2.2 5.8,-2.1 8,0.1c0.6,0.6 1.4,0.6 2,0c0.3,-0.3 0.4,-0.6 0.4,-1c0,-0.3 -0.1,-0.7 -0.4,-1C52.7,27.4 47.3,27.3 44,30.6z"
android:fillColor="#000000"/>
</vector>
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public abstract class OrcaTransitInfo extends TransitInfo {
static final int FTP_TYPE_CUSTOMER_SERVICE = 0x0B;
static final int FTP_TYPE_BUS = 0x80;
static final int FTP_TYPE_LINK = 0xFB;
static final int FTP_TYPE_WATER_TAXI = 0xFE;
static final int FTP_TYPE_HANDHELD = 0xFE;
static final int FTP_TYPE_STREETCAR = 0xF9;
static final int FTP_TYPE_BRT = 0xFA; //May also apply to future hardwired bus readers

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,9 @@ public String getAgencyName(@NonNull Resources resources) {
case OrcaTransitInfo.AGENCY_CT:
return resources.getString(R.string.transit_orca_agency_ct);
case OrcaTransitInfo.AGENCY_KCM:
// The King County Water Taxi is now a separate agency but uses KCM's agency ID
if (getFTPType() == OrcaTransitInfo.FTP_TYPE_WATER_TAXI) {
return resources.getString(R.string.transit_orca_agency_kcwt);
// This type seems to be reserved for all of KCM's handheld scanners
if (getFTPType() == OrcaTransitInfo.FTP_TYPE_HANDHELD) {
return resources.getString(R.string.transit_orca_agency_handheld);
} else {
return resources.getString(R.string.transit_orca_agency_kcm);
}
Expand All @@ -517,8 +517,8 @@ public String getShortAgencyName(@NonNull Resources resources) {
case OrcaTransitInfo.AGENCY_CT:
return "CT";
case OrcaTransitInfo.AGENCY_KCM:
if (getFTPType() == OrcaTransitInfo.FTP_TYPE_WATER_TAXI) {
return "KCWT";
if (getFTPType() == OrcaTransitInfo.FTP_TYPE_HANDHELD) {
return "Handheld";
} else {
return "KCM";
}
Expand Down Expand Up @@ -550,8 +550,8 @@ public String getRouteName(@NonNull Resources resources) {
switch ((int)getFTPType()) {
case OrcaTransitInfo.FTP_TYPE_BUS:
return resources.getString(R.string.transit_orca_route_bus);
case OrcaTransitInfo.FTP_TYPE_WATER_TAXI:
return resources.getString(R.string.transit_orca_route_water_taxi);
case OrcaTransitInfo.FTP_TYPE_HANDHELD:
return null; // Irrevant for this type
case OrcaTransitInfo.FTP_TYPE_BRT:
return resources.getString(R.string.transit_orca_route_brt);
}
Expand Down Expand Up @@ -635,6 +635,8 @@ public String getStartStationName(@NonNull Resources resources) {
} else if (getFTPType() == OrcaTransitInfo.FTP_TYPE_BUS) {
return resources.getString(R.string.transit_orca_station_coach,
Long.toString(getCoachNumber()));
} else if (getFTPType() == OrcaTransitInfo.FTP_TYPE_HANDHELD) {
return resources.getString(R.string.transit_orca_agency_handheld);
} else {
return resources.getString(R.string.transit_orca_station_unknown_location,
Long.toString(getCoachNumber()));
Expand All @@ -659,11 +661,12 @@ public Mode getMode() {
return Mode.METRO;
} else if (isSounder()) {
return Mode.TRAIN;
} else if (getFTPType() == OrcaTransitInfo.FTP_TYPE_FERRY
|| getFTPType() == OrcaTransitInfo.FTP_TYPE_WATER_TAXI) {
} else if (getFTPType() == OrcaTransitInfo.FTP_TYPE_FERRY) {
return Mode.FERRY;
} else if (isSeattleStreetcar()) {
return Mode.TRAM;
} else if (getFTPType() == OrcaTransitInfo.FTP_TYPE_HANDHELD) {
return Mode.HANDHELD;
} else {
return Mode.BUS;
}
Expand Down
3 changes: 1 addition & 2 deletions farebot-transit-orca/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,13 @@
<string name="transit_orca_agency_wsf">Washington State Ferries</string>
<string name="transit_orca_agency_et">Everett Transit</string>
<string name="transit_orca_agency_kt">Kitsap Transit</string>
<string name="transit_orca_agency_kcwt">King County Water Taxi</string>
<string name="transit_orca_agency_handheld">Handheld Scanner</string>
<string name="transit_orca_agency_unknown">Unknown Agency: %s</string>

<string name="transit_orca_route_link">Link Light Rail</string>
<string name="transit_orca_route_sounder">Sounder Train</string>
<string name="transit_orca_route_express_bus">Express Bus</string>
<string name="transit_orca_route_bus">Bus</string>
<string name="transit_orca_route_water_taxi">Water Taxi</string>
<string name="transit_orca_route_brt">Bus Rapid Transit</string>

<string name="transit_orca_station_coach">Coach #%s</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ public enum Mode {
VENDING_MACHINE,
POS,
OTHER,
HANDHELD,
BANNED
}

Expand Down

0 comments on commit fbfd9e2

Please sign in to comment.