File tree 2 files changed +12
-4
lines changed
onebusaway-android/src/main/java/org/onebusaway/android
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 18
18
19
19
import org .onebusaway .android .BuildConfig ;
20
20
21
+ import android .graphics .Color ;
22
+
21
23
import java .util .Locale ;
22
24
import java .util .concurrent .TimeUnit ;
23
25
@@ -74,6 +76,8 @@ public class OTPConstants {
74
76
// flag to indicate intent sent by or on behalf of TripPlanActivity
75
77
public static final String INTENT_SOURCE = "org.onebusaway.android.INTENT_SOURCE" ;
76
78
79
+ public static final int OTP_TRANSIT_COLOR = Color .parseColor ("#006500" );
80
+
77
81
public enum Source {ACTIVITY , NOTIFICATION }
78
82
79
83
;
Original file line number Diff line number Diff line change 16
16
17
17
package org .onebusaway .android .map ;
18
18
19
+ import org .onebusaway .android .directions .util .OTPConstants ;
19
20
import org .onebusaway .android .io .elements .ObaShape ;
20
21
import org .onebusaway .android .io .elements .ObaShapeElement ;
21
22
import org .onebusaway .android .util .LocationUtils ;
@@ -191,6 +192,12 @@ private void zoom() {
191
192
}
192
193
193
194
private static int resolveColor (Leg leg ) {
195
+ // Color for transit routes when planning a trip
196
+ if (TraverseMode .valueOf (leg .mode ).isTransit ()) {
197
+ return OTPConstants .OTP_TRANSIT_COLOR ;
198
+ }
199
+
200
+ // Calculates color for non-trip planning situations
194
201
if (leg .routeColor != null ) {
195
202
try {
196
203
return Long .decode ("0xFF" + leg .routeColor ).intValue ();
@@ -199,10 +206,7 @@ private static int resolveColor(Leg leg) {
199
206
}
200
207
}
201
208
202
- if (TraverseMode .valueOf (leg .mode ).isTransit ()) {
203
- return Color .BLUE ;
204
- }
205
-
209
+ // Color defaults to grey which represents walking
206
210
return Color .GRAY ;
207
211
}
208
212
You can’t perform that action at this time.
0 commit comments