Localities Autocomplete Text View
An editable text view that shows completion suggestions automatically while the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with.
The drop down can be dismissed at any time by pressing the back key or, if no item is selected in the drop down, by pressing the enter/dpad center key.
The list of suggestions is obtained from a LocalitiesAdapter and appears only after a given number of characters defined by the threshold.
Constructors
Properties
A grouping of countries to which you would like to restrict your results. Countries must be passed as an ISO 3166-1 Alpha-2 or Alpha-3 compatible country code. For example: fr
or fra
would restrict your results to places within France. (optional) You can use Locale to get proper codes. For example: listOf(Locale.FRANCE.isO3Country, Locale.UK.isO3Country)
This parameter allows to choose the description format for all or some of the suggestion types selected. The custom formats are described as follows (available fields depend on the returned type). For example: mapOf(LocalitiesTypes.Locality to "{name} - {administrative_area_level_0}")
By default, if the parameter is not defined, value is set as LocalitiesService.Data.Standard. The LocalitiesService.Data.Advanced value opens suggestions to worldwide postal codes in addition to postal codes for Western Europe. A dedicated option subject to specific billing on your license is needed to use this parameter. Please contact us if you are interested in using this parameter and you do not have subscribed the proper option yet.
The language code, using ISO 3166-1 Alpha-2 country codes, indicating in which language the results should be returned, if possible. If language is not supplied, the Localities service will use english as default language. No language necessary for postal_code
request. For example: Locale.FRANCE.isO3Country
Sets the listener that will be notified when the user clicks an autocomplete result in the drop down list.
The types of suggestion to return. Not specifying any type will only query LocalitiesTypes.Locality and LocalitiesTypes.PostalCode.