LocalitiesAutocompleteTextView

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

Link copied to clipboard
constructor(context: Context)
constructor(context: Context, attrs: AttributeSet)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int)
constructor(context: Context, attrs: AttributeSet, defStyleAttr: Int, defStyleRes: Int, popupTheme: Resources.Theme)

Properties

Link copied to clipboard

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)

Link copied to clipboard

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}")

Link copied to clipboard
var data: Data?

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.

Link copied to clipboard

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

Link copied to clipboard

This parameter is used to add a bias to the autocomplete feature. The location defines the point around which to retrieve results in priority. It must be specified with a LatLng.

Link copied to clipboard

Sets the listener that will be notified when the user clicks an autocomplete result in the drop down list.

Link copied to clipboard
var radius: Int?

This parameter may be used in addition to the location parameter to define the distance in meters within which the API will return results in priority. Results outside of the defined area may still be displayed. Default radius if this parameter is not set is 100 000.

Link copied to clipboard

The types of suggestion to return. Not specifying any type will only query LocalitiesTypes.Locality and LocalitiesTypes.PostalCode.