Permalink
Browse files

update PTE, adds support for Italy and South-West of France

  • Loading branch information...
grote committed Dec 20, 2015
1 parent 9159c33 commit 25a51433bc5aecb1b6e2f5baf96eed763139962a
View
@@ -254,6 +254,10 @@
<string name="np_desc_mersey">Liverpool City Region</string>
<string name="np_desc_br">São Paulo and Porto Alegre</string>
<string name="np_desc_vrs">Cologne, Bonn</string>
<string name="np_desc_frenchsouthwest">Poitou-Charente, Limousin, Aquitaine, Midi-Pyrénées, Bordeaux, Toulouse</string>
<string name="np_desc_frenchsouthwest_networks" translatable="false">SNCF, TransGironde, TBC, Tisséo</string>
<string name="np_desc_it">Roma, Milano, Torino, Venezia, Palermo, Trento</string>
<string name="np_desc_it_networks" translatable="false">ATM, GTT, AMAT, ACTV</string>
<string name="np_name_db">Deutsche Bahn</string>
<string name="np_name_bayern">BAVARIA</string>
@@ -264,6 +268,7 @@
<string name="np_name_spain">Spain</string>
<string name="np_name_usny">New York and New-Jersey States</string>
<string name="np_name_br">SPTRANS EPTC</string>
<string name="np_name_frenchsouthwest">FR-SW</string>
<string name="maintainer">Maintainer</string>
<string name="contributers">Contributors</string>
@@ -94,6 +94,8 @@
private static Reference<NzProvider> nzProviderRef;
private static Reference<SpainProvider> spainProviderRef;
private static Reference<BrProvider> brProviderRef;
private static Reference<ItalyProvider> italyProviderRef;
private static Reference<FrenchSouthWestProvider> frenchSouthWestProviderRef;
private static final String NAVITIA = "87a37b95-913a-4cb4-ba52-eb0bc0b304ca";
@@ -971,6 +973,32 @@ else if (networkId.equals(NetworkId.BR))
brProviderRef = new SoftReference<>(provider);
return provider;
}
else if (networkId.equals(NetworkId.IT))
{
if (italyProviderRef != null)
{
final ItalyProvider provider = italyProviderRef.get();
if (provider != null)
return provider;
}
final ItalyProvider provider = new ItalyProvider(NAVITIA);
italyProviderRef = new SoftReference<>(provider);
return provider;
}
else if (networkId.equals(NetworkId.FRENCHSOUTHWEST))
{
if (frenchSouthWestProviderRef != null)
{
final FrenchSouthWestProvider provider = frenchSouthWestProviderRef.get();
if (provider != null)
return provider;
}
final FrenchSouthWestProvider provider = new FrenchSouthWestProvider(NAVITIA);
frenchSouthWestProviderRef = new SoftReference<>(provider);
return provider;
}
else
{
throw new IllegalArgumentException(networkId.name());
@@ -366,10 +366,17 @@ public TransportNetworks(Context context) {
);
*/
// Italy
region = getString(R.string.np_region_italy);
list.add(new TransportNetwork(context, NetworkId.IT)
.setDescription(getString(R.string.np_desc_it) + "\n(" + getString(R.string.np_desc_it_networks) + ")")
.setRegion(region)
.setStatus(TransportNetwork.Status.BETA)
);
list.add(new TransportNetwork(context, NetworkId.ATC)
.setDescription(getString(R.string.np_desc_atc))
.setRegion(getString(R.string.np_region_italy))
.setRegion(region)
.setStatus(TransportNetwork.Status.BETA)
);
@@ -446,6 +453,13 @@ public TransportNetworks(Context context) {
.setStatus(TransportNetwork.Status.BETA)
);
list.add(new TransportNetwork(context, NetworkId.FRENCHSOUTHWEST)
.setName(getString(R.string.np_name_frenchsouthwest))
.setDescription(getString(R.string.np_desc_frenchsouthwest) + "\n(" + getString(R.string.np_desc_frenchsouthwest_networks) + ")")
.setRegion(region)
.setStatus(TransportNetwork.Status.BETA)
);
// New Zealand
list.add(new TransportNetwork(context, NetworkId.NZ)

0 comments on commit 25a5143

Please sign in to comment.