/tripkit/TripKitAndroidUI/com.skedgo.tripkit.ui.search/LocationSearchFragment/Builder

Builder

\ class Builder

Used to create a new instance of the fragment.

Constructors

Builder constructor()

Functions

Name Summary
allowCurrentLocation fun allowCurrentLocation(withCurrentLocation: Boolean = true): LocationSearchFragment.Builder
The fragment can optionally show a static option of "Current Location". This will be ignored if you specify your own FixedSuggestionsProvider.
allowDropPin fun allowDropPin(withDropPin: Boolean = true): LocationSearchFragment.Builder
The fragment can optionally show a static option of "Choose on Map". This will be ignored if you specify your own FixedSuggestionsProvider.
build fun build(): LocationSearchFragment
Finalize and build the Fragment
near fun near(near: LatLng?): LocationSearchFragment.Builder
Used for TripGo searches. For example, the center of a map.
showBackButton fun showBackButton(showBackButton: Boolean = true): LocationSearchFragment.Builder
Should the search box include a back button?
showSearchField fun showSearchField(showSearchField: Boolean): LocationSearchFragment.Builder
You can choose to not show the location search field, and instead orchestrate the search results on your own by calling setQuery.
withBounds fun withBounds(bounds: LatLngBounds?): LocationSearchFragment.Builder
Used for Google Places searches. For example, a map's visible boundaries.
withFixedSuggestionsProvider fun withFixedSuggestionsProvider(fixedSuggestionsProvider: FixedSuggestionsProvider): LocationSearchFragment.Builder
Fixed search results (such as Choose on Map and Current Location) are shown when the search results are empty. If you'd like to provide your own list of fixed results, you can speficy a FixedSuggestionsProvider which will be queried. This is mutually exclusive with allowCurrentLocation and allowDropPin.
withHint fun withHint(hint: String?): LocationSearchFragment.Builder
Sets the EditText hint. For example, "Where do you want to go?"
withInitialQuery fun withInitialQuery(initialQuery: String?): LocationSearchFragment.Builder
Sets the initial query.
withLocationSearchIconProvider fun withLocationSearchIconProvider(locationSearchIconProvider: LocationSearchIconProvider): LocationSearchFragment.Builder
If you want to use your own LocationSearchIconProvider, provide it here.
withLocationSearchProvider fun withLocationSearchProvider(locationSearchProvider: LocationSearchProvider): LocationSearchFragment.Builder
Additional search results can be provided (from a database, for example) using one or more LocationSearchProviders.