mirror of
https://gitlab.com/oeffi/oeffi.git
synced 2025-07-07 15:58:49 +00:00
StationsActivity: Always show stations with no metadata suitable for product filtering.
This commit is contained in:
parent
1f489d5e9b
commit
c16f2ef193
1 changed files with 6 additions and 0 deletions
|
@ -937,6 +937,7 @@ public class StationsActivity extends OeffiMainActivity implements StationsAware
|
|||
}
|
||||
|
||||
private static boolean filter(final Station station, final Collection<Product> productFilter) {
|
||||
// if station has products declared, use that for matching
|
||||
final Set<Product> products = station.location.products;
|
||||
if (products != null) {
|
||||
final Set<Product> copy = EnumSet.copyOf(products);
|
||||
|
@ -944,6 +945,7 @@ public class StationsActivity extends OeffiMainActivity implements StationsAware
|
|||
return !copy.isEmpty();
|
||||
}
|
||||
|
||||
// if station has lines, go through them and try to match each
|
||||
final List<LineDestination> lines = station.getLines();
|
||||
if (lines != null) {
|
||||
for (final LineDestination line : lines) {
|
||||
|
@ -955,6 +957,10 @@ public class StationsActivity extends OeffiMainActivity implements StationsAware
|
|||
}
|
||||
}
|
||||
|
||||
// special case: if station has no metadata suitable for product filtering, match always
|
||||
if (products == null && lines == null)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue