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:
andreas.schildbach 2010-09-25 20:43:43 +00:00
parent d2becbfb23
commit 449c50f4aa

View file

@ -71,16 +71,20 @@ public class MvvProvider implements NetworkProvider
final Matcher mAutocompleteFine = P_AUTOCOMPLETE_FINE.matcher(mAutocompleteCoarse.group(1)); final Matcher mAutocompleteFine = P_AUTOCOMPLETE_FINE.matcher(mAutocompleteCoarse.group(1));
if (mAutocompleteFine.matches()) 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 String type = mAutocompleteFine.group(2);
final int locationId = Integer.parseInt(mAutocompleteFine.group(3)); final int locationId = Integer.parseInt(mAutocompleteFine.group(3));
final String city = mAutocompleteFine.group(4);
if (type.equals("stop")) if (type.equals("stop"))
{ results.add(new Autocomplete(LocationType.STATION, locationId, location));
final Autocomplete result = new Autocomplete(LocationType.STATION, locationId, city + ", " + location); else if (type.equals("street"))
results.add(result); 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 else
{ {