mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 04:19:51 +00:00
line colors
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@652 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
a945215f35
commit
497dc8ad40
1 changed files with 25 additions and 0 deletions
|
@ -18,11 +18,14 @@
|
||||||
package de.schildbach.pte;
|
package de.schildbach.pte;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Location;
|
import de.schildbach.pte.dto.Location;
|
||||||
import de.schildbach.pte.dto.LocationType;
|
import de.schildbach.pte.dto.LocationType;
|
||||||
|
import de.schildbach.pte.util.Color;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Andreas Schildbach
|
* @author Andreas Schildbach
|
||||||
|
@ -72,4 +75,26 @@ public class MetProvider extends AbstractEfaProvider
|
||||||
{
|
{
|
||||||
return String.format(NEARBY_STATION_URI, stationId);
|
return String.format(NEARBY_STATION_URI, stationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Map<Character, int[]> LINES = new HashMap<Character, int[]>();
|
||||||
|
|
||||||
|
static
|
||||||
|
{
|
||||||
|
LINES.put('R', new int[] { Color.parseColor("#a24ba3"), Color.WHITE });
|
||||||
|
LINES.put('S', new int[] { Color.parseColor("#3a75c4"), Color.WHITE });
|
||||||
|
LINES.put('T', new int[] { Color.parseColor("#5bbf21"), Color.WHITE });
|
||||||
|
LINES.put('B', new int[] { Color.parseColor("#f77f00"), Color.WHITE });
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int[] lineColors(final String line)
|
||||||
|
{
|
||||||
|
// TODO NightRider buses (buses with numbers > 940): #f26522
|
||||||
|
|
||||||
|
final int[] lineColors = LINES.get(line.charAt(0));
|
||||||
|
if (lineColors != null)
|
||||||
|
return lineColors;
|
||||||
|
else
|
||||||
|
return super.lineColors(line);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue