Result

class Result @JvmOverloads() constructor(title: CharSequence, subtitle: CharSequence?, distanceMeters: Double?, @DrawableRes() drawable: Int, @ColorInt() drawableColor: Int?, isPopulateQueryVisible: Boolean, payload: Any?) : SearchResultAdapterItem

Item that represents any search result. This can be a result from any search engine, or use case, for example, com.mapbox.search.result.SearchSuggestion, com.mapbox.search.result.SearchResult, com.mapbox.search.offline.OfflineSearchResult, etc.

Parameters

title

The title view text. Usually, this is a name of the search result.

subtitle

The subtitle view text. Usually, this is an address of the search result, or POI category.

distanceMeters

The distance in meters from user's location to the search result.

drawable

The drawable id that represents the search result. For example, this can be address icon, or category. See Maki icons.

drawableColor

The color that can be used for drawable tint. If empty, the default color will be chosen automatically.

isPopulateQueryVisible

The flag that denotes whether the Populate view will be shown. Usually, when a user clicks on that view, search result's name should be used to populate search query and initiate a search request with query's text. False by default.

payload

Anything that can be used to associate this item with the search result.

Constructors

Result
Link copied to clipboard
fun Result(title: CharSequence, subtitle: CharSequence?, distanceMeters: Double?, @DrawableRes() drawable: Int, @ColorInt() drawableColor: Int? = null, isPopulateQueryVisible: Boolean = false, payload: Any? = null)
The title view text.

Properties

distanceMeters
Link copied to clipboard
val distanceMeters: Double?
The distance in meters from user's location to the search result.
drawable
Link copied to clipboard
val drawable: Int
The drawable id that represents the search result.
drawableColor
Link copied to clipboard
val drawableColor: Int? = null
The color that can be used for drawable tint.
isPopulateQueryVisible
Link copied to clipboard
val isPopulateQueryVisible: Boolean = false
The flag that denotes whether the Populate view will be shown.
payload
Link copied to clipboard
val payload: Any? = null
Anything that can be used to associate this item with the search result.
subtitle
Link copied to clipboard
val subtitle: CharSequence?
The subtitle view text.
title
Link copied to clipboard
val title: CharSequence
The title view text.