mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-15 00:50:31 +00:00
show auto-complete types other than station
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@202 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
d2becbfb23
commit
449c50f4aa
1 changed files with 10 additions and 6 deletions
|
@ -71,16 +71,20 @@ public class MvvProvider implements NetworkProvider
|
|||
final Matcher mAutocompleteFine = P_AUTOCOMPLETE_FINE.matcher(mAutocompleteCoarse.group(1));
|
||||
if (mAutocompleteFine.matches())
|
||||
{
|
||||
final String location = mAutocompleteFine.group(1);
|
||||
final String location = mAutocompleteFine.group(1) + ", " + mAutocompleteFine.group(4);
|
||||
final String type = mAutocompleteFine.group(2);
|
||||
final int locationId = Integer.parseInt(mAutocompleteFine.group(3));
|
||||
final String city = mAutocompleteFine.group(4);
|
||||
|
||||
if (type.equals("stop"))
|
||||
{
|
||||
final Autocomplete result = new Autocomplete(LocationType.STATION, locationId, city + ", " + location);
|
||||
results.add(result);
|
||||
}
|
||||
results.add(new Autocomplete(LocationType.STATION, locationId, location));
|
||||
else if (type.equals("street"))
|
||||
results.add(new Autocomplete(LocationType.ADDRESS, 0, location));
|
||||
else if (type.equals("singlehouse"))
|
||||
results.add(new Autocomplete(LocationType.ADDRESS, 0, location));
|
||||
else if (type.equals("poi"))
|
||||
results.add(new Autocomplete(LocationType.ANY, 0, location));
|
||||
else
|
||||
throw new IllegalStateException("unknown type " + type + " on " + uri);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue