├── .circleci └── config.yml ├── .github ├── ISSUE_TEMPLATE │ ├── feature.md │ └── issue_template.md ├── PULL_REQUEST_TEMPLATE.md └── dependabot.yml ├── .gitignore ├── .gitmodules ├── AndroidStudio ├── code_style.xml └── dictionary.dic ├── CHANGELOG.md ├── CODEOWNERS ├── DemoApps ├── AddressAutofill │ ├── .gitignore │ ├── app │ │ ├── .gitignore │ │ ├── build.gradle │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── androidTest │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── mapbox │ │ │ │ └── demo │ │ │ │ └── autofill │ │ │ │ └── ExampleInstrumentedTest.kt │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── mapbox │ │ │ │ │ └── demo │ │ │ │ │ └── autofill │ │ │ │ │ ├── MainActivity.kt │ │ │ │ │ └── SampleAppUtils.kt │ │ │ └── res │ │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ │ ├── drawable │ │ │ │ ├── card_background.xml │ │ │ │ ├── ic_launcher_background.xml │ │ │ │ └── red_marker.png │ │ │ │ ├── layout │ │ │ │ └── activity_main.xml │ │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.webp │ │ │ │ └── ic_launcher_round.webp │ │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── strings.xml │ │ │ │ └── themes.xml │ │ │ │ └── xml │ │ │ │ ├── backup_rules.xml │ │ │ │ └── data_extraction_rules.xml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── mapbox │ │ │ └── demo │ │ │ └── autofill │ │ │ └── ExampleUnitTest.kt │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle └── SearchWithMaps │ ├── .gitignore │ ├── app │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── mapbox │ │ │ └── demo │ │ │ └── searchwithmaps │ │ │ └── ExampleInstrumentedTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── mapbox │ │ │ │ └── demo │ │ │ │ └── searchwithmaps │ │ │ │ ├── MainActivity.kt │ │ │ │ └── SampleAppUtils.kt │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ └── ic_launcher_background.xml │ │ │ ├── layout │ │ │ └── activity_main.xml │ │ │ ├── menu │ │ │ └── search_menu.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.webp │ │ │ └── ic_launcher_round.webp │ │ │ ├── values │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── themes.xml │ │ │ └── xml │ │ │ ├── backup_rules.xml │ │ │ └── data_extraction_rules.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── mapbox │ │ └── demo │ │ └── searchwithmaps │ │ └── ExampleUnitTest.kt │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── LICENSE.md ├── MapboxSearch ├── .editorconfig ├── .gitignore ├── autofill │ ├── .gitignore │ ├── api │ │ ├── api-metalava.txt │ │ └── autofill.api │ ├── build.gradle │ ├── gradle.properties │ ├── proguard-rules.pro │ ├── proguard │ │ └── consumer-proguard-autofill.txt │ └── src │ │ ├── androidTest │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ │ ├── error-response.json │ │ │ ├── retrieve_successful_1.json │ │ │ ├── retrieve_successful_2.json │ │ │ ├── retrieve_successful_3.json │ │ │ ├── suggestions_successful_empty_response.json │ │ │ └── suggestions_successful_response.json │ │ └── java │ │ │ └── com │ │ │ └── mapbox │ │ │ └── search │ │ │ └── autofill │ │ │ └── AddressAutofillIntegrationTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── mapbox │ │ │ └── search │ │ │ └── autofill │ │ │ ├── AddressAutofill.kt │ │ │ ├── AddressAutofillImpl.kt │ │ │ ├── AddressAutofillOptions.kt │ │ │ ├── AddressAutofillResult.kt │ │ │ ├── AddressAutofillResultFactory.kt │ │ │ ├── AddressAutofillSuggestion.kt │ │ │ ├── AddressComponents.kt │ │ │ ├── AutofillSearchEngine.kt │ │ │ └── Query.kt │ │ └── test │ │ └── java │ │ └── com │ │ └── mapbox │ │ └── search │ │ └── autofill │ │ ├── AddressAutofillOptionsTest.kt │ │ ├── AddressAutofillResultTest.kt │ │ ├── AddressAutofillSuggestionTest.kt │ │ ├── AddressComponentsTest.kt │ │ ├── QueryTest.kt │ │ └── TypeObjectCreator.kt ├── base │ ├── .gitignore │ ├── build.gradle │ ├── gradle.properties │ ├── proguard │ │ └── consumer-proguard-base.txt │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── mapbox │ │ │ └── search │ │ │ └── base │ │ │ └── SdkInitializationTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── mapbox │ │ │ ├── common │ │ │ └── CommonSdkLog.kt │ │ │ └── search │ │ │ └── base │ │ │ ├── Assertions.kt │ │ │ ├── BaseRequestOptions.kt │ │ │ ├── BaseResponseInfo.kt │ │ │ ├── BaseSearchCallback.kt │ │ │ ├── BaseSearchSdkInitializer.kt │ │ │ ├── BaseSearchSdkInitializerImpl.kt │ │ │ ├── BaseSearchSuggestionsCallback.kt │ │ │ ├── IsoLanguage.kt │ │ │ ├── MetadataExt.kt │ │ │ ├── SearchRequestContextProvider.kt │ │ │ ├── StubCompletionCallback.kt │ │ │ ├── concurrent │ │ │ └── CommonMainThreadChecker.kt │ │ │ ├── core │ │ │ ├── CoreAliases.kt │ │ │ ├── CoreFactoryFunctions.kt │ │ │ ├── Extensions.kt │ │ │ └── UserActivityReporter.kt │ │ │ ├── engine │ │ │ ├── BaseSearchEngine.kt │ │ │ ├── OneStepRequestCallbackWrapper.kt │ │ │ ├── TwoStepsBatchRequestCallbackWrapper.kt │ │ │ └── TwoStepsRequestCallbackWrapper.kt │ │ │ ├── factory │ │ │ ├── BusinessDetails.kt │ │ │ ├── EvConnector.kt │ │ │ ├── EvTypesFactory.kt │ │ │ ├── Facility.kt │ │ │ ├── Image.kt │ │ │ ├── LocalizedText.kt │ │ │ └── ParkingType.kt │ │ │ ├── location │ │ │ ├── LocationEngineAdapter.kt │ │ │ ├── LocationUtils.kt │ │ │ └── WrapperLocationProvider.kt │ │ │ ├── logger │ │ │ └── Log.kt │ │ │ ├── record │ │ │ ├── BaseIndexableRecord.kt │ │ │ ├── IndexableRecordResolver.kt │ │ │ └── SearchHistoryService.kt │ │ │ ├── result │ │ │ ├── BaseGeocodingCompatSearchSuggestion.kt │ │ │ ├── BaseIndexableRecordSearchResultImpl.kt │ │ │ ├── BaseIndexableRecordSearchSuggestion.kt │ │ │ ├── BaseRawResultType.kt │ │ │ ├── BaseRawSearchResult.kt │ │ │ ├── BaseSearchAddress.kt │ │ │ ├── BaseSearchResponse.kt │ │ │ ├── BaseSearchResult.kt │ │ │ ├── BaseSearchResultType.kt │ │ │ ├── BaseSearchSuggestion.kt │ │ │ ├── BaseSearchSuggestionType.kt │ │ │ ├── BaseServerSearchResultImpl.kt │ │ │ ├── BaseServerSearchSuggestion.kt │ │ │ ├── BaseSuggestAction.kt │ │ │ ├── SearchRequestContext.kt │ │ │ └── SearchResultFactory.kt │ │ │ ├── task │ │ │ ├── AsyncOperationTaskImpl.kt │ │ │ ├── CancelableWrapper.kt │ │ │ └── ExtendedAsyncOperationTask.kt │ │ │ └── utils │ │ │ ├── FormattedTimeProvider.kt │ │ │ ├── InternalIgnorableException.kt │ │ │ ├── KeyboardLocaleProvider.kt │ │ │ ├── Reflection.kt │ │ │ ├── RequestTimeoutProvider.kt │ │ │ ├── TimeProvider.kt │ │ │ ├── UUIDProvider.kt │ │ │ ├── UserAgentProvider.kt │ │ │ ├── extension │ │ │ ├── BoundingBox.kt │ │ │ ├── Context.kt │ │ │ ├── Double.kt │ │ │ ├── Expected.kt │ │ │ ├── Float.kt │ │ │ ├── Location.kt │ │ │ ├── Map.kt │ │ │ ├── PackageInfo.kt │ │ │ ├── Point.kt │ │ │ ├── RoutablePoint.kt │ │ │ ├── SearchResponseError.kt │ │ │ └── String.kt │ │ │ └── orientation │ │ │ ├── ScreenOrientation.kt │ │ │ └── ScreenOrientationProvider.kt │ │ └── test │ │ └── java │ │ └── com │ │ └── mapbox │ │ └── search │ │ └── base │ │ ├── AsyncOperationTaskTest.kt │ │ ├── WeekTimestampTest.kt │ │ ├── core │ │ └── CoreExtensionsTest.kt │ │ ├── factory │ │ ├── BusinessDetailsTest.kt │ │ ├── EvConnectorTest.kt │ │ ├── EvTypesFactoryTest.kt │ │ ├── FacilityTest.kt │ │ ├── ImageTest.kt │ │ ├── LocalizedTextTest.kt │ │ ├── ParkingTypeTest.kt │ │ └── TestObjects.kt │ │ ├── location │ │ ├── LocationEngineAdapterTest.kt │ │ └── WrapperLocationProviderTest.kt │ │ ├── logger │ │ └── LogFunctionsTest.kt │ │ ├── result │ │ ├── BaseRawResultTypeTest.kt │ │ ├── BaseRawSearchResultTest.kt │ │ ├── BaseSearchResponseTest.kt │ │ ├── BaseSearchResultTest.kt │ │ ├── BaseSearchResultTypeTest.kt │ │ ├── BaseSearchSuggestionTest.kt │ │ └── SearchResultFactoryTest.kt │ │ ├── tests_support │ │ ├── AssertionUtils.kt │ │ ├── BaseTestDataFactory.kt │ │ ├── EqualsVerifier.kt │ │ └── TestParcelable.kt │ │ └── utils │ │ └── extension │ │ ├── BoundingBoxExtensionTest.kt │ │ ├── DoubleExtensionsTest.kt │ │ └── MapExtensionTest.kt ├── build.gradle ├── common-tests │ ├── .gitignore │ ├── build.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── mapbox │ │ └── search │ │ └── common │ │ └── tests │ │ ├── Assertions.kt │ │ ├── BaseBlockingCallback.kt │ │ ├── CommonSdkTypeObjectCreators.kt │ │ ├── CopyVerifier.kt │ │ ├── CoreTestDataFactory.kt │ │ ├── CustomTypeObjectCreator.kt │ │ ├── EqualsVerifier.kt │ │ ├── FixedPointLocationEngine.kt │ │ ├── ObjectsFactory.kt │ │ ├── TestConstants.kt │ │ ├── TestExecutor.kt │ │ ├── TestFieldsComparator.java │ │ ├── TestThreadExecutorService.kt │ │ ├── ThrowableUtils.kt │ │ ├── ToStringVerifier.kt │ │ └── Utils.kt ├── custom-detekt-rules │ ├── .gitignore │ ├── build.gradle │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── mapbox │ │ │ └── search │ │ │ └── detekt │ │ │ ├── CustomRuleSetProvider.kt │ │ │ └── rules │ │ │ └── NoMockkVerifyImport.kt │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── io.gitlab.arturbosch.detekt.api.RuleSetProvider ├── detekt-config.yml ├── discover │ ├── .gitignore │ ├── api │ │ ├── api-metalava.txt │ │ └── discover.api │ ├── build.gradle │ ├── consumer-rules.pro │ ├── gradle.properties │ ├── proguard │ │ └── consumer-proguard-discover.txt │ └── src │ │ ├── androidTest │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ │ ├── error-response.json │ │ │ ├── successful_empty_response.json │ │ │ └── successful_response.json │ │ └── java │ │ │ └── com │ │ │ └── mapbox │ │ │ └── search │ │ │ └── discover │ │ │ ├── BlockingCompletionCallback.kt │ │ │ └── DiscoverIntegrationTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── mapbox │ │ │ └── search │ │ │ └── discover │ │ │ ├── Discover.kt │ │ │ ├── DiscoverAddress.kt │ │ │ ├── DiscoverImpl.kt │ │ │ ├── DiscoverOptions.kt │ │ │ ├── DiscoverQuery.kt │ │ │ ├── DiscoverResult.kt │ │ │ ├── DiscoverSearchEngine.kt │ │ │ └── RouteDeviationOptions.kt │ │ └── test │ │ └── java │ │ └── com │ │ └── mapbox │ │ └── search │ │ └── discover │ │ ├── DiscoverAddressTest.kt │ │ ├── DiscoverImplTest.kt │ │ ├── DiscoverOptionsTest.kt │ │ ├── DiscoverQueryTest.kt │ │ ├── DiscoverResultTest.kt │ │ ├── DiscoverSearchEngineTest.kt │ │ └── RouteDeviationOptionsTest.kt ├── gradle.properties ├── gradle │ ├── dexcount.gradle │ ├── dokka.gradle │ ├── jacoco.gradle │ ├── japicmp │ │ └── build.gradle │ ├── ktlint.gradle │ ├── license.gradle │ ├── metalava-dependencies.gradle │ ├── pitest.gradle │ ├── publish.gradle │ ├── track-public-apis.gradle │ ├── track-public-xml-apis.gradle │ ├── utils.gradle │ ├── versions.gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── metalava │ └── metalava.jar ├── offline │ ├── .gitignore │ ├── api │ │ ├── api-metalava.txt │ │ └── offline.api │ ├── build.gradle │ ├── gradle.properties │ ├── proguard │ │ └── consumer-proguard-offline.txt │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── mapbox │ │ │ └── search │ │ │ └── offline │ │ │ ├── OfflineSearchEngineIntegrationTest.kt │ │ │ └── tests_support │ │ │ ├── BlockingEngineReadyCallback.kt │ │ │ ├── BlockingOfflineSearchCallback.kt │ │ │ ├── BlockingOnIndexChangeListener.kt │ │ │ ├── OfflineSearchEngine.kt │ │ │ └── TileStore.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── mapbox │ │ │ └── search │ │ │ └── offline │ │ │ ├── DatasetNameBuilder.kt │ │ │ ├── NewOfflineSearchResultType.kt │ │ │ ├── OfflineCategorySearchOptions.kt │ │ │ ├── OfflineEvSearchOptions.kt │ │ │ ├── OfflineIndexChangeEvent.kt │ │ │ ├── OfflineIndexErrorEvent.kt │ │ │ ├── OfflineRequestOptions.kt │ │ │ ├── OfflineResponseInfo.kt │ │ │ ├── OfflineReverseGeoOptions.kt │ │ │ ├── OfflineSearchAddress.kt │ │ │ ├── OfflineSearchAlongRouteOptions.kt │ │ │ ├── OfflineSearchCallback.kt │ │ │ ├── OfflineSearchCallbackAdapter.kt │ │ │ ├── OfflineSearchEngine.kt │ │ │ ├── OfflineSearchEngineImpl.kt │ │ │ ├── OfflineSearchEngineSettings.kt │ │ │ ├── OfflineSearchOptions.kt │ │ │ ├── OfflineSearchResult.kt │ │ │ ├── OfflineSearchResultCallbackAdapter.kt │ │ │ ├── OfflineSearchResultMetadata.kt │ │ │ ├── OfflineSearchResultType.kt │ │ │ └── TilesetParameters.kt │ │ └── test │ │ └── java │ │ └── com │ │ └── mapbox │ │ └── search │ │ └── offline │ │ ├── DatasetNameBuilderTest.kt │ │ ├── NewOfflineSearchResultTypeTest.kt │ │ ├── OfflineCategorySearchOptionsTest.kt │ │ ├── OfflineEvSearchOptionsTest.kt │ │ ├── OfflineIndexChangeEventTest.kt │ │ ├── OfflineIndexErrorEventTest.kt │ │ ├── OfflineRequestOptionsTest.kt │ │ ├── OfflineResponseInfoTest.kt │ │ ├── OfflineReverseGeoOptionsTest.kt │ │ ├── OfflineSearchAddressTest.kt │ │ ├── OfflineSearchAlongRouteOptionsTest.kt │ │ ├── OfflineSearchEngineSettingsTest.kt │ │ ├── OfflineSearchEngineTest.kt │ │ ├── OfflineSearchOptionsTest.kt │ │ ├── OfflineSearchResultCallbackAdapterTest.kt │ │ ├── OfflineSearchResultMetadataTest.kt │ │ ├── OfflineSearchResultTest.kt │ │ ├── TestMainThreadWorker.kt │ │ ├── TilesetParametersTest.kt │ │ └── tests_support │ │ └── OfflineTestDataFactory.kt ├── place-autocomplete │ ├── .gitignore │ ├── api │ │ ├── api-metalava.txt │ │ └── place-autocomplete.api │ ├── build.gradle │ ├── gradle.properties │ ├── proguard-rules.pro │ ├── proguard │ │ └── consumer-proguard-autocomplete.txt │ └── src │ │ ├── androidTest │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ │ ├── error-response.json │ │ │ ├── retrieve_successful_1.json │ │ │ ├── retrieve_successful_2.json │ │ │ ├── retrieve_successful_3.json │ │ │ ├── suggestions_successful_empty_response.json │ │ │ ├── suggestions_successful_response.json │ │ │ ├── suggestions_successful_with_coordinates_response.json │ │ │ ├── suggestions_successful_with_mixed_coordinates_response.json │ │ │ └── suggestions_successful_with_unsupported_suggestions.json │ │ └── java │ │ │ └── com │ │ │ └── mapbox │ │ │ └── search │ │ │ └── autocomplete │ │ │ └── PlaceAutocompleteIntegrationTest.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── mapbox │ │ │ └── search │ │ │ └── autocomplete │ │ │ ├── PlaceAutocomplete.kt │ │ │ ├── PlaceAutocompleteAddress.kt │ │ │ ├── PlaceAutocompleteEngine.kt │ │ │ ├── PlaceAutocompleteImpl.kt │ │ │ ├── PlaceAutocompleteOptions.kt │ │ │ ├── PlaceAutocompleteResult.kt │ │ │ ├── PlaceAutocompleteResultFactory.kt │ │ │ ├── PlaceAutocompleteSuggestion.kt │ │ │ └── PlaceAutocompleteType.kt │ │ └── test │ │ └── java │ │ └── com │ │ └── mapbox │ │ └── search │ │ └── autocomplete │ │ ├── PlaceAutocompleteAddressTest.kt │ │ ├── PlaceAutocompleteImplTest.kt │ │ ├── PlaceAutocompleteOptionsTest.kt │ │ ├── PlaceAutocompleteResultFactoryTest.kt │ │ ├── PlaceAutocompleteResultTest.kt │ │ ├── PlaceAutocompleteSuggestionTest.kt │ │ ├── PlaceAutocompleteTypeTest.kt │ │ └── test │ │ └── utils │ │ ├── TestDataFactory.kt │ │ └── TypeObjectCreator.kt ├── sample │ ├── .gitignore │ ├── build.gradle │ ├── proguard-multidex-rules.pro │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── mapbox │ │ │ └── search │ │ │ └── sample │ │ │ └── ExampleActivitiesTest.kt │ │ ├── debug │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── mapbox │ │ │ └── search │ │ │ └── sample │ │ │ ├── DebugSampleApplication.kt │ │ │ └── LeakCanaryConfiguration.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── mapbox │ │ │ │ └── search │ │ │ │ └── sample │ │ │ │ ├── AddressAutofillUiActivity.kt │ │ │ │ ├── CoordinateBounds.kt │ │ │ │ ├── CustomThemeActivity.kt │ │ │ │ ├── DiscoverActivity.kt │ │ │ │ ├── MainActivity.kt │ │ │ │ ├── PlaceAutocompleteUiActivity.kt │ │ │ │ ├── SampleApplication.kt │ │ │ │ └── api │ │ │ │ ├── AddressAutofillKotlinExampleActivity.kt │ │ │ │ ├── BaseKotlinExampleActivity.kt │ │ │ │ ├── CategorySearchJavaExampleActivity.java │ │ │ │ ├── CategorySearchKotlinExampleActivity.kt │ │ │ │ ├── CustomIndexableDataProviderJavaExample.java │ │ │ │ ├── CustomIndexableDataProviderKotlinExample.kt │ │ │ │ ├── DetailsApiKotlinExampleActivity.kt │ │ │ │ ├── DiscoverJavaExampleActivity.java │ │ │ │ ├── DiscoverKotlinExampleActivity.kt │ │ │ │ ├── FavoritesDataProviderJavaExample.java │ │ │ │ ├── FavoritesDataProviderKotlinExample.kt │ │ │ │ ├── ForwardApiKotlinExampleActivity.kt │ │ │ │ ├── ForwardGeocodingJavaExampleActivity.java │ │ │ │ ├── ForwardGeocodingKotlinExampleActivity.kt │ │ │ │ ├── HistoryDataProviderJavaExample.java │ │ │ │ ├── HistoryDataProviderKotlinExample.kt │ │ │ │ ├── JapanSearchJavaExampleActivity.java │ │ │ │ ├── JapanSearchKotlinExampleActivity.kt │ │ │ │ ├── OfflineCategorySearchKotlinExampleActivity.kt │ │ │ │ ├── OfflineEvSearchKotlinExampleActivity.kt │ │ │ │ ├── OfflineMultipleLanguagesActivity.kt │ │ │ │ ├── OfflineReverseGeocodingJavaExampleActivity.java │ │ │ │ ├── OfflineReverseGeocodingKotlinExampleActivity.kt │ │ │ │ ├── OfflineSearchAlongRouteExampleActivity.kt │ │ │ │ ├── OfflineSearchJavaExampleActivity.java │ │ │ │ ├── OfflineSearchKotlinExampleActivity.kt │ │ │ │ ├── PlaceAutocompleteKotlinExampleActivity.kt │ │ │ │ ├── ReverseGeocodingJavaExampleActivity.java │ │ │ │ └── ReverseGeocodingKotlinExampleActivity.kt │ │ └── res │ │ │ ├── drawable-v24 │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ ├── card_background.xml │ │ │ ├── ic_launcher_background.xml │ │ │ ├── ic_search.xml │ │ │ └── red_marker.png │ │ │ ├── layout │ │ │ ├── activity_address_autofill.xml │ │ │ ├── activity_code_example.xml │ │ │ ├── activity_custom_theme.xml │ │ │ ├── activity_discover.xml │ │ │ ├── activity_main.xml │ │ │ ├── activity_offline_search_along_route.xml │ │ │ ├── activity_place_autocomplete.xml │ │ │ └── route_dropdown_item.xml │ │ │ ├── menu │ │ │ ├── main_activity_options_menu.xml │ │ │ └── simple_ui_activity_options_menu.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ ├── ic_launcher.xml │ │ │ └── ic_launcher_round.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── values-night │ │ │ └── styles.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ │ └── release │ │ └── java │ │ └── com │ │ └── mapbox │ │ └── search │ │ └── sample │ │ └── LeakCanaryConfiguration.kt ├── scripts │ └── builder │ │ ├── builder.py │ │ └── config.json ├── sdk-common │ ├── .gitignore │ ├── api │ │ ├── api-metalava.txt │ │ └── sdk-common.api │ ├── build.gradle │ ├── consumer-rules.pro │ ├── gradle.properties │ ├── proguard-rules.pro │ └── src │ │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── mapbox │ │ │ └── search │ │ │ └── common │ │ │ ├── AsyncOperationTask.kt │ │ │ ├── BusinessDetails.kt │ │ │ ├── CompletionCallback.kt │ │ │ ├── DistanceCalculator.kt │ │ │ ├── Facility.kt │ │ │ ├── HighlightsCalculator.kt │ │ │ ├── IsoCountryCode.kt │ │ │ ├── IsoLanguageCode.kt │ │ │ ├── LocalizedText.kt │ │ │ ├── NavigationProfile.kt │ │ │ ├── OsmIdUtils.kt │ │ │ ├── ParkingRestriction.kt │ │ │ ├── ParkingType.kt │ │ │ ├── RestrictedMapboxSearchAPI.kt │ │ │ ├── RoutablePoint.kt │ │ │ ├── SearchCancellationException.kt │ │ │ ├── SearchRequestException.kt │ │ │ ├── Utils.kt │ │ │ ├── concurrent │ │ │ ├── AndroidMainThreadWorkerImpl.kt │ │ │ ├── MainThreadWorker.kt │ │ │ └── SearchSdkMainThreadWorker.kt │ │ │ ├── ev │ │ │ ├── EVSE.kt │ │ │ ├── EvAdditionalGeoLocation.kt │ │ │ ├── EvConnector.kt │ │ │ ├── EvConnectorFormat.kt │ │ │ ├── EvConnectorType.kt │ │ │ ├── EvEnergyMix.kt │ │ │ ├── EvEnergySource.kt │ │ │ ├── EvEnergySourceCategory.kt │ │ │ ├── EvEnvironmentalImpact.kt │ │ │ ├── EvEnvironmentalImpactCategory.kt │ │ │ ├── EvLocation.kt │ │ │ ├── EvMetadata.kt │ │ │ ├── EvPowerType.kt │ │ │ ├── EvStatusSchedule.kt │ │ │ ├── EvseCapability.kt │ │ │ ├── EvsePublishTokenType.kt │ │ │ ├── EvseStatus.kt │ │ │ └── EvseTokenType.kt │ │ │ └── metadata │ │ │ ├── ChildMetadata.kt │ │ │ ├── ImageCategory.kt │ │ │ ├── ImageInfo.kt │ │ │ ├── OpenHours.kt │ │ │ ├── OpenPeriod.kt │ │ │ ├── ParkingData.kt │ │ │ ├── WeekDay.kt │ │ │ └── WeekTimestamp.kt │ │ └── test │ │ └── java │ │ └── com │ │ └── mapbox │ │ └── search │ │ └── common │ │ ├── BusinessDetailsTest.kt │ │ ├── DistanceCalculatorTest.kt │ │ ├── HighlightsCalculatorTest.kt │ │ ├── IsoCountryCodeTest.kt │ │ ├── IsoLanguageCodeTest.kt │ │ ├── LocalizedTextTest.kt │ │ ├── OsmIdUtilsTest.kt │ │ ├── SearchRequestExceptionTest.kt │ │ ├── concurrent │ │ ├── AndroidMainThreadWorkerImplTest.kt │ │ └── SearchSdkMainThreadWorkerTest.kt │ │ └── ev │ │ ├── EVSETest.kt │ │ ├── EvAdditionalGeoLocationTest.kt │ │ ├── EvConnectorTest.kt │ │ ├── EvEnergyMixTest.kt │ │ ├── EvEnergySourceTest.kt │ │ ├── EvEnvironmentalImpactTest.kt │ │ ├── EvLocationTest.kt │ │ ├── EvStatusScheduleTest.kt │ │ └── EvsePublishTokenTypeTest.kt ├── sdk │ ├── .gitignore │ ├── api │ │ ├── api-metalava.txt │ │ └── sdk.api │ ├── build.gradle │ ├── gradle.properties │ ├── proguard-rules.pro │ ├── proguard │ │ └── consumer-proguard-sdk.txt │ └── src │ │ ├── androidTest │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ │ ├── details_api │ │ │ │ ├── response_successful.json │ │ │ │ └── response_successful_multiple_values.json │ │ │ ├── geocoding_responses │ │ │ │ ├── suggestions-successful-czech.json │ │ │ │ └── suggestions.json │ │ │ ├── sbs_responses │ │ │ │ ├── batch │ │ │ │ │ ├── retrieved-for-mixed-types.json │ │ │ │ │ ├── retrieved-single-poi.json │ │ │ │ │ ├── suggestions-mixed-types.json │ │ │ │ │ └── suggestions-single-poi.json │ │ │ │ ├── category │ │ │ │ │ ├── successful_empty_response.json │ │ │ │ │ ├── successful_incorrect_response.json │ │ │ │ │ ├── successful_response.json │ │ │ │ │ └── successful_response_new_ids.json │ │ │ │ ├── retrieve-no-results.json │ │ │ │ ├── retrieve-response-successful-poi.json │ │ │ │ ├── retrieve-response-successful.json │ │ │ │ ├── retrieve-successful-category-cafe.json │ │ │ │ ├── reverse_geocoding │ │ │ │ │ ├── successful_empty_response.json │ │ │ │ │ ├── successful_incorrect_response.json │ │ │ │ │ └── successful_response.json │ │ │ │ ├── suggestions-address-formatting-test.json │ │ │ │ ├── suggestions-data-formatting-corrections-test.json │ │ │ │ ├── suggestions-error-response-extended-format.json │ │ │ │ ├── suggestions-error-response-simple-format.json │ │ │ │ ├── suggestions-successful-czech.json │ │ │ │ ├── suggestions-successful-empty.json │ │ │ │ ├── suggestions-successful-for-indexable-records-matching.json │ │ │ │ ├── suggestions-successful-for-minsk.json │ │ │ │ ├── suggestions-successful-incorrect-for-minsk.json │ │ │ │ ├── suggestions-successful-only-brand.json │ │ │ │ ├── suggestions-successful-only-categories.json │ │ │ │ ├── suggestions-successful-random.json │ │ │ │ └── suggestions-successful-with-recursion-query.json │ │ │ ├── screenshots │ │ │ │ ├── compressed_screenshot_400-90.jpeg │ │ │ │ └── original_screenshot.png │ │ │ ├── search-event-unknown.json │ │ │ ├── search-feedback-event-empty.json │ │ │ ├── search-feedback-event.json │ │ │ ├── search-query-change-event-empty.json │ │ │ ├── search-query-change-event.json │ │ │ ├── search-select-event-empty.json │ │ │ ├── search-select-event.json │ │ │ ├── search-start-event-empty.json │ │ │ ├── search-start-event.json │ │ │ ├── search_box_responses │ │ │ │ ├── category │ │ │ │ │ ├── successful_empty_response.json │ │ │ │ │ ├── successful_incorrect_response.json │ │ │ │ │ ├── successful_response.json │ │ │ │ │ └── successful_response_new_ids.json │ │ │ │ ├── forward │ │ │ │ │ ├── retrieve-category-cafe.json │ │ │ │ │ ├── retrieve-suggest.json │ │ │ │ │ ├── suggestions-backend-patches.json │ │ │ │ │ ├── suggestions-brand.json │ │ │ │ │ ├── suggestions-category.json │ │ │ │ │ ├── suggestions-successful-empty.json │ │ │ │ │ ├── suggestions-successful-incorrect.json │ │ │ │ │ ├── suggestions-successful.json │ │ │ │ │ ├── suggestions-test-address-formatting.json │ │ │ │ │ ├── suggestions-test-records-matching.json │ │ │ │ │ └── suggestions-with-recursive.json │ │ │ │ ├── forward_api │ │ │ │ │ └── response_successful.json │ │ │ │ ├── retrieve-response-successful-poi.json │ │ │ │ ├── reverse_geocoding │ │ │ │ │ ├── successful_empty_response.json │ │ │ │ │ ├── successful_incorrect_response.json │ │ │ │ │ └── successful_response.json │ │ │ │ ├── suggestions-error-response-extended-format.json │ │ │ │ └── suggestions-error-response-simple-format.json │ │ │ ├── test_data_favorites.json │ │ │ ├── test_data_favorites_incorrect.json │ │ │ ├── test_data_search_history.json │ │ │ ├── test_data_search_history_incorrect.json │ │ │ └── test_data_search_history_incorrect_json_format.json │ │ └── java │ │ │ └── com │ │ │ └── mapbox │ │ │ └── search │ │ │ ├── BaseTest.kt │ │ │ ├── BitmapsTest.kt │ │ │ ├── CategorySearchIntegrationTest.kt │ │ │ ├── CustomDataProviderTest.kt │ │ │ ├── LocalDataProvidersIntegrationTest.kt │ │ │ ├── ReverseGeocodingSearchIntegrationTest.kt │ │ │ ├── SearchEngineBatchRetrieveTest.kt │ │ │ ├── SearchEngineDataProvidersIntegrationTest.kt │ │ │ ├── SearchEngineIntegrationTest.kt │ │ │ ├── TestData.kt │ │ │ ├── analytics │ │ │ └── AnalyticsEventJsonParserTest.kt │ │ │ ├── details │ │ │ └── DetailsApiIntegrationTest.kt │ │ │ ├── favorite │ │ │ └── FavoriteRecordsSerializerTest.kt │ │ │ ├── history │ │ │ └── HistoryRecordsSerializerTest.kt │ │ │ ├── result │ │ │ ├── SearchResultGsonSerializationTest.kt │ │ │ └── SearchResultParcelizationTest.kt │ │ │ ├── search_box │ │ │ ├── CategorySearchIntegrationTest.kt │ │ │ ├── CustomDataProviderTest.kt │ │ │ ├── ForwardApiIntegrationTest.kt │ │ │ ├── LocalDataProvidersIntegrationTest.kt │ │ │ ├── ReverseGeocodingSearchIntegrationTest.kt │ │ │ ├── SearchEngineDataProvidersIntegrationTest.kt │ │ │ └── SearchEngineIntegrationTest.kt │ │ │ ├── tests_support │ │ │ ├── BlockingCompletionCallback.kt │ │ │ ├── BlockingOnDataProviderEngineRegisterListener.kt │ │ │ ├── BlockingSearchCallback.kt │ │ │ ├── BlockingSearchResultCallback.kt │ │ │ ├── BlockingSearchSelectionCallback.kt │ │ │ ├── EmptySearchCallback.kt │ │ │ ├── EmptySearchSuggestionsCallback.kt │ │ │ ├── SdkTestDataFactory.kt │ │ │ ├── SearchEngine.kt │ │ │ ├── Utils.kt │ │ │ ├── offline │ │ │ │ └── AssetsUnpackUtils.kt │ │ │ ├── record │ │ │ │ ├── CustomRecord.kt │ │ │ │ ├── IndexableDataProvider.kt │ │ │ │ ├── StubRecordsStorage.kt │ │ │ │ └── TestDataProvider.kt │ │ │ └── rules │ │ │ │ └── IgnoreTestsRule.kt │ │ │ └── utils │ │ │ ├── Assert.kt │ │ │ ├── Formatting.kt │ │ │ ├── MockWebServer.kt │ │ │ └── Parcel.kt │ │ ├── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── mapbox │ │ │ └── search │ │ │ ├── ApiType.kt │ │ │ ├── AttributeSet.kt │ │ │ ├── CategorySearchOptions.kt │ │ │ ├── EtaType.kt │ │ │ ├── ForwardSearchOptions.kt │ │ │ ├── IndexableDataProvidersRegistry.kt │ │ │ ├── IndexableDataProvidersRegistryImpl.kt │ │ │ ├── MapboxSearchSdk.kt │ │ │ ├── MapboxSearchSdkInitializer.kt │ │ │ ├── MapboxSearchSdkInitializerImpl.kt │ │ │ ├── QueryType.kt │ │ │ ├── RequestOptions.kt │ │ │ ├── Reserved.kt │ │ │ ├── ResponseInfo.kt │ │ │ ├── ReverseGeoOptions.kt │ │ │ ├── RouteOptions.kt │ │ │ ├── SearchCallback.kt │ │ │ ├── SearchEngine.kt │ │ │ ├── SearchEngineFactory.kt │ │ │ ├── SearchEngineImpl.kt │ │ │ ├── SearchEngineSettings.kt │ │ │ ├── SearchNavigationOptions.kt │ │ │ ├── SearchOptions.kt │ │ │ ├── SearchResultMetadata.kt │ │ │ ├── SearchSuggestionsCallback.kt │ │ │ ├── SelectOptions.kt │ │ │ ├── ServiceProvider.kt │ │ │ ├── ViewportProvider.kt │ │ │ ├── adapter │ │ │ ├── BaseSearchCallbackAdapter.kt │ │ │ ├── BaseSearchMultipleSelectionCallbackAdapter.kt │ │ │ ├── BaseSearchSelectionCallbackAdapter.kt │ │ │ ├── BaseSearchSuggestionsCallbackAdapter.kt │ │ │ └── SearchResultCallbackAdapter.kt │ │ │ ├── analytics │ │ │ ├── AnalyticsEventJsonParser.kt │ │ │ ├── AnalyticsService.kt │ │ │ ├── AnalyticsServiceImpl.kt │ │ │ ├── FeedbackEvent.kt │ │ │ ├── MissingResultFeedbackEvent.kt │ │ │ ├── SearchFeedbackEventsFactory.kt │ │ │ └── events │ │ │ │ ├── AppMetadata.kt │ │ │ │ ├── SearchFeedbackEvent.kt │ │ │ │ ├── SearchResultEntry.kt │ │ │ │ └── SearchResultsInfo.kt │ │ │ ├── details │ │ │ ├── DetailsApi.kt │ │ │ ├── DetailsApiImpl.kt │ │ │ ├── DetailsApiSettings.kt │ │ │ └── RetrieveDetailsOptions.kt │ │ │ ├── record │ │ │ ├── DataProviderEngineRegistrationService.kt │ │ │ ├── FavoriteRecord.kt │ │ │ ├── FavoriteRecordsSerializer.kt │ │ │ ├── FavoritesDataProvider.kt │ │ │ ├── HistoryDataProvider.kt │ │ │ ├── HistoryRecord.kt │ │ │ ├── HistoryRecordsSerializer.kt │ │ │ ├── IndexableDataProvider.kt │ │ │ ├── IndexableDataProviderEngine.kt │ │ │ ├── IndexableRecord.kt │ │ │ ├── LocalDataProvider.kt │ │ │ └── RecordsFileStorage.kt │ │ │ ├── result │ │ │ ├── ResultAccuracy.kt │ │ │ ├── SearchAddress.kt │ │ │ ├── SearchResult.kt │ │ │ ├── SearchResultType.kt │ │ │ ├── SearchSuggestion.kt │ │ │ └── SearchSuggestionType.kt │ │ │ └── utils │ │ │ ├── CompoundCompletionCallback.kt │ │ │ ├── LoggingCompletionCallback.kt │ │ │ ├── bitmap │ │ │ ├── BitmapEncodeOptions.kt │ │ │ └── Bitmaps.kt │ │ │ ├── file │ │ │ ├── FileSystem.kt │ │ │ └── InternalFileSystem.kt │ │ │ ├── loader │ │ │ ├── DataLoader.kt │ │ │ └── InternalDataLoader.kt │ │ │ ├── search │ │ │ └── RetrieveUtils.kt │ │ │ └── serialization │ │ │ ├── DataAccessObject.kt │ │ │ ├── FavoriteRecordDAO.kt │ │ │ ├── HistoryRecordDAO.kt │ │ │ ├── ImageInfoDAO.kt │ │ │ ├── OpenHoursDAO.kt │ │ │ ├── OpenModeDAO.kt │ │ │ ├── OpenPeriodDAO.kt │ │ │ ├── ParkingDataDAO.kt │ │ │ ├── PointTypeAdapter.kt │ │ │ ├── RecordsSerializer.kt │ │ │ ├── RoutablePointDAO.kt │ │ │ ├── SearchAddressDAO.kt │ │ │ ├── SearchResultMetadataDAO.kt │ │ │ ├── SearchResultTypeDAO.kt │ │ │ └── WeekDayDAO.kt │ │ └── test │ │ └── java │ │ └── com │ │ └── mapbox │ │ └── search │ │ ├── CategorySearchOptionsTest.kt │ │ ├── CategorySearchTest.kt │ │ ├── DataClassGeneratedFunctionsTest.kt │ │ ├── ForwardSearchOptionsTest.kt │ │ ├── IndexableDataProvidersRegistryTest.kt │ │ ├── QueryTypeTest.kt │ │ ├── RequestOptionsTest.kt │ │ ├── ReverseGeoOptionsTest.kt │ │ ├── ReverseGeocodingSearchTest.kt │ │ ├── RouteOptionsTest.kt │ │ ├── SearchEngineSettingsTest.kt │ │ ├── SearchEngineTest.kt │ │ ├── SearchOptionsTest.kt │ │ ├── SearchResultMetadataTest.kt │ │ ├── SelectOptionsTest.kt │ │ ├── ServiceProviderTest.kt │ │ ├── analytics │ │ └── events │ │ │ ├── AnalyticsEventsTest.kt │ │ │ ├── AnalyticsServiceImplTest.kt │ │ │ └── SearchFeedbackEventsFactoryTest.kt │ │ ├── details │ │ └── RetrieveDetailsOptionsTest.kt │ │ ├── record │ │ ├── FavoriteRecordTest.kt │ │ ├── FavoritesDataProviderTest.kt │ │ ├── HistoryDataProviderTest.kt │ │ ├── HistoryRecordTest.kt │ │ └── LocalDataProviderTest.kt │ │ ├── result │ │ ├── ResultAccuracyTest.kt │ │ ├── SearchAddressExtensionTest.kt │ │ ├── SearchAddressTest.kt │ │ ├── SearchResultTest.kt │ │ ├── SearchResultTypeTest.kt │ │ └── SearchSuggestionTest.kt │ │ ├── tests_support │ │ ├── AssertionUtils.kt │ │ ├── BlockingCompletionCallback.kt │ │ ├── EnumPublicApi.kt │ │ ├── EqualsVerifier.kt │ │ ├── MockedTypesObjectCreators.kt │ │ ├── SdkCustomTypeObjectCreators.kt │ │ ├── SdkTestDataFactory.kt │ │ ├── SearchAddress.kt │ │ ├── StubIndexableRecord.kt │ │ ├── TestDataProviderEngine.kt │ │ ├── TestMainThreadWorker.kt │ │ └── record │ │ │ ├── CustomRecord.kt │ │ │ ├── IndexableDataProvider.kt │ │ │ ├── StubRecordsStorage.kt │ │ │ └── TestDataProvider.kt │ │ └── utils │ │ ├── bitmap │ │ ├── BitmapEncodeOptionsTest.kt │ │ └── BitmapsTest.kt │ │ ├── extension │ │ ├── BoundingBoxExtensionTest.kt │ │ └── MapExtensionTest.kt │ │ ├── file │ │ └── InternalFileSystemTest.kt │ │ ├── loader │ │ ├── InternalDataLoaderTest.kt │ │ └── TestFileSystem.kt │ │ └── search │ │ └── RetrieveUtilsTest.kt ├── settings.gradle └── ui │ ├── .gitignore │ ├── api │ ├── api-metalava.txt │ └── ui.api │ ├── build.gradle │ ├── gradle.properties │ ├── proguard-rules.pro │ ├── proguard │ └── consumer-proguard-ui.txt │ └── src │ ├── androidTest │ ├── AndroidManifest.xml │ ├── assets │ │ ├── category-cafe-successful-results.json │ │ ├── retrieve-successful-ranelagh-royal-spa.json │ │ ├── suggestions-successful-empty-results.json │ │ ├── suggestions-successful-minsk-region.json │ │ ├── suggestions-successful-minsk.json │ │ └── suggestions-successful-ranelagh.json │ ├── java │ │ └── com │ │ │ └── mapbox │ │ │ └── search │ │ │ └── ui │ │ │ ├── Constants.kt │ │ │ ├── MockServerSearchActivityTest.kt │ │ │ ├── SearchResultsInflater.kt │ │ │ ├── SearchResultsViewTest.kt │ │ │ ├── TestActivity.kt │ │ │ ├── extensions │ │ │ ├── Builders.kt │ │ │ └── MockWebServer.kt │ │ │ ├── robots │ │ │ ├── RobotDsl.kt │ │ │ ├── SearchBottomSheetRobot.kt │ │ │ ├── SearchPlaceBottomSheet.kt │ │ │ └── builders │ │ │ │ ├── HistoryRecyclerBuilder.kt │ │ │ │ └── SearchResultsRecyclerBuilder.kt │ │ │ └── tools │ │ │ ├── BlockingCompletionCallback.kt │ │ │ ├── CommonFunctions.kt │ │ │ ├── MockWebServerRule.kt │ │ │ ├── SearchSdkUiInteractions.kt │ │ │ ├── actions │ │ │ └── ClickSearchResultItemPopulateButton.kt │ │ │ └── matchers │ │ │ ├── ElevationMatcher.kt │ │ │ ├── HistoryItemMatcher.kt │ │ │ ├── MapboxSdkUiErrorViewMatcher.kt │ │ │ ├── RecentSearchesMatcher.kt │ │ │ ├── SearchResultByAddressMatcher.kt │ │ │ ├── SearchResultMatcher.kt │ │ │ ├── SearchSdkMatchers.kt │ │ │ └── SingleViewIdMatcher.kt │ └── res │ │ ├── layout │ │ └── activity_test.xml │ │ ├── menu │ │ └── test_activity_menu.xml │ │ └── values │ │ └── styles.xml │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── mapbox │ │ │ └── search │ │ │ └── ui │ │ │ ├── adapter │ │ │ ├── BaseItemsCreator.kt │ │ │ ├── autocomplete │ │ │ │ ├── PlaceAutocompleteItemsCreator.kt │ │ │ │ └── PlaceAutocompleteUiAdapter.kt │ │ │ ├── autofill │ │ │ │ ├── AddressAutofillUiAdapter.kt │ │ │ │ └── AutofillItemsCreator.kt │ │ │ ├── engines │ │ │ │ ├── SearchEngineUiAdapter.kt │ │ │ │ ├── SearchEntityPresentation.kt │ │ │ │ └── SearchResultsItemsCreator.kt │ │ │ └── location │ │ │ │ └── LocationObservationTimeoutSetter.kt │ │ │ ├── utils │ │ │ ├── BottomSheetBehaviorCallbackAdapter.kt │ │ │ ├── CompoundIndexableDataProvider.kt │ │ │ ├── Debouncer.kt │ │ │ ├── HistoryRecordsInteractor.kt │ │ │ ├── OffsetItemDecoration.kt │ │ │ ├── SearchBottomSheetBehavior.kt │ │ │ ├── StringToLongIdMapper.kt │ │ │ ├── ThemePatcher.kt │ │ │ ├── adapter │ │ │ │ ├── BaseRecyclerViewAdapter.kt │ │ │ │ └── BaseViewHolder.kt │ │ │ ├── extenstion │ │ │ │ ├── AddressAutocompleteExt.kt │ │ │ │ ├── BottomSheetBehavior.kt │ │ │ │ ├── Context.kt │ │ │ │ ├── Drawable.kt │ │ │ │ ├── Locale.kt │ │ │ │ ├── TextView.kt │ │ │ │ └── View.kt │ │ │ ├── format │ │ │ │ └── DistanceFormatter.kt │ │ │ ├── maki │ │ │ │ └── MakiToDrawableIdMapper.kt │ │ │ └── offline │ │ │ │ ├── OfflineSearchAddress.kt │ │ │ │ └── OfflineSearchResultType.kt │ │ │ └── view │ │ │ ├── CommonSearchViewConfiguration.kt │ │ │ ├── DistanceUnitType.kt │ │ │ ├── GlobalViewPreferences.kt │ │ │ ├── SearchMode.kt │ │ │ ├── SearchResultAdapterItem.kt │ │ │ ├── SearchResultsView.kt │ │ │ ├── SearchSdkFrameLayout.kt │ │ │ ├── UiError.kt │ │ │ ├── adapter │ │ │ ├── SearchErrorViewHolder.kt │ │ │ ├── SearchHistoryViewHolder.kt │ │ │ ├── SearchLoadingViewHolder.kt │ │ │ ├── SearchResultViewHolder.kt │ │ │ └── SearchViewResultsAdapter.kt │ │ │ ├── category │ │ │ └── Category.kt │ │ │ ├── common │ │ │ ├── MapboxSdkButtonWithIcon.kt │ │ │ ├── MapboxSdkProgressBar.kt │ │ │ └── MapboxSdkUiErrorView.kt │ │ │ └── place │ │ │ ├── IncorrectSearchPlaceFeedback.kt │ │ │ ├── SearchPlace.kt │ │ │ └── SearchPlaceBottomSheetView.kt │ └── res │ │ ├── drawable │ │ ├── mapbox_search_sdk_close_drawable.xml │ │ ├── mapbox_search_sdk_ic_add_favorite.xml │ │ ├── mapbox_search_sdk_ic_added_to_favorites.xml │ │ ├── mapbox_search_sdk_ic_category_atm.xml │ │ ├── mapbox_search_sdk_ic_category_bar.xml │ │ ├── mapbox_search_sdk_ic_category_bus.xml │ │ ├── mapbox_search_sdk_ic_category_cafe.xml │ │ ├── mapbox_search_sdk_ic_category_car_repair.xml │ │ ├── mapbox_search_sdk_ic_category_charging_station.xml │ │ ├── mapbox_search_sdk_ic_category_cinema.xml │ │ ├── mapbox_search_sdk_ic_category_clothing_store.xml │ │ ├── mapbox_search_sdk_ic_category_emergency_room.xml │ │ ├── mapbox_search_sdk_ic_category_gas.xml │ │ ├── mapbox_search_sdk_ic_category_grocery.xml │ │ ├── mapbox_search_sdk_ic_category_gym.xml │ │ ├── mapbox_search_sdk_ic_category_hospital.xml │ │ ├── mapbox_search_sdk_ic_category_hotel.xml │ │ ├── mapbox_search_sdk_ic_category_museum.xml │ │ ├── mapbox_search_sdk_ic_category_night_club.xml │ │ ├── mapbox_search_sdk_ic_category_park.xml │ │ ├── mapbox_search_sdk_ic_category_parking.xml │ │ ├── mapbox_search_sdk_ic_category_pharmacy.xml │ │ ├── mapbox_search_sdk_ic_category_restaurant.xml │ │ ├── mapbox_search_sdk_ic_category_shopping_mall.xml │ │ ├── mapbox_search_sdk_ic_category_train.xml │ │ ├── mapbox_search_sdk_ic_error.xml │ │ ├── mapbox_search_sdk_ic_favorite_uncategorized.xml │ │ ├── mapbox_search_sdk_ic_feedback.xml │ │ ├── mapbox_search_sdk_ic_history.xml │ │ ├── mapbox_search_sdk_ic_maki_aerialway.xml │ │ ├── mapbox_search_sdk_ic_maki_airfield.xml │ │ ├── mapbox_search_sdk_ic_maki_airport.xml │ │ ├── mapbox_search_sdk_ic_maki_alcohol_shop.xml │ │ ├── mapbox_search_sdk_ic_maki_american_football.xml │ │ ├── mapbox_search_sdk_ic_maki_amusement_park.xml │ │ ├── mapbox_search_sdk_ic_maki_aquarium.xml │ │ ├── mapbox_search_sdk_ic_maki_art_gallery.xml │ │ ├── mapbox_search_sdk_ic_maki_attraction.xml │ │ ├── mapbox_search_sdk_ic_maki_bakery.xml │ │ ├── mapbox_search_sdk_ic_maki_bank.xml │ │ ├── mapbox_search_sdk_ic_maki_bank_jp.xml │ │ ├── mapbox_search_sdk_ic_maki_bar.xml │ │ ├── mapbox_search_sdk_ic_maki_barrier.xml │ │ ├── mapbox_search_sdk_ic_maki_baseball.xml │ │ ├── mapbox_search_sdk_ic_maki_basketball.xml │ │ ├── mapbox_search_sdk_ic_maki_bbq.xml │ │ ├── mapbox_search_sdk_ic_maki_beach.xml │ │ ├── mapbox_search_sdk_ic_maki_beer.xml │ │ ├── mapbox_search_sdk_ic_maki_bicycle.xml │ │ ├── mapbox_search_sdk_ic_maki_bicycle_share.xml │ │ ├── mapbox_search_sdk_ic_maki_blood_bank.xml │ │ ├── mapbox_search_sdk_ic_maki_bowling_alley.xml │ │ ├── mapbox_search_sdk_ic_maki_bridge.xml │ │ ├── mapbox_search_sdk_ic_maki_building.xml │ │ ├── mapbox_search_sdk_ic_maki_building_alt1.xml │ │ ├── mapbox_search_sdk_ic_maki_bus.xml │ │ ├── mapbox_search_sdk_ic_maki_cafe.xml │ │ ├── mapbox_search_sdk_ic_maki_campsite.xml │ │ ├── mapbox_search_sdk_ic_maki_car.xml │ │ ├── mapbox_search_sdk_ic_maki_car_rental.xml │ │ ├── mapbox_search_sdk_ic_maki_car_repair.xml │ │ ├── mapbox_search_sdk_ic_maki_casino.xml │ │ ├── mapbox_search_sdk_ic_maki_castle.xml │ │ ├── mapbox_search_sdk_ic_maki_castle_jp.xml │ │ ├── mapbox_search_sdk_ic_maki_cemetery.xml │ │ ├── mapbox_search_sdk_ic_maki_cemetery_jp.xml │ │ ├── mapbox_search_sdk_ic_maki_charging_station.xml │ │ ├── mapbox_search_sdk_ic_maki_cinema.xml │ │ ├── mapbox_search_sdk_ic_maki_circle.xml │ │ ├── mapbox_search_sdk_ic_maki_circle_stroked.xml │ │ ├── mapbox_search_sdk_ic_maki_city.xml │ │ ├── mapbox_search_sdk_ic_maki_clothing_store.xml │ │ ├── mapbox_search_sdk_ic_maki_college.xml │ │ ├── mapbox_search_sdk_ic_maki_college_jp.xml │ │ ├── mapbox_search_sdk_ic_maki_commercial.xml │ │ ├── mapbox_search_sdk_ic_maki_communications_tower.xml │ │ ├── mapbox_search_sdk_ic_maki_confectionery.xml │ │ ├── mapbox_search_sdk_ic_maki_convenience.xml │ │ ├── mapbox_search_sdk_ic_maki_cricket.xml │ │ ├── mapbox_search_sdk_ic_maki_cross.xml │ │ ├── mapbox_search_sdk_ic_maki_dam.xml │ │ ├── mapbox_search_sdk_ic_maki_danger.xml │ │ ├── mapbox_search_sdk_ic_maki_defibrillator.xml │ │ ├── mapbox_search_sdk_ic_maki_dentist.xml │ │ ├── mapbox_search_sdk_ic_maki_doctor.xml │ │ ├── mapbox_search_sdk_ic_maki_dog_park.xml │ │ ├── mapbox_search_sdk_ic_maki_drinking_water.xml │ │ ├── mapbox_search_sdk_ic_maki_embassy.xml │ │ ├── mapbox_search_sdk_ic_maki_emergency_phone.xml │ │ ├── mapbox_search_sdk_ic_maki_entrance.xml │ │ ├── mapbox_search_sdk_ic_maki_entrance_alt1.xml │ │ ├── mapbox_search_sdk_ic_maki_farm.xml │ │ ├── mapbox_search_sdk_ic_maki_fast_food.xml │ │ ├── mapbox_search_sdk_ic_maki_fence.xml │ │ ├── mapbox_search_sdk_ic_maki_ferry.xml │ │ ├── mapbox_search_sdk_ic_maki_fire_station.xml │ │ ├── mapbox_search_sdk_ic_maki_fire_station_jp.xml │ │ ├── mapbox_search_sdk_ic_maki_fitness_centre.xml │ │ ├── mapbox_search_sdk_ic_maki_florist.xml │ │ ├── mapbox_search_sdk_ic_maki_fuel.xml │ │ ├── mapbox_search_sdk_ic_maki_furniture.xml │ │ ├── mapbox_search_sdk_ic_maki_gaming.xml │ │ ├── mapbox_search_sdk_ic_maki_garden.xml │ │ ├── mapbox_search_sdk_ic_maki_garden_centre.xml │ │ ├── mapbox_search_sdk_ic_maki_gift.xml │ │ ├── mapbox_search_sdk_ic_maki_globe.xml │ │ ├── mapbox_search_sdk_ic_maki_golf.xml │ │ ├── mapbox_search_sdk_ic_maki_grocery.xml │ │ ├── mapbox_search_sdk_ic_maki_hairdresser.xml │ │ ├── mapbox_search_sdk_ic_maki_harbor.xml │ │ ├── mapbox_search_sdk_ic_maki_hardware.xml │ │ ├── mapbox_search_sdk_ic_maki_heart.xml │ │ ├── mapbox_search_sdk_ic_maki_heliport.xml │ │ ├── mapbox_search_sdk_ic_maki_home.xml │ │ ├── mapbox_search_sdk_ic_maki_horse_riding.xml │ │ ├── mapbox_search_sdk_ic_maki_hospital.xml │ │ ├── mapbox_search_sdk_ic_maki_hospital_jp.xml │ │ ├── mapbox_search_sdk_ic_maki_ice_cream.xml │ │ ├── mapbox_search_sdk_ic_maki_industry.xml │ │ ├── mapbox_search_sdk_ic_maki_information.xml │ │ ├── mapbox_search_sdk_ic_maki_jewelry_store.xml │ │ ├── mapbox_search_sdk_ic_maki_karaoke.xml │ │ ├── mapbox_search_sdk_ic_maki_landmark.xml │ │ ├── mapbox_search_sdk_ic_maki_landmark_jp.xml │ │ ├── mapbox_search_sdk_ic_maki_landuse.xml │ │ ├── mapbox_search_sdk_ic_maki_laundry.xml │ │ ├── mapbox_search_sdk_ic_maki_library.xml │ │ ├── mapbox_search_sdk_ic_maki_lighthouse.xml │ │ ├── mapbox_search_sdk_ic_maki_lodging.xml │ │ ├── mapbox_search_sdk_ic_maki_logging.xml │ │ ├── mapbox_search_sdk_ic_maki_marker.xml │ │ ├── mapbox_search_sdk_ic_maki_marker_stroked.xml │ │ ├── mapbox_search_sdk_ic_maki_mobile_phone.xml │ │ ├── mapbox_search_sdk_ic_maki_monument.xml │ │ ├── mapbox_search_sdk_ic_maki_mountain.xml │ │ ├── mapbox_search_sdk_ic_maki_museum.xml │ │ ├── mapbox_search_sdk_ic_maki_music.xml │ │ ├── mapbox_search_sdk_ic_maki_natural.xml │ │ ├── mapbox_search_sdk_ic_maki_optician.xml │ │ ├── mapbox_search_sdk_ic_maki_paint.xml │ │ ├── mapbox_search_sdk_ic_maki_park.xml │ │ ├── mapbox_search_sdk_ic_maki_park_alt1.xml │ │ ├── mapbox_search_sdk_ic_maki_parking.xml │ │ ├── mapbox_search_sdk_ic_maki_parking_garage.xml │ │ ├── mapbox_search_sdk_ic_maki_pharmacy.xml │ │ ├── mapbox_search_sdk_ic_maki_picnic_site.xml │ │ ├── mapbox_search_sdk_ic_maki_pitch.xml │ │ ├── mapbox_search_sdk_ic_maki_place_of_worship.xml │ │ ├── mapbox_search_sdk_ic_maki_playground.xml │ │ ├── mapbox_search_sdk_ic_maki_police.xml │ │ ├── mapbox_search_sdk_ic_maki_police_jp.xml │ │ ├── mapbox_search_sdk_ic_maki_post.xml │ │ ├── mapbox_search_sdk_ic_maki_post_jp.xml │ │ ├── mapbox_search_sdk_ic_maki_prison.xml │ │ ├── mapbox_search_sdk_ic_maki_rail.xml │ │ ├── mapbox_search_sdk_ic_maki_rail_light.xml │ │ ├── mapbox_search_sdk_ic_maki_rail_metro.xml │ │ ├── mapbox_search_sdk_ic_maki_ranger_station.xml │ │ ├── mapbox_search_sdk_ic_maki_recycling.xml │ │ ├── mapbox_search_sdk_ic_maki_religious_buddhist.xml │ │ ├── mapbox_search_sdk_ic_maki_religious_christian.xml │ │ ├── mapbox_search_sdk_ic_maki_religious_jewish.xml │ │ ├── mapbox_search_sdk_ic_maki_religious_muslim.xml │ │ ├── mapbox_search_sdk_ic_maki_religious_shinto.xml │ │ ├── mapbox_search_sdk_ic_maki_residential_community.xml │ │ ├── mapbox_search_sdk_ic_maki_restaurant.xml │ │ ├── mapbox_search_sdk_ic_maki_restaurant_noodle.xml │ │ ├── mapbox_search_sdk_ic_maki_restaurant_pizza.xml │ │ ├── mapbox_search_sdk_ic_maki_restaurant_seafood.xml │ │ ├── mapbox_search_sdk_ic_maki_roadblock.xml │ │ ├── mapbox_search_sdk_ic_maki_rocket.xml │ │ ├── mapbox_search_sdk_ic_maki_school.xml │ │ ├── mapbox_search_sdk_ic_maki_school_jp.xml │ │ ├── mapbox_search_sdk_ic_maki_scooter.xml │ │ ├── mapbox_search_sdk_ic_maki_shelter.xml │ │ ├── mapbox_search_sdk_ic_maki_shoe.xml │ │ ├── mapbox_search_sdk_ic_maki_shop.xml │ │ ├── mapbox_search_sdk_ic_maki_skateboard.xml │ │ ├── mapbox_search_sdk_ic_maki_skiing.xml │ │ ├── mapbox_search_sdk_ic_maki_slaughterhouse.xml │ │ ├── mapbox_search_sdk_ic_maki_slipway.xml │ │ ├── mapbox_search_sdk_ic_maki_snowmobile.xml │ │ ├── mapbox_search_sdk_ic_maki_soccer.xml │ │ ├── mapbox_search_sdk_ic_maki_square.xml │ │ ├── mapbox_search_sdk_ic_maki_square_stroked.xml │ │ ├── mapbox_search_sdk_ic_maki_stadium.xml │ │ ├── mapbox_search_sdk_ic_maki_star.xml │ │ ├── mapbox_search_sdk_ic_maki_star_stroked.xml │ │ ├── mapbox_search_sdk_ic_maki_suitcase.xml │ │ ├── mapbox_search_sdk_ic_maki_sushi.xml │ │ ├── mapbox_search_sdk_ic_maki_swimming.xml │ │ ├── mapbox_search_sdk_ic_maki_table_tennis.xml │ │ ├── mapbox_search_sdk_ic_maki_teahouse.xml │ │ ├── mapbox_search_sdk_ic_maki_telephone.xml │ │ ├── mapbox_search_sdk_ic_maki_tennis.xml │ │ ├── mapbox_search_sdk_ic_maki_theatre.xml │ │ ├── mapbox_search_sdk_ic_maki_toilet.xml │ │ ├── mapbox_search_sdk_ic_maki_town.xml │ │ ├── mapbox_search_sdk_ic_maki_town_hall.xml │ │ ├── mapbox_search_sdk_ic_maki_triangle.xml │ │ ├── mapbox_search_sdk_ic_maki_triangle_stroked.xml │ │ ├── mapbox_search_sdk_ic_maki_veterinary.xml │ │ ├── mapbox_search_sdk_ic_maki_viewpoint.xml │ │ ├── mapbox_search_sdk_ic_maki_village.xml │ │ ├── mapbox_search_sdk_ic_maki_volcano.xml │ │ ├── mapbox_search_sdk_ic_maki_volleyball.xml │ │ ├── mapbox_search_sdk_ic_maki_warehouse.xml │ │ ├── mapbox_search_sdk_ic_maki_waste_basket.xml │ │ ├── mapbox_search_sdk_ic_maki_watch.xml │ │ ├── mapbox_search_sdk_ic_maki_water.xml │ │ ├── mapbox_search_sdk_ic_maki_waterfall.xml │ │ ├── mapbox_search_sdk_ic_maki_watermill.xml │ │ ├── mapbox_search_sdk_ic_maki_wetland.xml │ │ ├── mapbox_search_sdk_ic_maki_wheelchair.xml │ │ ├── mapbox_search_sdk_ic_maki_windmill.xml │ │ ├── mapbox_search_sdk_ic_maki_zoo.xml │ │ ├── mapbox_search_sdk_ic_mdi_search.xml │ │ ├── mapbox_search_sdk_ic_navigate_to.xml │ │ ├── mapbox_search_sdk_ic_populate.xml │ │ ├── mapbox_search_sdk_ic_search_result_address.xml │ │ ├── mapbox_search_sdk_ic_search_result_place.xml │ │ ├── mapbox_search_sdk_ic_share.xml │ │ ├── mapbox_search_sdk_list_divider.xml │ │ ├── mapbox_search_sdk_primary_button_background.xml │ │ └── mapbox_search_sdk_search_view_background.xml │ │ ├── layout │ │ ├── mapbox_search_sdk_error_item_layout.xml │ │ ├── mapbox_search_sdk_error_view.xml │ │ ├── mapbox_search_sdk_history_empty_layout.xml │ │ ├── mapbox_search_sdk_history_header_layout.xml │ │ ├── mapbox_search_sdk_history_item_layout.xml │ │ ├── mapbox_search_sdk_loading_item_layout.xml │ │ ├── mapbox_search_sdk_place_card_bottom_sheet.xml │ │ ├── mapbox_search_sdk_result_empty_layout.xml │ │ ├── mapbox_search_sdk_result_item_layout.xml │ │ └── mapbox_search_sdk_result_missing_feedback_layout.xml │ │ ├── values-land │ │ └── dimens.xml │ │ ├── values-night │ │ └── themes.xml │ │ └── values │ │ ├── attrs.xml │ │ ├── dimens.xml │ │ ├── ids.xml │ │ ├── public.xml │ │ ├── strings.xml │ │ ├── styles_buttons.xml │ │ ├── styles_texts.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── mapbox │ └── search │ └── ui │ ├── DataClassGeneratedFunctionsTest.kt │ ├── tests_support │ └── UiCustomTypeObjectCreators.kt │ ├── utils │ ├── DebouncerTest.kt │ └── format │ │ └── DistanceFormatterTest.kt │ └── view │ ├── SearchResultAdapterItemTest.kt │ └── UiErrorTest.kt ├── README.md ├── codecov.yml └── scripts ├── checksum.sh ├── ci-create-github-release.sh ├── ci-create-registry-pr.sh ├── ci-publish-api-reference.sh ├── ci-publish-snapshots.sh ├── ci-publish.sh ├── ci-validate-release-version.sh ├── codecov.sh ├── generate_docs.sh ├── generate_maki.sh ├── license-generate.py ├── license-validate.py ├── local_checks.sh ├── pre-commit ├── public-api.sh ├── quick_pitest_check.sh ├── sdk-registry-config-templates ├── search-autofill-android.yaml ├── search-base-android.yaml ├── search-discover-android.yaml ├── search-offline-android.yaml ├── search-place-autocomplete-android.yaml ├── search-sdk-android-ios.yaml ├── search-sdk-android.yaml ├── search-sdk-common-android.yaml └── search-ui-sdk-android.yaml ├── update_metalava.sh └── validate-kdocs.sh /.github/ISSUE_TEMPLATE/feature.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature Request 3 | about: To request a new feature, please provide detail on the outcome desired, solutions attempted and any suggested approaches. 4 | title: '' 5 | labels: 'feature' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## New Feature 11 | 12 | <- Description of the feature being requested and any outcomes desired, an example use case, and any suggestions for solution -> 13 | 14 | ## Why 15 | <- 1-2 sentence description of why you're requesting this feature. What problem does it solve? Why is it valuable? -> 16 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "github-actions" # See documentation for possible values 9 | directory: "/" # Location of package manifests 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /node_modules 3 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/.gitmodules -------------------------------------------------------------------------------- /AndroidStudio/dictionary.dic: -------------------------------------------------------------------------------- 1 | mapbox 2 | mapboxsdk 3 | geocoder 4 | geocoding 5 | geojson 6 | pitest 7 | ktlint 8 | detekt 9 | dokka 10 | bindgen 11 | codestyle 12 | bintray 13 | collab 14 | paddings 15 | maki 16 | interactor 17 | aerialway 18 | landuse 19 | teahouse 20 | uncategorized 21 | backstack 22 | gson 23 | bbox 24 | parcelization 25 | unmarshall 26 | hideable 27 | indexable 28 | deserialized 29 | caicos 30 | tokelau 31 | futuna 32 | timor 33 | leste 34 | bouvet 35 | burkina 36 | faso 37 | divoire 38 | czechia 39 | faroe 40 | hong 41 | macau 42 | mayotte 43 | zealand 44 | niue 45 | palau 46 | papua 47 | marino 48 | sint 49 | maarten 50 | lanka 51 | barthelemy 52 | kitts 53 | miquelon 54 | mayen 55 | bokmal 56 | hant 57 | pinner 58 | alternativelly 59 | okhttp 60 | logd 61 | logi 62 | logw 63 | loge 64 | routable 65 | tripadvisor 66 | isochrome 67 | pipefail 68 | plugshare 69 | codecov 70 | eoux 71 | pathnames 72 | apiurl 73 | tilesets 74 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Make Search SDK and Android teams the owners for all the files in the repo 2 | * @mapbox/search-sdk @mapbox/search-sdk-android 3 | -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | .idea 4 | /local.properties 5 | /.idea/caches 6 | /.idea/libraries 7 | /.idea/modules.xml 8 | /.idea/workspace.xml 9 | /.idea/navEditor.xml 10 | /.idea/assetWizardSettings.xml 11 | .DS_Store 12 | /build 13 | /captures 14 | .externalNativeBuild 15 | .cxx 16 | local.properties 17 | -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/androidTest/java/com/mapbox/demo/autofill/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.demo.autofill 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.mapbox.demo.autofill", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/drawable/card_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/drawable/red_marker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/AddressAutofill/app/src/main/res/drawable/red_marker.png -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/AddressAutofill/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/AddressAutofill/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/AddressAutofill/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/AddressAutofill/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/AddressAutofill/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/AddressAutofill/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/AddressAutofill/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/AddressAutofill/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/AddressAutofill/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/AddressAutofill/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #007AFF 4 | #000000 5 | #9B9B9B 6 | #6E8BF7 7 | 8 | #FFFFFF 9 | 10 | -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | AddressAutofill 3 | 4 | Where to deliver? 5 | State 6 | Zip Code 7 | City 8 | Apt., suite, etc. (optional) 9 | Drag map to correct pin position 10 | Unable to locate selected coordinate 11 | Unable to resolve selected suggestion 12 | 13 | -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/xml/backup_rules.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/main/res/xml/data_extraction_rules.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | 19 | 20 | -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/app/src/test/java/com/mapbox/demo/autofill/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.demo.autofill 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | plugins { 3 | id 'com.android.application' version '7.3.0' apply false 4 | id 'com.android.library' version '7.3.0' apply false 5 | id 'org.jetbrains.kotlin.android' version '1.6.0' apply false 6 | } 7 | -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/AddressAutofill/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /DemoApps/AddressAutofill/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Nov 11 14:19:05 CET 2022 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | .idea 5 | /.idea/caches 6 | /.idea/libraries 7 | /.idea/modules.xml 8 | /.idea/workspace.xml 9 | /.idea/navEditor.xml 10 | /.idea/assetWizardSettings.xml 11 | .DS_Store 12 | /build 13 | /captures 14 | .externalNativeBuild 15 | .cxx 16 | local.properties 17 | -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/androidTest/java/com/mapbox/demo/searchwithmaps/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.demo.searchwithmaps 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.mapbox.demo.searchwithmaps", appContext.packageName) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/menu/search_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | 16 | -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/mipmap-hdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/SearchWithMaps/app/src/main/res/mipmap-hdpi/ic_launcher.webp -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/SearchWithMaps/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/mipmap-mdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/SearchWithMaps/app/src/main/res/mipmap-mdpi/ic_launcher.webp -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/SearchWithMaps/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/mipmap-xhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/SearchWithMaps/app/src/main/res/mipmap-xhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/SearchWithMaps/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/SearchWithMaps/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/SearchWithMaps/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/SearchWithMaps/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/SearchWithMaps/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #007AFF 4 | #000000 5 | #9B9B9B 6 | #6E8BF7 7 | 8 | #FFFFFF 9 | 10 | -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8dp 4 | 5 | -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | SearchWithMaps 3 | 4 | Search demo 5 | Where to? 6 | 7 | -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/values/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/xml/backup_rules.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/main/res/xml/data_extraction_rules.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 12 | 13 | 19 | 20 | -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/app/src/test/java/com/mapbox/demo/searchwithmaps/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.demo.searchwithmaps 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | plugins { 3 | id 'com.android.application' version '7.3.0' apply false 4 | id 'com.android.library' version '7.3.0' apply false 5 | id 'org.jetbrains.kotlin.android' version '1.6.0' apply false 6 | } 7 | -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/DemoApps/SearchWithMaps/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /DemoApps/SearchWithMaps/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Nov 21 22:52:55 CET 2022 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /MapboxSearch/.editorconfig: -------------------------------------------------------------------------------- 1 | [*.kt] 2 | disabled_rules=indent -------------------------------------------------------------------------------- /MapboxSearch/.gitignore: -------------------------------------------------------------------------------- 1 | # Built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # Files for the ART/Dalvik VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # Generated files 12 | bin/ 13 | gen/ 14 | out/ 15 | 16 | # Gradle files 17 | .gradle/ 18 | build/ 19 | 20 | # Local configuration file (sdk path, etc) 21 | local.properties 22 | 23 | 24 | # Log Files 25 | *.log 26 | 27 | # Android Studio Navigation editor temp files 28 | .navigation/ 29 | 30 | # Android Studio captures folder 31 | captures/ 32 | 33 | # IntelliJ 34 | *.iml 35 | .idea 36 | 37 | # Keystore files 38 | # Uncomment the following line if you do not want to check your keystore files in. 39 | #*.jks 40 | 41 | # External native build folder generated in Android Studio 2.2 and later 42 | .externalNativeBuild 43 | 44 | # Google Services (e.g. APIs or Firebase) 45 | google-services.json 46 | 47 | node_modules/ 48 | .cxx/ 49 | -------------------------------------------------------------------------------- /MapboxSearch/autofill/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | local.properties 4 | .idea 5 | /build 6 | app/src/main/res/values/developer-config.xml 7 | src/main/assets/sdk_versions/com.mapbox.search.autofill -------------------------------------------------------------------------------- /MapboxSearch/autofill/gradle.properties: -------------------------------------------------------------------------------- 1 | mapboxArtifactName=autofill 2 | mapboxArtifactTitle=Mapbox Autofill SDK for Android 3 | mapboxArtifactDescription=Mapbox Autofill SDK for Android 4 | -------------------------------------------------------------------------------- /MapboxSearch/autofill/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /MapboxSearch/autofill/proguard/consumer-proguard-autofill.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /MapboxSearch/autofill/src/androidTest/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /MapboxSearch/autofill/src/androidTest/assets/error-response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status_code": 400, 3 | "error": "Need to include either a route, bbox, proximity, or origin for category searches", 4 | "version": "31:43720ce3c0535cf79cbd52268e91dca3f224933c", 5 | "code": "test-code" 6 | } 7 | -------------------------------------------------------------------------------- /MapboxSearch/autofill/src/androidTest/assets/suggestions_successful_empty_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "attribution":"NOTICE: © 2023 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service (https://www.mapbox.com/about/maps/). This response and the information it contains may not be retained. POI(s) provided by Foursquare.", 3 | "suggestions":[ 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /MapboxSearch/autofill/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /MapboxSearch/base/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | local.properties 4 | .idea 5 | /build 6 | src/main/assets/sdk_versions/com.mapbox.search.base -------------------------------------------------------------------------------- /MapboxSearch/base/gradle.properties: -------------------------------------------------------------------------------- 1 | mapboxArtifactName=base 2 | mapboxArtifactTitle=Mapbox Base SDK for Android 3 | mapboxArtifactDescription=Mapbox Base SDK for Android 4 | -------------------------------------------------------------------------------- /MapboxSearch/base/proguard/consumer-proguard-base.txt: -------------------------------------------------------------------------------- 1 | # --- Bindgen-generated classes --- 2 | -keep class com.mapbox.search.internal.bindgen.** {*;} 3 | 4 | # --- Mapbox SDKs --- 5 | -keep class com.mapbox.geojson.** {*;} 6 | -keep class com.mapbox.bindgen.** {*;} 7 | 8 | # --- GSON --- 9 | # This gson rule is too lenient, but official proguard config from gson doesn't work. 10 | -keep class com.google.gson.** {*;} 11 | -keepclassmembers enum * { 12 | ; 13 | } 14 | -keepattributes Signature 15 | -keepattributes *Annotation* 16 | -dontwarn sun.misc.** 17 | -keepclassmembers,allowobfuscation class * { 18 | @com.google.gson.annotations.SerializedName ; 19 | } 20 | 21 | # --- AutoValue --- 22 | # AutoValue annotations are retained but dependency is compileOnly. 23 | -dontwarn com.google.auto.value.** 24 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 17 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/BaseRequestOptions.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base 2 | 3 | import android.os.Parcelable 4 | import com.mapbox.search.base.core.CoreRequestOptions 5 | import com.mapbox.search.base.result.SearchRequestContext 6 | import kotlinx.parcelize.Parcelize 7 | 8 | // TODO do we need this class? 9 | @Parcelize 10 | data class BaseRequestOptions( 11 | val core: CoreRequestOptions, 12 | val requestContext: SearchRequestContext, 13 | ) : Parcelable 14 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/BaseResponseInfo.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base 2 | 3 | import android.os.Parcelable 4 | import com.mapbox.search.base.result.BaseSearchResponse 5 | import kotlinx.parcelize.Parcelize 6 | 7 | @Parcelize 8 | data class BaseResponseInfo( 9 | val requestOptions: BaseRequestOptions, 10 | val coreSearchResponse: BaseSearchResponse?, 11 | val isReproducible: Boolean, 12 | ) : Parcelable 13 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/BaseSearchCallback.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base 2 | 3 | import com.mapbox.search.base.result.BaseSearchResult 4 | 5 | interface BaseSearchCallback { 6 | fun onResults(results: List, responseInfo: BaseResponseInfo) 7 | fun onError(e: Exception) 8 | } 9 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/BaseSearchSdkInitializer.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base 2 | 3 | import com.mapbox.common.BaseMapboxInitializer 4 | 5 | class BaseSearchSdkInitializer : BaseMapboxInitializer() { 6 | override val initializerClass = BaseSearchSdkInitializerImpl::class.java 7 | } 8 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/IsoLanguage.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base 2 | 3 | import com.mapbox.search.common.IsoLanguageCode 4 | import java.util.Locale 5 | 6 | fun defaultLocaleLanguage(): IsoLanguageCode { 7 | return IsoLanguageCode(Locale.getDefault().language) 8 | } 9 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/StubCompletionCallback.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base 2 | 3 | import com.mapbox.search.common.CompletionCallback 4 | 5 | class StubCompletionCallback : CompletionCallback { 6 | override fun onComplete(result: T) {} 7 | 8 | override fun onError(e: Exception) {} 9 | } 10 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/concurrent/CommonMainThreadChecker.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.concurrent 2 | 3 | import com.mapbox.search.common.concurrent.SearchSdkMainThreadWorker 4 | 5 | val isOnMainLooper: Boolean 6 | get() = SearchSdkMainThreadWorker.isMainThread 7 | 8 | fun checkMainThread() { 9 | check(isOnMainLooper) { 10 | "Expected main thread but was: ${Thread.currentThread().name}" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/core/Extensions.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.core 2 | 3 | val CoreResultMetadata.countryIso1: String? 4 | get() = data["iso_3166_1"] 5 | 6 | val CoreResultMetadata.countryIso2: String? 7 | get() = data["iso_3166_2"] 8 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/core/UserActivityReporter.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.core 2 | 3 | import com.mapbox.search.base.utils.UserAgentProvider 4 | import com.mapbox.search.internal.bindgen.UserActivityReporter 5 | import com.mapbox.search.internal.bindgen.UserActivityReporterOptions 6 | 7 | fun getUserActivityReporter( 8 | eventsUrl: String? = null 9 | ): UserActivityReporter { 10 | val options = UserActivityReporterOptions( 11 | UserAgentProvider.sdkInformation(), 12 | eventsUrl 13 | ) 14 | return UserActivityReporter.getOrCreate(options) 15 | } 16 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/engine/BaseSearchEngine.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.engine 2 | 3 | import com.mapbox.search.base.task.AsyncOperationTaskImpl 4 | import com.mapbox.search.base.task.ExtendedAsyncOperationTask 5 | 6 | abstract class BaseSearchEngine { 7 | 8 | protected fun makeRequest( 9 | callback: T, 10 | searchCall: (AsyncOperationTaskImpl) -> Unit 11 | ): ExtendedAsyncOperationTask { 12 | val task = AsyncOperationTaskImpl().apply { 13 | callbackDelegate = callback 14 | } 15 | searchCall(task) 16 | return task 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/factory/BusinessDetails.kt: -------------------------------------------------------------------------------- 1 | @file:OptIn(MapboxExperimental::class) 2 | 3 | package com.mapbox.search.base.factory 4 | 5 | import androidx.annotation.RestrictTo 6 | import com.mapbox.annotation.MapboxExperimental 7 | import com.mapbox.search.base.core.CoreBusinessDetails 8 | import com.mapbox.search.common.BusinessDetails 9 | 10 | @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 11 | fun CoreBusinessDetails.mapToPlatform(): BusinessDetails { 12 | return BusinessDetails( 13 | name = name, 14 | website = website, 15 | logo = logo?.mapToPlatform(), 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/factory/LocalizedText.kt: -------------------------------------------------------------------------------- 1 | @file:OptIn(MapboxExperimental::class) 2 | 3 | package com.mapbox.search.base.factory 4 | 5 | import androidx.annotation.RestrictTo 6 | import com.mapbox.annotation.MapboxExperimental 7 | import com.mapbox.search.base.core.CoreDisplayText 8 | import com.mapbox.search.common.LocalizedText 9 | 10 | @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 11 | fun CoreDisplayText.mapToPlatform(): LocalizedText { 12 | return LocalizedText( 13 | language = this.language, 14 | text = this.text, 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/location/LocationUtils.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.location 2 | 3 | import com.mapbox.common.location.LocationProvider 4 | import com.mapbox.common.location.LocationServiceFactory 5 | import com.mapbox.geojson.BoundingBox 6 | import kotlin.math.abs 7 | import kotlin.math.log2 8 | import kotlin.math.max 9 | import kotlin.math.min 10 | 11 | fun defaultLocationProvider(): LocationProvider? = 12 | LocationServiceFactory.getOrCreate() 13 | .getDeviceLocationProvider(null) 14 | .value 15 | 16 | fun calculateMapZoom(bbox: BoundingBox): Float { 17 | val eps = 1.0E-5 18 | val lngZoom = 360.0 / max(abs(bbox.west() - bbox.east()), eps) 19 | val latZoom = 180.0 / max(abs(bbox.north() - bbox.south()), eps) 20 | return log2(min(lngZoom, latZoom)).toFloat() 21 | } 22 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/location/WrapperLocationProvider.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.location 2 | 3 | import com.mapbox.geojson.Point 4 | import com.mapbox.search.base.core.CoreBoundingBox 5 | import com.mapbox.search.base.core.CoreLocationProvider 6 | 7 | class WrapperLocationProvider( 8 | private val locationProvider: CoreLocationProvider?, 9 | private val viewportProvider: (() -> CoreBoundingBox?)? 10 | ) : CoreLocationProvider { 11 | 12 | override fun getLocation(): Point? { 13 | return locationProvider?.location 14 | } 15 | 16 | override fun getViewport(): CoreBoundingBox? { 17 | return viewportProvider?.invoke() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/logger/Log.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.logger 2 | 3 | import androidx.annotation.VisibleForTesting 4 | import com.mapbox.common.CommonSdkLog 5 | 6 | @VisibleForTesting 7 | fun resetLogImpl() { 8 | CommonSdkLog.resetLogImpl() 9 | } 10 | 11 | @VisibleForTesting 12 | fun reinitializeLogImpl() { 13 | CommonSdkLog.reinitializeLogImpl() 14 | } 15 | 16 | fun logd(message: String, tag: String? = null) { 17 | CommonSdkLog.logd(tag, message) 18 | } 19 | 20 | fun logi(message: String, tag: String? = null) { 21 | CommonSdkLog.logi(tag, message) 22 | } 23 | 24 | fun logw(message: String, tag: String? = null) { 25 | CommonSdkLog.logw(tag, message) 26 | } 27 | 28 | fun loge(message: String, tag: String? = null) { 29 | CommonSdkLog.loge(tag, message) 30 | } 31 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/result/SearchRequestContext.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.result 2 | 3 | import android.os.Parcelable 4 | import com.mapbox.search.base.core.CoreApiType 5 | import com.mapbox.search.base.utils.orientation.ScreenOrientation 6 | import kotlinx.parcelize.Parcelize 7 | import java.util.Locale 8 | 9 | @Parcelize 10 | data class SearchRequestContext( 11 | val apiType: CoreApiType, 12 | val keyboardLocale: Locale? = null, 13 | val screenOrientation: ScreenOrientation? = null, 14 | val responseUuid: String? = null 15 | ) : Parcelable 16 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/FormattedTimeProvider.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils 2 | 3 | import java.text.SimpleDateFormat 4 | import java.util.Date 5 | import java.util.Locale 6 | 7 | fun interface FormattedTimeProvider { 8 | fun currentTimeIso8601Formatted(): String 9 | } 10 | 11 | class FormattedTimeProviderImpl( 12 | private val timeProvider: TimeProvider 13 | ) : FormattedTimeProvider { 14 | 15 | override fun currentTimeIso8601Formatted(): String { 16 | val currentTime = timeProvider.currentTimeMillis() 17 | return ISO_8601_DATE_FORMATTER.format(Date(currentTime)) 18 | } 19 | 20 | private companion object { 21 | val ISO_8601_DATE_FORMATTER = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Locale.ENGLISH) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/InternalIgnorableException.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils 2 | 3 | import java.lang.RuntimeException 4 | 5 | /** 6 | * Exception thrown when internal error happens, 7 | * but should be ignored because the cause issue is known and awaiting for a fix. 8 | */ 9 | internal data class InternalIgnorableException( 10 | override val message: String, 11 | override val cause: Exception? = null 12 | ) : RuntimeException(message, cause) 13 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/Reflection.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils 2 | 3 | @get:JvmSynthetic 4 | inline val Class.printableName: String 5 | get() = if (isAnonymousClass) { 6 | name 7 | } else { 8 | simpleName 9 | } 10 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/RequestTimeoutProvider.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils 2 | 3 | import androidx.annotation.RestrictTo 4 | 5 | @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP_PREFIX) 6 | fun defaultOnlineRequestTimeoutSeconds(): Int? = null 7 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/TimeProvider.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils 2 | 3 | fun interface TimeProvider { 4 | fun currentTimeMillis(): Long 5 | } 6 | 7 | class LocalTimeProvider : TimeProvider { 8 | override fun currentTimeMillis(): Long = System.currentTimeMillis() 9 | } 10 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/UUIDProvider.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils 2 | 3 | import java.util.UUID 4 | 5 | fun interface UUIDProvider { 6 | fun generateUUID(): String 7 | } 8 | 9 | class UUIDProviderImpl : UUIDProvider { 10 | override fun generateUUID(): String = UUID.randomUUID().toString() 11 | } 12 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/UserAgentProvider.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils 2 | 3 | import com.mapbox.common.SdkInformation 4 | import com.mapbox.search.common.BuildConfig 5 | 6 | object UserAgentProvider { 7 | 8 | const val sdkPackageName = "com.mapbox.search" 9 | const val sdkName = "search-sdk-android" 10 | const val sdkVersionName = BuildConfig.VERSION_NAME 11 | 12 | val userAgent = if (BuildConfig.DEBUG) { 13 | "$sdkName-internal/$sdkVersionName" 14 | } else { 15 | "$sdkName/$sdkVersionName" 16 | } 17 | 18 | fun sdkInformation(): SdkInformation { 19 | return SdkInformation(sdkName, sdkVersionName, sdkPackageName) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/extension/BoundingBox.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils.extension 2 | 3 | import com.mapbox.geojson.BoundingBox 4 | import com.mapbox.search.base.core.CoreBoundingBox 5 | 6 | fun BoundingBox.mapToCore(): CoreBoundingBox = CoreBoundingBox(southwest(), northeast()) 7 | fun CoreBoundingBox.mapToPlatform(): BoundingBox = BoundingBox.fromPoints(min, max) 8 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/extension/Context.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils.extension 2 | 3 | import android.content.Context 4 | import android.content.res.Configuration 5 | 6 | val Context.isLandscape: Boolean 7 | get() = resources.configuration.orientation == Configuration.ORIENTATION_LANDSCAPE 8 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/extension/Double.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils.extension 2 | 3 | // https://jqno.nl/equalsverifier/errormessages/double-equals-doesnt-use-doublecompare-for-field-foo/ 4 | fun Double?.safeCompareTo(other: Double?): Boolean { 5 | return when { 6 | this == null -> other == null 7 | other == null -> false 8 | else -> compareTo(other) == 0 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/extension/Float.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils.extension 2 | 3 | // https://jqno.nl/equalsverifier/errormessages/double-equals-doesnt-use-doublecompare-for-field-foo/ 4 | fun Float?.safeCompareTo(other: Float?): Boolean { 5 | return when { 6 | this == null -> other == null 7 | other == null -> false 8 | else -> compareTo(other) == 0 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/extension/Location.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils.extension 2 | 3 | import com.mapbox.common.location.Location 4 | import com.mapbox.geojson.Point 5 | 6 | fun Location.toPoint(): Point = Point.fromLngLat(longitude, latitude) 7 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/extension/Map.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils.extension 2 | 3 | @JvmSynthetic 4 | fun MutableMap>.addValue( 5 | key: K, 6 | value: V, 7 | setCreator: () -> MutableSet = { mutableSetOf() }, 8 | ) { 9 | var list = get(key) 10 | if (list == null) { 11 | list = setCreator() 12 | put(key, list) 13 | } 14 | list.add(value) 15 | } 16 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/extension/PackageInfo.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils.extension 2 | 3 | import android.content.pm.PackageInfo 4 | import android.os.Build 5 | 6 | val PackageInfo.versionCodeCompat: Long 7 | get() = if (Build.VERSION.SDK_INT >= 28) { 8 | longVersionCode 9 | } else { 10 | @Suppress("DEPRECATION") 11 | versionCode.toLong() 12 | } 13 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/extension/Point.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils.extension 2 | 3 | import com.mapbox.geojson.Point 4 | import com.mapbox.search.common.DistanceCalculator 5 | 6 | /** 7 | * Calculates distance to specified destination point. 8 | * 9 | * @return distance to [destination] in meters. 10 | */ 11 | @JvmSynthetic 12 | fun Point.distanceTo(destination: Point): Double = 13 | DistanceCalculator.instance(latitude = latitude()) 14 | .distance(this, destination) 15 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/extension/RoutablePoint.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils.extension 2 | 3 | import com.mapbox.search.base.core.CoreRoutablePoint 4 | import com.mapbox.search.common.RoutablePoint 5 | 6 | fun CoreRoutablePoint.mapToPlatform() = RoutablePoint( 7 | point = point, 8 | name = name, 9 | ) 10 | 11 | fun RoutablePoint.mapToCore() = CoreRoutablePoint( 12 | point, 13 | name, 14 | ) 15 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/extension/SearchResponseError.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils.extension 2 | 3 | import com.mapbox.search.base.core.CoreSearchResponseError 4 | import com.mapbox.search.base.core.CoreSearchResponseErrorType 5 | import com.mapbox.search.common.SearchRequestException 6 | import java.io.IOException 7 | 8 | // Temporary solution for https://github.com/mapbox/mapbox-search-sdk/issues/857 9 | internal fun CoreSearchResponseError.toPlatformHttpException(): Exception { 10 | check(typeInfo == CoreSearchResponseErrorType.HTTP_ERROR) 11 | return if (httpError.httpCode >= 200) { 12 | SearchRequestException( 13 | message = httpError.message, 14 | code = httpError.httpCode 15 | ) 16 | } else { 17 | IOException(httpError.message) 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/extension/String.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils.extension 2 | 3 | fun String?.nullIfEmpty(): String? { 4 | return if (isNullOrEmpty()) { 5 | null 6 | } else { 7 | this 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/orientation/ScreenOrientation.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils.orientation 2 | 3 | enum class ScreenOrientation(val rawValue: String) { 4 | PORTRAIT("portrait"), 5 | LANDSCAPE("landscape"); 6 | } 7 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/main/java/com/mapbox/search/base/utils/orientation/ScreenOrientationProvider.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.utils.orientation 2 | 3 | import android.app.Application 4 | import android.content.res.Configuration 5 | 6 | fun interface ScreenOrientationProvider { 7 | fun provideOrientation(): ScreenOrientation? 8 | } 9 | 10 | class AndroidScreenOrientationProvider( 11 | private val application: Application 12 | ) : ScreenOrientationProvider { 13 | 14 | override fun provideOrientation(): ScreenOrientation { 15 | return when (val orientation = application.resources.configuration.orientation) { 16 | Configuration.ORIENTATION_LANDSCAPE -> ScreenOrientation.LANDSCAPE 17 | Configuration.ORIENTATION_PORTRAIT -> ScreenOrientation.PORTRAIT 18 | else -> throw IllegalStateException("Unknown android orientation code (= $orientation)") 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/test/java/com/mapbox/search/base/factory/LocalizedTextTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.factory 2 | 3 | import com.mapbox.annotation.MapboxExperimental 4 | import com.mapbox.search.base.core.CoreDisplayText 5 | import com.mapbox.search.common.LocalizedText 6 | import org.junit.jupiter.api.Assertions.assertEquals 7 | import org.junit.jupiter.api.Test 8 | 9 | @OptIn(MapboxExperimental::class) 10 | class LocalizedTextTest { 11 | 12 | @Test 13 | fun `CoreDisplayText mapToPlatform() test`() { 14 | val coreDisplayText = CoreDisplayText( 15 | language = "en", 16 | text = "Test text" 17 | ) 18 | 19 | val expectedLocalizedText = LocalizedText( 20 | language = coreDisplayText.language, 21 | text = coreDisplayText.text 22 | ) 23 | 24 | assertEquals(expectedLocalizedText, coreDisplayText.mapToPlatform()) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/test/java/com/mapbox/search/base/tests_support/EqualsVerifier.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.tests_support 2 | 3 | import com.mapbox.search.base.result.BaseRawSearchResult 4 | import nl.jqno.equalsverifier.api.SingleTypeEqualsVerifierApi 5 | 6 | internal fun SingleTypeEqualsVerifierApi.withPrefabTestBaseRawSearchResult( 7 | red: BaseRawSearchResult = createTestBaseRawSearchResult(id = "test-result-1"), 8 | blue: BaseRawSearchResult = createTestBaseRawSearchResult(id = "test-result-2") 9 | ): SingleTypeEqualsVerifierApi { 10 | return withPrefabValues(BaseRawSearchResult::class.java, red, blue) 11 | } 12 | -------------------------------------------------------------------------------- /MapboxSearch/base/src/test/java/com/mapbox/search/base/tests_support/TestParcelable.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.base.tests_support 2 | 3 | import android.os.Parcelable 4 | import kotlinx.parcelize.Parcelize 5 | 6 | @Parcelize 7 | data class TestParcelable(val id: String) : Parcelable 8 | -------------------------------------------------------------------------------- /MapboxSearch/common-tests/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /MapboxSearch/common-tests/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /MapboxSearch/common-tests/src/main/java/com/mapbox/search/common/tests/Assertions.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.tests 2 | 3 | import com.mapbox.bindgen.Expected 4 | import org.junit.Assert.fail 5 | 6 | private fun Expected.toPrettyString(): String { 7 | return if (isValue) { 8 | "Value: $value" 9 | } else { 10 | "Error: $error" 11 | } 12 | } 13 | 14 | private fun Expected.equalsTo(e: Expected): Boolean { 15 | return if (isValue && e.isValue) { 16 | value == e.value 17 | } else if (isError && e.isError) { 18 | error == e.error 19 | } else { 20 | false 21 | } 22 | } 23 | 24 | fun assertEqualsExpected(expected: Expected, actual: Expected) { 25 | if (!expected.equalsTo(actual)) { 26 | fail("Expected ${expected.toPrettyString()}, but was ${actual.toPrettyString()}") 27 | } 28 | } -------------------------------------------------------------------------------- /MapboxSearch/common-tests/src/main/java/com/mapbox/search/common/tests/BaseBlockingCallback.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.tests 2 | 3 | import java.util.concurrent.CountDownLatch 4 | import java.util.concurrent.TimeUnit 5 | 6 | abstract class BaseBlockingCallback { 7 | 8 | private lateinit var result: T 9 | private var countDownLatch = CountDownLatch(1) 10 | 11 | protected fun publishResult(result: T) { 12 | this.result = result 13 | countDownLatch.countDown() 14 | } 15 | 16 | fun getResultBlocking(timeout: Long = Long.MAX_VALUE, timeUnit: TimeUnit = TimeUnit.MILLISECONDS): T { 17 | countDownLatch.await(timeout, timeUnit) 18 | return result 19 | } 20 | 21 | fun reset() { 22 | countDownLatch = CountDownLatch(1) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /MapboxSearch/common-tests/src/main/java/com/mapbox/search/common/tests/CustomTypeObjectCreator.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.tests 2 | 3 | import kotlin.reflect.KClass 4 | 5 | interface CustomTypeObjectCreator { 6 | fun supports(clazz: KClass<*>): Boolean 7 | fun create(mode: ObjectsFactory.ObjectMode): Any? 8 | } 9 | 10 | class CustomTypeObjectCreatorImpl( 11 | private val clazz: KClass<*>, 12 | private val factory: (ObjectsFactory.ObjectMode) -> Any? 13 | ) : CustomTypeObjectCreator { 14 | 15 | override fun supports(clazz: KClass<*>) = clazz == this.clazz 16 | 17 | override fun create(mode: ObjectsFactory.ObjectMode): Any? = factory(mode) 18 | } 19 | -------------------------------------------------------------------------------- /MapboxSearch/common-tests/src/main/java/com/mapbox/search/common/tests/EqualsVerifier.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.tests 2 | 3 | import com.mapbox.geojson.BoundingBox 4 | import com.mapbox.geojson.Point 5 | import nl.jqno.equalsverifier.api.SingleTypeEqualsVerifierApi 6 | 7 | fun SingleTypeEqualsVerifierApi.withPrefabTestPoint( 8 | red: Point = Point.fromLngLat(1.0, 2.0), 9 | blue: Point = Point.fromLngLat(3.0, 4.0) 10 | ): SingleTypeEqualsVerifierApi { 11 | return withPrefabValues(Point::class.java, red, blue) 12 | } 13 | 14 | fun SingleTypeEqualsVerifierApi.withPrefabTestBoundingBox( 15 | red: BoundingBox = BoundingBox.fromPoints(Point.fromLngLat(1.0, 2.0), Point.fromLngLat(3.0, 4.0)), 16 | blue: BoundingBox = BoundingBox.fromPoints(Point.fromLngLat(5.0, 6.0), Point.fromLngLat(7.0, 8.0)) 17 | ): SingleTypeEqualsVerifierApi { 18 | return withPrefabValues(BoundingBox::class.java, red, blue) 19 | } 20 | -------------------------------------------------------------------------------- /MapboxSearch/common-tests/src/main/java/com/mapbox/search/common/tests/TestConstants.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.tests 2 | 3 | public object TestConstants { 4 | const val ASSERTIONS_KT_CLASS_NAME = "com.mapbox.search.base.AssertionsKt" 5 | } 6 | -------------------------------------------------------------------------------- /MapboxSearch/common-tests/src/main/java/com/mapbox/search/common/tests/TestExecutor.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.tests 2 | 3 | import java.util.concurrent.Executor 4 | 5 | class TestExecutor : Executor { 6 | override fun execute(command: Runnable) { 7 | command.run() 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /MapboxSearch/common-tests/src/main/java/com/mapbox/search/common/tests/ThrowableUtils.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.tests 2 | 3 | inline fun catchThrowable(block: () -> Unit): T? { 4 | return try { 5 | block() 6 | null 7 | } catch (e: Throwable) { 8 | if (e is T) e else throw e 9 | } 10 | } 11 | 12 | fun Throwable?.equalsTo(other: Throwable?): Boolean { 13 | if (this == null || other == null) return this == other 14 | 15 | if (this === other) return true 16 | if (this.javaClass != other.javaClass) return false 17 | 18 | if (this.message != other.message) return false 19 | if (this.cause != other.cause) return false 20 | 21 | return true 22 | } 23 | -------------------------------------------------------------------------------- /MapboxSearch/common-tests/src/main/java/com/mapbox/search/common/tests/Utils.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.tests 2 | 3 | import com.mapbox.search.internal.bindgen.SearchResult 4 | 5 | fun compareSearchResultWithServerSearchResult(expected: SearchResult, serverResult: SearchResult): Boolean { 6 | if (expected == serverResult) return true 7 | val fixedResult = expected.copy(userRecordPriority = serverResult.userRecordPriority) 8 | return fixedResult == serverResult 9 | } 10 | -------------------------------------------------------------------------------- /MapboxSearch/custom-detekt-rules/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /MapboxSearch/custom-detekt-rules/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | id 'kotlin' 4 | } 5 | 6 | java { 7 | sourceCompatibility = JavaVersion.VERSION_1_8 8 | targetCompatibility = JavaVersion.VERSION_1_8 9 | } 10 | 11 | dependencies { 12 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" 13 | implementation "io.gitlab.arturbosch.detekt:detekt-api:$detekt_version" 14 | implementation "io.gitlab.arturbosch.detekt:detekt-test:$detekt_version" 15 | } 16 | -------------------------------------------------------------------------------- /MapboxSearch/custom-detekt-rules/src/main/java/com/mapbox/search/detekt/CustomRuleSetProvider.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.detekt 2 | 3 | import com.mapbox.search.detekt.rules.NoMockkVerifyImport 4 | import io.gitlab.arturbosch.detekt.api.Config 5 | import io.gitlab.arturbosch.detekt.api.RuleSet 6 | import io.gitlab.arturbosch.detekt.api.RuleSetProvider 7 | 8 | class CustomRuleSetProvider : RuleSetProvider { 9 | 10 | override val ruleSetId: String = "custom-rules" 11 | 12 | override fun instance(config: Config) = RuleSet( 13 | ruleSetId, 14 | listOf(NoMockkVerifyImport(config)) 15 | ) 16 | } 17 | -------------------------------------------------------------------------------- /MapboxSearch/custom-detekt-rules/src/main/resources/META-INF/services/io.gitlab.arturbosch.detekt.api.RuleSetProvider: -------------------------------------------------------------------------------- 1 | com.mapbox.search.detekt.CustomRuleSetProvider -------------------------------------------------------------------------------- /MapboxSearch/discover/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | local.properties 4 | .idea 5 | /build 6 | src/main/assets/sdk_versions/com.mapbox.search.discover -------------------------------------------------------------------------------- /MapboxSearch/discover/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/discover/consumer-rules.pro -------------------------------------------------------------------------------- /MapboxSearch/discover/gradle.properties: -------------------------------------------------------------------------------- 1 | mapboxArtifactName=discover 2 | mapboxArtifactTitle=Mapbox Discover SDK for Android 3 | mapboxArtifactDescription=Mapbox Discover SDK for Android 4 | -------------------------------------------------------------------------------- /MapboxSearch/discover/proguard/consumer-proguard-discover.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /MapboxSearch/discover/src/androidTest/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /MapboxSearch/discover/src/androidTest/assets/error-response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status_code": 400, 3 | "error": "Need to include either a route, bbox, proximity, or origin for category searches", 4 | "version": "31:43720ce3c0535cf79cbd52268e91dca3f224933c", 5 | "code": "test-code" 6 | } 7 | -------------------------------------------------------------------------------- /MapboxSearch/discover/src/androidTest/assets/successful_empty_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "type":"FeatureCollection", 3 | "features":[ 4 | ], 5 | "attribution":"© 2021 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)", 6 | "version":"46:a4b40e46f08bf603328aace583b2e0d6db4eb851", 7 | "response_uuid":"544304d0-2007-4354-a599-c522cb150bb0" 8 | } 9 | -------------------------------------------------------------------------------- /MapboxSearch/discover/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /MapboxSearch/discover/src/test/java/com/mapbox/search/discover/DiscoverAddressTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.discover 2 | 3 | import com.mapbox.search.common.tests.ToStringVerifier 4 | import nl.jqno.equalsverifier.EqualsVerifier 5 | import org.junit.jupiter.api.Test 6 | 7 | internal class DiscoverAddressTest { 8 | 9 | @Test 10 | fun `equals() and hashCode() functions are correct`() { 11 | EqualsVerifier.forClass(DiscoverAddress::class.java) 12 | .verify() 13 | } 14 | 15 | @Test 16 | fun `toString() function is correct`() { 17 | ToStringVerifier( 18 | clazz = DiscoverAddress::class, 19 | includeAllProperties = false 20 | ).verify() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /MapboxSearch/gradle/dexcount.gradle: -------------------------------------------------------------------------------- 1 | // TODO unable to resolve class com.getkeepsafe.dexcount.OutputFormat 2 | // import com.getkeepsafe.dexcount.OutputFormat 3 | 4 | apply plugin: 'com.getkeepsafe.dexcount' 5 | 6 | dexcount { 7 | //format = OutputFormat.JSON 8 | } 9 | -------------------------------------------------------------------------------- /MapboxSearch/gradle/ktlint.gradle: -------------------------------------------------------------------------------- 1 | configurations { 2 | ktlint 3 | } 4 | 5 | def inputFiles = project.fileTree(dir: "src", include: "**/*.kt") 6 | 7 | task ktlint(type: JavaExec, group: "verification") { 8 | inputs.files(inputFiles) 9 | 10 | description = "Check Kotlin code style." 11 | main = "com.pinterest.ktlint.Main" 12 | classpath = configurations.ktlint 13 | args "src/**/*.kt" 14 | } 15 | check.dependsOn ktlint 16 | 17 | task ktlintFormat(type: JavaExec, group: "formatting") { 18 | description = "Fix Kotlin code style deviations." 19 | main = "com.pinterest.ktlint.Main" 20 | classpath = configurations.ktlint 21 | args "-F", "src/**/*.kt" 22 | } -------------------------------------------------------------------------------- /MapboxSearch/gradle/license.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.jaredsburrows.license' 2 | 3 | licenseReport { 4 | generateCsvReport = true 5 | generateHtmlReport = true 6 | generateJsonReport = true 7 | 8 | copyCsvReportToAssets = false 9 | copyHtmlReportToAssets = false 10 | copyJsonReportToAssets = false 11 | } 12 | -------------------------------------------------------------------------------- /MapboxSearch/gradle/utils.gradle: -------------------------------------------------------------------------------- 1 | ext.projectOrLocalProperty = { name -> 2 | if (project.properties[name] != null) { 3 | return project.properties[name] 4 | } 5 | 6 | Properties properties = new Properties() 7 | def file = project.rootProject.file('local.properties') 8 | if (file.exists()) { 9 | properties.load(file.newDataInputStream()) 10 | def localProperty = properties.getProperty(name) 11 | if (localProperty != null) { 12 | return localProperty 13 | } 14 | } 15 | return null 16 | } 17 | 18 | ext.booleanProjectOrLocalProperty = { name -> 19 | return projectOrLocalProperty(name)?.toBoolean() 20 | } 21 | -------------------------------------------------------------------------------- /MapboxSearch/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /MapboxSearch/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Apr 30 21:35:57 EDT 2024 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip 5 | zipStoreBase=GRADLE_USER_HOME 6 | zipStorePath=wrapper/dists 7 | -------------------------------------------------------------------------------- /MapboxSearch/metalava/metalava.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/metalava/metalava.jar -------------------------------------------------------------------------------- /MapboxSearch/offline/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | local.properties 4 | .idea 5 | /build 6 | src/main/assets/sdk_versions/com.mapbox.search.offline -------------------------------------------------------------------------------- /MapboxSearch/offline/gradle.properties: -------------------------------------------------------------------------------- 1 | mapboxArtifactName=offline 2 | mapboxArtifactTitle=Mapbox Offline Search SDK for Android 3 | mapboxArtifactDescription=Mapbox Offline Search SDK for Android 4 | -------------------------------------------------------------------------------- /MapboxSearch/offline/proguard/consumer-proguard-offline.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/offline/proguard/consumer-proguard-offline.txt -------------------------------------------------------------------------------- /MapboxSearch/offline/src/androidTest/java/com/mapbox/search/offline/tests_support/BlockingEngineReadyCallback.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.offline.tests_support 2 | 3 | import com.mapbox.search.common.tests.BaseBlockingCallback 4 | import com.mapbox.search.offline.OfflineSearchEngine 5 | 6 | internal class BlockingEngineReadyCallback : BaseBlockingCallback(), OfflineSearchEngine.EngineReadyCallback { 7 | override fun onEngineReady() { 8 | publishResult(Unit) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MapboxSearch/offline/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /MapboxSearch/offline/src/main/java/com/mapbox/search/offline/OfflineSearchCallbackAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.offline 2 | 3 | import com.mapbox.search.base.BaseResponseInfo 4 | import com.mapbox.search.base.BaseSearchCallback 5 | import com.mapbox.search.base.result.BaseSearchResult 6 | 7 | internal class OfflineSearchCallbackAdapter(private val callback: OfflineSearchCallback) : BaseSearchCallback { 8 | override fun onResults(results: List, responseInfo: BaseResponseInfo) { 9 | callback.onResults( 10 | results = results 11 | .filter { it.name.isNotBlank() } 12 | .map { OfflineSearchResult(it.rawSearchResult) }, 13 | responseInfo = OfflineResponseInfo(responseInfo.requestOptions.core.mapToOfflineSdkType()) 14 | ) 15 | } 16 | 17 | override fun onError(e: Exception) { 18 | callback.onError(e) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MapboxSearch/offline/src/test/java/com/mapbox/search/offline/TestMainThreadWorker.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.offline 2 | 3 | import com.mapbox.search.common.concurrent.MainThreadWorker 4 | import java.util.concurrent.Executor 5 | import java.util.concurrent.TimeUnit 6 | 7 | internal class TestMainThreadWorker : MainThreadWorker { 8 | 9 | override val isMainThread: Boolean 10 | get() = true 11 | 12 | override var mainExecutor: Executor = Executor { runnable -> 13 | runnable.run() 14 | } 15 | 16 | override fun post(runnable: Runnable) { 17 | runnable.run() 18 | } 19 | 20 | override fun postDelayed(delay: Long, unit: TimeUnit, runnable: Runnable) { 21 | post(runnable) 22 | } 23 | 24 | override fun cancel(runnable: Runnable) { 25 | // Do nothing 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /MapboxSearch/place-autocomplete/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | local.properties 4 | .idea 5 | /build 6 | app/src/main/res/values/developer-config.xml 7 | src/main/assets/sdk_versions/com.mapbox.search.autocomplete -------------------------------------------------------------------------------- /MapboxSearch/place-autocomplete/gradle.properties: -------------------------------------------------------------------------------- 1 | mapboxArtifactName=place-autocomplete 2 | mapboxArtifactTitle=Mapbox Place Autocomplete SDK for Android 3 | mapboxArtifactDescription=Mapbox Place Autocomplete SDK for Android 4 | -------------------------------------------------------------------------------- /MapboxSearch/place-autocomplete/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /MapboxSearch/place-autocomplete/proguard/consumer-proguard-autocomplete.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /MapboxSearch/place-autocomplete/src/androidTest/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /MapboxSearch/place-autocomplete/src/androidTest/assets/error-response.json: -------------------------------------------------------------------------------- 1 | { 2 | "status_code": 400, 3 | "error": "Need to include either a route, bbox, proximity, or origin for category searches", 4 | "version": "31:43720ce3c0535cf79cbd52268e91dca3f224933c", 5 | "code": "test-code" 6 | } 7 | -------------------------------------------------------------------------------- /MapboxSearch/place-autocomplete/src/androidTest/assets/suggestions_successful_empty_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "suggestions":[], 3 | "attribution":"© 2021 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)", 4 | "version":"55:ce8b854900df80c271126016a2dbb1b8ee9345c1", 5 | "response_uuid":"c48c9805-8d6d-459a-afbb-a9474ef28741" 6 | } 7 | -------------------------------------------------------------------------------- /MapboxSearch/place-autocomplete/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /MapboxSearch/place-autocomplete/src/test/java/com/mapbox/search/autocomplete/PlaceAutocompleteAddressTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.autocomplete 2 | 3 | import com.mapbox.search.common.tests.ToStringVerifier 4 | import nl.jqno.equalsverifier.EqualsVerifier 5 | import org.junit.jupiter.api.Test 6 | 7 | internal class PlaceAutocompleteAddressTest { 8 | 9 | @Test 10 | fun `equals() and hashCode() functions are correct`() { 11 | EqualsVerifier.forClass(PlaceAutocompleteAddress::class.java) 12 | .verify() 13 | } 14 | 15 | @Test 16 | fun `toString() function is correct`() { 17 | ToStringVerifier( 18 | clazz = PlaceAutocompleteAddress::class, 19 | includeAllProperties = false 20 | ).verify() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /MapboxSearch/sample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /MapboxSearch/sample/proguard-multidex-rules.pro: -------------------------------------------------------------------------------- 1 | -keep class com.mapbox.search.sample.** 2 | -keep class androidx.test.** -------------------------------------------------------------------------------- /MapboxSearch/sample/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /MapboxSearch/sample/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /MapboxSearch/sample/src/debug/java/com/mapbox/search/sample/DebugSampleApplication.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.sample 2 | 3 | import android.content.Context 4 | import androidx.multidex.MultiDex 5 | 6 | class DebugSampleApplication : SampleApplication() { 7 | 8 | override fun attachBaseContext(base: Context) { 9 | super.attachBaseContext(base) 10 | MultiDex.install(this) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/java/com/mapbox/search/sample/CoordinateBounds.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.sample 2 | 3 | import com.mapbox.geojson.BoundingBox 4 | import com.mapbox.maps.CoordinateBounds 5 | 6 | fun CoordinateBounds.toBoundingBox(): BoundingBox = BoundingBox.fromPoints(this.southwest, this.northeast) 7 | -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/drawable/card_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/drawable/ic_search.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/drawable/red_marker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/sample/src/main/res/drawable/red_marker.png -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/layout/route_dropdown_item.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/menu/simple_ui_activity_options_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | 16 | -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/sample/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/sample/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/sample/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/sample/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/sample/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/sample/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/sample/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/sample/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/sample/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/sample/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 15 | 16 | -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #007AFF 4 | #000000 5 | #9B9B9B 6 | #6E8BF7 7 | 8 | #FFFFFF 9 | #454545 10 | 11 | -------------------------------------------------------------------------------- /MapboxSearch/sample/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8dp 4 | 5 | -------------------------------------------------------------------------------- /MapboxSearch/sample/src/release/java/com/mapbox/search/sample/LeakCanaryConfiguration.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.sample 2 | 3 | internal object LeakCanaryConfiguration { 4 | fun apply() { 5 | // Nothing to configure for release code 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | src/main/assets/sdk_versions/com.mapbox.search.common -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/sdk-common/consumer-rules.pro -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/gradle.properties: -------------------------------------------------------------------------------- 1 | mapboxArtifactName=mapbox-search-android-common 2 | mapboxArtifactTitle=Mapbox Search SDK Common for Android 3 | mapboxArtifactDescription=Mapbox Search SDK Common for Android 4 | -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/src/main/java/com/mapbox/search/common/CompletionCallback.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common 2 | 3 | /** 4 | * Interface definition for a commonly used in the Search SDK callback 5 | * to be invoked when asynchronous operation completes. 6 | */ 7 | public interface CompletionCallback { 8 | 9 | /** 10 | * Invoked when an operation completes successfully. 11 | */ 12 | public fun onComplete(result: T) 13 | 14 | /** 15 | * Invoked when an error happened. 16 | * 17 | * @param e Exception, occurred during operation. 18 | */ 19 | public fun onError(e: Exception) 20 | } 21 | -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/src/main/java/com/mapbox/search/common/Utils.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common 2 | 3 | // https://jqno.nl/equalsverifier/errormessages/double-equals-doesnt-use-doublecompare-for-field-foo/ 4 | 5 | @JvmSynthetic 6 | internal fun Float?.safeCompareTo(other: Float?): Boolean { 7 | return when { 8 | this == null -> other == null 9 | other == null -> false 10 | else -> compareTo(other) == 0 11 | } 12 | } 13 | 14 | @JvmSynthetic 15 | internal fun Double?.safeCompareTo(other: Double?): Boolean { 16 | return when { 17 | this == null -> other == null 18 | other == null -> false 19 | else -> compareTo(other) == 0 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/src/main/java/com/mapbox/search/common/metadata/OpenPeriod.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.metadata 2 | 3 | import android.os.Parcelable 4 | import kotlinx.parcelize.Parcelize 5 | 6 | /** 7 | * Time interval, when POI is available. 8 | */ 9 | @Parcelize 10 | public data class OpenPeriod( 11 | 12 | /** 13 | * Time, when POI opens. 14 | */ 15 | public val open: WeekTimestamp, 16 | 17 | /** 18 | * Time, when POI closes. 19 | */ 20 | public val closed: WeekTimestamp 21 | ) : Parcelable 22 | -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/src/test/java/com/mapbox/search/common/BusinessDetailsTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common 2 | 3 | import com.mapbox.annotation.MapboxExperimental 4 | import com.mapbox.search.common.tests.ToStringVerifier 5 | import nl.jqno.equalsverifier.EqualsVerifier 6 | import org.junit.jupiter.api.Test 7 | 8 | @OptIn(MapboxExperimental::class) 9 | internal class BusinessDetailsTest { 10 | 11 | @Test 12 | fun `test equals(), hashCode(), toString()`() { 13 | EqualsVerifier 14 | .forClass(BusinessDetails::class.java) 15 | .verify() 16 | 17 | ToStringVerifier( 18 | clazz = BusinessDetails::class, 19 | includeAllProperties = false 20 | ).verify() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/src/test/java/com/mapbox/search/common/LocalizedTextTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common 2 | 3 | import com.mapbox.annotation.MapboxExperimental 4 | import com.mapbox.search.common.tests.ToStringVerifier 5 | import nl.jqno.equalsverifier.EqualsVerifier 6 | import org.junit.jupiter.api.Test 7 | 8 | @OptIn(MapboxExperimental::class) 9 | internal class LocalizedTextTest { 10 | 11 | @Test 12 | fun `test equals(), hashCode(), toString()`() { 13 | EqualsVerifier 14 | .forClass(LocalizedText::class.java) 15 | .verify() 16 | 17 | ToStringVerifier( 18 | clazz = LocalizedText::class, 19 | includeAllProperties = false 20 | ).verify() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/src/test/java/com/mapbox/search/common/ev/EVSETest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.ev 2 | 3 | import com.mapbox.annotation.MapboxExperimental 4 | import com.mapbox.search.common.tests.ToStringVerifier 5 | import com.mapbox.search.common.tests.withPrefabTestBoundingBox 6 | import com.mapbox.search.common.tests.withPrefabTestPoint 7 | import nl.jqno.equalsverifier.EqualsVerifier 8 | import org.junit.jupiter.api.Test 9 | 10 | @OptIn(MapboxExperimental::class) 11 | internal class EVSETest { 12 | 13 | @Test 14 | fun `test equals(), hashCode(), toString`() { 15 | EqualsVerifier 16 | .forClass(EVSE::class.java) 17 | .withPrefabTestPoint() 18 | .withPrefabTestBoundingBox() 19 | .verify() 20 | 21 | ToStringVerifier( 22 | clazz = EVSE::class, 23 | ).verify() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/src/test/java/com/mapbox/search/common/ev/EvAdditionalGeoLocationTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.ev 2 | 3 | import com.mapbox.annotation.MapboxExperimental 4 | import com.mapbox.search.common.tests.ToStringVerifier 5 | import com.mapbox.search.common.tests.withPrefabTestBoundingBox 6 | import com.mapbox.search.common.tests.withPrefabTestPoint 7 | import nl.jqno.equalsverifier.EqualsVerifier 8 | import org.junit.jupiter.api.Test 9 | 10 | @OptIn(MapboxExperimental::class) 11 | internal class EvAdditionalGeoLocationTest { 12 | 13 | @Test 14 | fun `test equals(), hashCode(), toString`() { 15 | EqualsVerifier 16 | .forClass(EvAdditionalGeoLocation::class.java) 17 | .withPrefabTestPoint() 18 | .withPrefabTestBoundingBox() 19 | .verify() 20 | 21 | ToStringVerifier( 22 | clazz = EvAdditionalGeoLocation::class, 23 | ).verify() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/src/test/java/com/mapbox/search/common/ev/EvConnectorTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.ev 2 | 3 | import com.mapbox.annotation.MapboxExperimental 4 | import com.mapbox.search.common.tests.ToStringVerifier 5 | import nl.jqno.equalsverifier.EqualsVerifier 6 | import org.junit.jupiter.api.Test 7 | 8 | @OptIn(MapboxExperimental::class) 9 | internal class EvConnectorTest { 10 | 11 | @Test 12 | fun `test equals(), hashCode(), toString()`() { 13 | EqualsVerifier 14 | .forClass(EvConnector::class.java) 15 | .verify() 16 | 17 | ToStringVerifier( 18 | clazz = EvConnector::class, 19 | includeAllProperties = false 20 | ).verify() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/src/test/java/com/mapbox/search/common/ev/EvEnergyMixTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.ev 2 | 3 | import com.mapbox.annotation.MapboxExperimental 4 | import com.mapbox.search.common.tests.ToStringVerifier 5 | import nl.jqno.equalsverifier.EqualsVerifier 6 | import org.junit.jupiter.api.Test 7 | 8 | @OptIn(MapboxExperimental::class) 9 | internal class EvEnergyMixTest { 10 | 11 | @Test 12 | fun `test equals(), hashCode(), toString`() { 13 | EqualsVerifier 14 | .forClass(EvEnergyMix::class.java) 15 | .verify() 16 | 17 | ToStringVerifier( 18 | clazz = EvEnergyMix::class, 19 | ).verify() 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/src/test/java/com/mapbox/search/common/ev/EvEnergySourceTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.ev 2 | 3 | import com.mapbox.annotation.MapboxExperimental 4 | import com.mapbox.search.common.tests.ToStringVerifier 5 | import nl.jqno.equalsverifier.EqualsVerifier 6 | import org.junit.jupiter.api.Test 7 | 8 | @OptIn(MapboxExperimental::class) 9 | internal class EvEnergySourceTest { 10 | 11 | @Test 12 | fun `test equals(), hashCode(), toString`() { 13 | EqualsVerifier 14 | .forClass(EvEnergySource::class.java) 15 | .verify() 16 | 17 | ToStringVerifier( 18 | clazz = EvEnergySource::class, 19 | ).verify() 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/src/test/java/com/mapbox/search/common/ev/EvEnvironmentalImpactTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.ev 2 | 3 | import com.mapbox.annotation.MapboxExperimental 4 | import com.mapbox.search.common.tests.ToStringVerifier 5 | import nl.jqno.equalsverifier.EqualsVerifier 6 | import org.junit.jupiter.api.Test 7 | 8 | @OptIn(MapboxExperimental::class) 9 | internal class EvEnvironmentalImpactTest { 10 | 11 | @Test 12 | fun `test equals(), hashCode(), toString`() { 13 | EqualsVerifier 14 | .forClass(EvEnvironmentalImpact::class.java) 15 | .verify() 16 | 17 | ToStringVerifier( 18 | clazz = EvEnvironmentalImpact::class, 19 | ).verify() 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/src/test/java/com/mapbox/search/common/ev/EvLocationTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.ev 2 | 3 | import com.mapbox.annotation.MapboxExperimental 4 | import com.mapbox.search.common.tests.ToStringVerifier 5 | import com.mapbox.search.common.tests.withPrefabTestBoundingBox 6 | import com.mapbox.search.common.tests.withPrefabTestPoint 7 | import nl.jqno.equalsverifier.EqualsVerifier 8 | import org.junit.jupiter.api.Test 9 | 10 | @OptIn(MapboxExperimental::class) 11 | internal class EvLocationTest { 12 | 13 | @Test 14 | fun `test equals(), hashCode(), toString`() { 15 | EqualsVerifier 16 | .forClass(EvLocation::class.java) 17 | .withPrefabTestPoint() 18 | .withPrefabTestBoundingBox() 19 | .verify() 20 | 21 | ToStringVerifier( 22 | clazz = EvLocation::class, 23 | ).verify() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/src/test/java/com/mapbox/search/common/ev/EvStatusScheduleTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.ev 2 | 3 | import com.mapbox.annotation.MapboxExperimental 4 | import com.mapbox.search.common.tests.ToStringVerifier 5 | import nl.jqno.equalsverifier.EqualsVerifier 6 | import org.junit.jupiter.api.Test 7 | 8 | @OptIn(MapboxExperimental::class) 9 | internal class EvStatusScheduleTest { 10 | 11 | @Test 12 | fun `test equals(), hashCode(), toString`() { 13 | EqualsVerifier 14 | .forClass(EvStatusSchedule::class.java) 15 | .verify() 16 | 17 | ToStringVerifier( 18 | clazz = EvStatusSchedule::class, 19 | ).verify() 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MapboxSearch/sdk-common/src/test/java/com/mapbox/search/common/ev/EvsePublishTokenTypeTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.common.ev 2 | 3 | import com.mapbox.annotation.MapboxExperimental 4 | import com.mapbox.search.common.tests.ToStringVerifier 5 | import nl.jqno.equalsverifier.EqualsVerifier 6 | import org.junit.jupiter.api.Test 7 | 8 | @OptIn(MapboxExperimental::class) 9 | internal class EvsePublishTokenTypeTest { 10 | 11 | @Test 12 | fun `test equals(), hashCode(), toString`() { 13 | EqualsVerifier 14 | .forClass(EvsePublishTokenType::class.java) 15 | .verify() 16 | 17 | ToStringVerifier( 18 | clazz = EvsePublishTokenType::class, 19 | ).verify() 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | local.properties 4 | .idea 5 | /build 6 | .externalNativeBuild 7 | app/src/main/res/values/developer-config.xml 8 | src/main/assets/sdk_versions/com.mapbox.search 9 | LICENSE_THIRDPARTY_SDK.md-validate -------------------------------------------------------------------------------- /MapboxSearch/sdk/gradle.properties: -------------------------------------------------------------------------------- 1 | mapboxArtifactName=mapbox-search-android 2 | mapboxArtifactTitle=Mapbox Search SDK for Android 3 | mapboxArtifactDescription=Mapbox Search SDK for Android 4 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/proguard/consumer-proguard-sdk.txt: -------------------------------------------------------------------------------- 1 | # SDK Data Access Object classes 2 | -keepclassmembers,allowoptimization class * implements com.mapbox.search.utils.serialization.DataAccessObject { 3 | (); 4 | } 5 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 9 | 10 | 13 | 14 | 19 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/sbs_responses/category/successful_empty_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "type":"FeatureCollection", 3 | "features":[ 4 | ], 5 | "attribution":"© 2021 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)", 6 | "version":"46:a4b40e46f08bf603328aace583b2e0d6db4eb851", 7 | "response_uuid":"544304d0-2007-4354-a599-c522cb150bb0" 8 | } 9 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/sbs_responses/category/successful_incorrect_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "type":"FeatureCollection", 3 | "features":[ 4 | { 5 | } 6 | ], 7 | "attribution":"© 2021 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)", 8 | "version":"46:a4b40e46f08bf603328aace583b2e0d6db4eb851", 9 | "response_uuid":"544304d0-2007-4354-a599-c522cb150bb0" 10 | } 11 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/sbs_responses/retrieve-no-results.json: -------------------------------------------------------------------------------- 1 | { 2 | "type":"FeatureCollection", 3 | "features":[], 4 | "attribution":"© 2021 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)", 5 | "version":"402:ce31a6077170d052bf3236c45f63abf02db4b542", 6 | "response_uuid":"0a197057-edf0-4447-be63-9badcf7c19be" 7 | } -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/sbs_responses/reverse_geocoding/successful_empty_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "type":"FeatureCollection", 3 | "features":[ 4 | ], 5 | "attribution":"© 2021 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)", 6 | "version":"46:a4b40e46f08bf603328aace583b2e0d6db4eb851", 7 | "response_uuid":"4fb99f9a-9615-4e34-9408-d71d613e606c" 8 | } 9 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/sbs_responses/suggestions-error-response-extended-format.json: -------------------------------------------------------------------------------- 1 | { 2 | "status_code": 400, 3 | "error": "Need to include either a route, bbox, proximity, or origin for category searches", 4 | "version": "31:43720ce3c0535cf79cbd52268e91dca3f224933c", 5 | "code": "test-code" 6 | } 7 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/sbs_responses/suggestions-error-response-simple-format.json: -------------------------------------------------------------------------------- 1 | { 2 | "message": "Wrong arguments" 3 | } 4 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/sbs_responses/suggestions-successful-empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "suggestions":[ 3 | ], 4 | "attribution":"© 2021 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)", 5 | "version":"12:9476295bf0515457bd2a576af2b1d06d3bf42a57" 6 | } 7 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/sbs_responses/suggestions-successful-incorrect-for-minsk.json: -------------------------------------------------------------------------------- 1 | { 2 | "suggestions":[ 3 | { 4 | } 5 | ], 6 | "attribution":"© 2021 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)", 7 | "version":"12:9476295bf0515457bd2a576af2b1d06d3bf42a57" 8 | } 9 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/screenshots/compressed_screenshot_400-90.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/sdk/src/androidTest/assets/screenshots/compressed_screenshot_400-90.jpeg -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/screenshots/original_screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/sdk/src/androidTest/assets/screenshots/original_screenshot.png -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/search-event-unknown.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "search.event.unknown" 3 | } 4 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/search-feedback-event-empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "search.feedback" 3 | } 4 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/search-query-change-event-empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "search.query_change" 3 | } 4 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/search-select-event-empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "search.select" 3 | } 4 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/search-start-event-empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "event": "search.start" 3 | } 4 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/search_box_responses/category/successful_empty_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "features": [ 4 | ], 5 | "attribution": "© 2023 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)" 6 | } 7 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/search_box_responses/category/successful_incorrect_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "features": [ 4 | { 5 | } 6 | ], 7 | "attribution": "© 2021 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)", 8 | "version": "46:a4b40e46f08bf603328aace583b2e0d6db4eb851", 9 | "response_uuid": "544304d0-2007-4354-a599-c522cb150bb0" 10 | } 11 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/search_box_responses/forward/suggestions-successful-empty.json: -------------------------------------------------------------------------------- 1 | { 2 | "suggestions": [ 3 | ], 4 | "attribution": "© 2023 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)" 5 | } 6 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/search_box_responses/forward/suggestions-successful-incorrect.json: -------------------------------------------------------------------------------- 1 | { 2 | "suggestions": [ 3 | { 4 | } 5 | ], 6 | "attribution": "© 2023 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)" 7 | } 8 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/search_box_responses/reverse_geocoding/successful_empty_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "features": [ 4 | ], 5 | "attribution": "© 2023 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)" 6 | } 7 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/search_box_responses/suggestions-error-response-extended-format.json: -------------------------------------------------------------------------------- 1 | { 2 | "status_code": 400, 3 | "error": "Need to include either a route, bbox, proximity, or origin for category searches", 4 | "version": "31:43720ce3c0535cf79cbd52268e91dca3f224933c", 5 | "code": "test-code" 6 | } 7 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/search_box_responses/suggestions-error-response-simple-format.json: -------------------------------------------------------------------------------- 1 | { 2 | "message": "Wrong arguments" 3 | } 4 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/test_data_favorites_incorrect.json: -------------------------------------------------------------------------------- 1 | { 2 | "records": [ 3 | { 4 | "id": "empty_correct_record_id", 5 | "name": "Empty correct record", 6 | "coordinate": [ 7 | 0.0, 8 | 0.1 9 | ], 10 | "searchResultType": "POI" 11 | }, 12 | { 13 | "id": "record_with_unknown_type", 14 | "name": "Record with incorrect type", 15 | "coordinate": [ 16 | 0.0, 17 | 0.1 18 | ], 19 | "searchResultType": "UNKNOWN_TYPE" 20 | }, 21 | { 22 | "id": "record_without_coordinate", 23 | "name": "Record without coordinate", 24 | "searchResultType": "POI" 25 | }, 26 | { 27 | } 28 | ], 29 | "version": 0 30 | } 31 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/test_data_search_history_incorrect.json: -------------------------------------------------------------------------------- 1 | { 2 | "records": [ 3 | { 4 | "id": "empty_correct_record_id", 5 | "name": "Empty correct record", 6 | "timestamp": 123, 7 | "searchResultType": "POI", 8 | "coordinate":[10.0,20.0] 9 | }, 10 | { 11 | "id": "record_with_incorrect_result_type", 12 | "name": "Record with incorrect searchResultType", 13 | "timestamp": 123, 14 | "searchResultType": "UNKNOWN_TYPE" 15 | }, 16 | { 17 | "name": "Record without id", 18 | "timestamp": 123, 19 | "searchResultType": "POI" 20 | }, 21 | { 22 | } 23 | ], 24 | "version": 0 25 | } 26 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/assets/test_data_search_history_incorrect_json_format.json: -------------------------------------------------------------------------------- 1 | { 2 | "records": [ 3 | { 4 | "coordinate": [ 5 | 2.295135021209717, 6 | 48.859291076660156 7 | ], 8 | "id": "poi.609885454495", 9 | "name": "Eiffel Tower", 10 | "searchResultType": "POI", 11 | "timestamp": 1598138435443 12 | }, 13 | { 14 | "address": "address", 15 | "coordinate": [ 16 | -3.6922054290771484, 17 | 40.41393280029297 18 | ], 19 | "id": "poi.979252559345", 20 | "name": "Museo del Prado", 21 | "searchResultType": "ADDRESS", 22 | "timestamp": 1598138865525 23 | } 24 | ], 25 | "version": 0 26 | } 27 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/result/SearchResultGsonSerializationTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.result 2 | 3 | import com.google.gson.Gson 4 | import com.mapbox.search.tests_support.createTestSearchResult 5 | import com.mapbox.search.tests_support.createTestSearchSuggestion 6 | import org.junit.Assert.assertTrue 7 | import org.junit.Test 8 | 9 | internal class SearchResultGsonSerializationTest { 10 | 11 | private val gson = Gson() 12 | 13 | @Test 14 | fun searchSuggestionTest() { 15 | testObjectSerialization(createTestSearchSuggestion()) 16 | } 17 | 18 | @Test 19 | fun searchResultTest() { 20 | testObjectSerialization(createTestSearchResult()) 21 | } 22 | 23 | private fun testObjectSerialization(obj: Any) { 24 | val json = gson.toJson(obj) 25 | // Just check for non-emptiness, and no crashes during serialization 26 | assertTrue(json.isNotEmpty()) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/result/SearchResultParcelizationTest.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.result 2 | 3 | import com.mapbox.search.tests_support.createTestSearchResult 4 | import com.mapbox.search.tests_support.createTestSearchSuggestion 5 | import com.mapbox.search.utils.assertEqualsButNotSame 6 | import com.mapbox.search.utils.cloneFromParcel 7 | import org.junit.Test 8 | 9 | internal class SearchResultParcelizationTest { 10 | 11 | @Test 12 | fun searchSuggestionTest() { 13 | val suggestion = createTestSearchSuggestion() 14 | val clonedSuggestion = suggestion.cloneFromParcel() 15 | assertEqualsButNotSame(suggestion, clonedSuggestion) 16 | } 17 | 18 | @Test 19 | fun searchResultTest() { 20 | val result = createTestSearchResult() 21 | val clonedEvent = result.cloneFromParcel() 22 | assertEqualsButNotSame(result, clonedEvent) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/tests_support/EmptySearchCallback.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.tests_support 2 | 3 | import com.mapbox.search.ResponseInfo 4 | import com.mapbox.search.SearchCallback 5 | import com.mapbox.search.result.SearchResult 6 | 7 | internal object EmptySearchCallback : SearchCallback { 8 | override fun onResults(results: List, responseInfo: ResponseInfo) { 9 | // no op 10 | } 11 | 12 | override fun onError(e: Exception) { 13 | // no op 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/tests_support/EmptySearchSuggestionsCallback.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.tests_support 2 | 3 | import com.mapbox.search.ResponseInfo 4 | import com.mapbox.search.SearchSuggestionsCallback 5 | import com.mapbox.search.result.SearchSuggestion 6 | 7 | internal object EmptySearchSuggestionsCallback : SearchSuggestionsCallback { 8 | override fun onSuggestions(suggestions: List, responseInfo: ResponseInfo) { 9 | // no op 10 | } 11 | 12 | override fun onError(e: Exception) { 13 | // no op 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/tests_support/record/StubRecordsStorage.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.tests_support.record 2 | 3 | import com.mapbox.search.record.IndexableRecord 4 | import com.mapbox.search.record.RecordsStorage 5 | 6 | internal class StubRecordsStorage( 7 | records: List = emptyList() 8 | ) : RecordsStorage { 9 | 10 | val records: MutableList = records.toMutableList() 11 | 12 | override fun load(): List { 13 | return records 14 | } 15 | 16 | override fun save(records: List) { 17 | this.records.clear() 18 | this.records.addAll(records) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/tests_support/rules/IgnoreTestsRule.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.tests_support.rules 2 | 3 | import org.junit.Assume 4 | import org.junit.rules.TestRule 5 | import org.junit.runner.Description 6 | import org.junit.runners.model.Statement 7 | 8 | internal class IgnoreTestsRule(private val ignoreAllTests: Boolean) : TestRule { 9 | 10 | override fun apply(base: Statement, description: Description): Statement { 11 | return IgnorableStatement(base, ignoreAllTests) 12 | } 13 | 14 | private inner class IgnorableStatement(private val base: Statement, private val ignoreAllTests: Boolean) : Statement() { 15 | override fun evaluate() { 16 | Assume.assumeTrue("Test ignored", !ignoreAllTests) 17 | base.evaluate() 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/utils/Assert.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.utils 2 | 3 | import org.junit.Assert 4 | import java.util.Locale 5 | 6 | internal fun assertEqualsButNotSame(expected: Any?, actual: Any?) { 7 | Assert.assertNotSame(expected, actual) 8 | Assert.assertEquals(expected, actual) 9 | } 10 | 11 | internal fun assertEqualsIgnoreCase(expected: String, actual: String) { 12 | Assert.assertEquals(expected.lowercase(Locale.getDefault()), actual.lowercase(Locale.getDefault())) 13 | } 14 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/utils/Formatting.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.utils 2 | 3 | internal fun String.removeJsonPrettyPrinting(): String { 4 | return replace("\\s\\s+".toRegex(), "") 5 | .replace(": ", ":") 6 | .replace("\n", "") 7 | } 8 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/androidTest/java/com/mapbox/search/utils/MockWebServer.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.utils 2 | 3 | import okhttp3.mockwebserver.MockResponse 4 | import okhttp3.mockwebserver.MockWebServer 5 | 6 | internal fun MockWebServer.enqueueMultiple(response: MockResponse, times: Int) { 7 | repeat(times) { 8 | enqueue(response) 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 15 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/main/java/com/mapbox/search/MapboxSearchSdkInitializer.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search 2 | 3 | import com.mapbox.common.BaseMapboxInitializer 4 | 5 | internal class MapboxSearchSdkInitializer : BaseMapboxInitializer() { 6 | override val initializerClass = MapboxSearchSdkInitializerImpl::class.java 7 | } 8 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/main/java/com/mapbox/search/MapboxSearchSdkInitializerImpl.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search 2 | 3 | import android.app.Application 4 | import android.content.Context 5 | import androidx.startup.Initializer 6 | import com.mapbox.search.base.BaseSearchSdkInitializerImpl 7 | 8 | internal class MapboxSearchSdkInitializerImpl : Initializer { 9 | override fun create(context: Context): MapboxSearchSdk { 10 | MapboxSearchSdk.initialize(context.applicationContext as Application) 11 | return MapboxSearchSdk 12 | } 13 | 14 | override fun dependencies(): List>> { 15 | return listOf(BaseSearchSdkInitializerImpl::class.java) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/main/java/com/mapbox/search/Reserved.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search 2 | 3 | /** 4 | * Special annotation for marking properties/functions/classes as reserved for internal 5 | * or special use. 6 | * 7 | * @param flags list of flags, that indicates particular sets of restricted functionality. 8 | */ 9 | internal annotation class Reserved(vararg val flags: Flags) { 10 | 11 | enum class Flags { 12 | 13 | /** 14 | * Functionality related to [Single Box Search][ApiType.SBS]. 15 | */ 16 | SBS, 17 | 18 | /** 19 | * Functionality related to [Search Box Search][ApiType.SEARCH_BOX]. 20 | */ 21 | SEARCH_BOX, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/main/java/com/mapbox/search/ViewportProvider.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search 2 | 3 | import com.mapbox.geojson.BoundingBox 4 | 5 | /** 6 | * Provides map viewport, if you have map in your application. 7 | */ 8 | public fun interface ViewportProvider { 9 | 10 | /** 11 | * This method will be called in the following cases: 12 | * 1) Search engine requests the map's viewport visible to a user. 13 | * Provided viewport will be used as a bounding box for upcoming search request, if 14 | * [SearchOptions.boundingBox] or [CategorySearchOptions.boundingBox] aren't specified. 15 | * 2) [com.mapbox.search.analytics.AnalyticsService] requests the map's viewport visible to a user. 16 | * Provided viewport will be used for better and more accurate analytics data. 17 | * 18 | * @return Bounding box for current map viewport or null. 19 | */ 20 | public fun getViewport(): BoundingBox? 21 | } 22 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/main/java/com/mapbox/search/adapter/BaseSearchCallbackAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.adapter 2 | 3 | import com.mapbox.search.SearchCallback 4 | import com.mapbox.search.base.BaseResponseInfo 5 | import com.mapbox.search.base.BaseSearchCallback 6 | import com.mapbox.search.base.result.BaseSearchResult 7 | import com.mapbox.search.mapToPlatform 8 | import com.mapbox.search.result.SearchResult 9 | 10 | internal class BaseSearchCallbackAdapter(private val callback: SearchCallback) : BaseSearchCallback { 11 | override fun onResults(results: List, responseInfo: BaseResponseInfo) { 12 | callback.onResults(results.map { SearchResult(it) }, responseInfo.mapToPlatform()) 13 | } 14 | 15 | override fun onError(e: Exception) { 16 | callback.onError(e) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/main/java/com/mapbox/search/analytics/events/AppMetadata.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.analytics.events 2 | 3 | import android.os.Parcelable 4 | import com.google.gson.annotations.SerializedName 5 | import kotlinx.parcelize.Parcelize 6 | 7 | @Parcelize 8 | internal data class AppMetadata( 9 | @SerializedName("name") var name: String? = null, 10 | @SerializedName("version") var version: String? = null, 11 | @SerializedName("userId") var userId: String? = null, 12 | @SerializedName("sessionId") var sessionId: String? = null 13 | ) : Parcelable { 14 | 15 | val isValid: Boolean 16 | get() = name.run { this == null || length > 1 } && 17 | version.run { this == null || length > 1 } 18 | } 19 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/main/java/com/mapbox/search/analytics/events/SearchResultEntry.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.analytics.events 2 | 3 | import android.os.Parcelable 4 | import com.google.gson.annotations.SerializedName 5 | import kotlinx.parcelize.Parcelize 6 | 7 | @Parcelize 8 | internal data class SearchResultEntry( 9 | @SerializedName("name") var name: String? = null, 10 | @SerializedName("address") var address: String? = null, 11 | @SerializedName("coordinates") var coordinates: List? = null, 12 | @SerializedName("id") var id: String? = null, 13 | @SerializedName("language") var language: List? = null, 14 | @SerializedName("result_type") var types: List? = null, 15 | @SerializedName("external_ids") var externalIDs: Map? = null, 16 | @SerializedName("category") var category: List? = null, 17 | ) : Parcelable 18 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/main/java/com/mapbox/search/analytics/events/SearchResultsInfo.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.analytics.events 2 | 3 | import android.os.Parcelable 4 | import com.google.gson.annotations.SerializedName 5 | import kotlinx.parcelize.Parcelize 6 | 7 | @Parcelize 8 | internal data class SearchResultsInfo( 9 | @SerializedName("results") var results: List? = null, 10 | @SerializedName("multiStepSearch") var multiStepSearch: Boolean? = null, 11 | ) : Parcelable 12 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/main/java/com/mapbox/search/utils/LoggingCompletionCallback.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.utils 2 | 3 | import com.mapbox.search.base.logger.logd 4 | import com.mapbox.search.common.CompletionCallback 5 | 6 | internal class LoggingCompletionCallback(private val operationName: String) : CompletionCallback { 7 | override fun onComplete(result: Unit) { 8 | logd("$operationName completed") 9 | } 10 | 11 | override fun onError(e: Exception) { 12 | logd("$operationName error: ${e.message}") 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/main/java/com/mapbox/search/utils/bitmap/BitmapEncodeOptions.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.utils.bitmap 2 | 3 | import androidx.annotation.IntRange 4 | 5 | internal data class BitmapEncodeOptions( 6 | @IntRange(from = 1) val minSideSize: Int, 7 | @IntRange(from = 0, to = 100) val compressQuality: Int 8 | ) { 9 | init { 10 | check(minSideSize > 0) { "minSideSize should be greater than 0!" } 11 | check(compressQuality in 0..100) { "Compress quality should be in [0..100] range!" } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/main/java/com/mapbox/search/utils/file/FileSystem.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.utils.file 2 | 3 | import android.content.Context 4 | import androidx.annotation.WorkerThread 5 | import java.io.File 6 | 7 | @WorkerThread 8 | internal interface FileSystem { 9 | 10 | fun getAbsoluteDir(absoluteDir: String): File 11 | 12 | fun getAppRelativeDir(context: Context, relativeDir: String): File 13 | 14 | fun createFile(pathName: String): File 15 | 16 | fun createFile(parent: File, child: String): File 17 | } 18 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/main/java/com/mapbox/search/utils/loader/DataLoader.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.utils.loader 2 | 3 | import androidx.annotation.WorkerThread 4 | 5 | @WorkerThread 6 | internal interface DataLoader { 7 | 8 | fun load(relativeDir: String, fileName: String): T 9 | 10 | fun save(relativeDir: String, fileName: String, data: T) 11 | } 12 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/main/java/com/mapbox/search/utils/serialization/DataAccessObject.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.utils.serialization 2 | 3 | internal interface DataAccessObject { 4 | 5 | val isValid: Boolean 6 | 7 | fun createData(): T 8 | } 9 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/test/java/com/mapbox/search/tests_support/EqualsVerifier.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.tests_support 2 | 3 | import com.mapbox.search.base.result.BaseRawSearchResult 4 | import nl.jqno.equalsverifier.api.SingleTypeEqualsVerifierApi 5 | 6 | internal fun SingleTypeEqualsVerifierApi.withPrefabTestBaseRawSearchResult( 7 | red: BaseRawSearchResult = createTestBaseRawSearchResult(id = "test-result-1"), 8 | blue: BaseRawSearchResult = createTestBaseRawSearchResult(id = "test-result-2") 9 | ): SingleTypeEqualsVerifierApi { 10 | return withPrefabValues(BaseRawSearchResult::class.java, red, blue) 11 | } 12 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/test/java/com/mapbox/search/tests_support/SearchAddress.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.tests_support 2 | 3 | import com.mapbox.search.result.SearchAddress 4 | 5 | internal fun SearchAddress.toStringFull(): String { 6 | return "SearchAddress(houseNumber=$houseNumber, street=$street, neighborhood=$neighborhood, locality=$locality, postcode=$postcode, place=$place, district=$district, region=$region, country=$country)" 7 | } 8 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/test/java/com/mapbox/search/tests_support/TestMainThreadWorker.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.tests_support 2 | 3 | import com.mapbox.search.common.concurrent.MainThreadWorker 4 | import java.util.concurrent.Executor 5 | import java.util.concurrent.TimeUnit 6 | 7 | internal class TestMainThreadWorker : MainThreadWorker { 8 | 9 | override val isMainThread: Boolean 10 | get() = true 11 | 12 | override var mainExecutor: Executor = Executor { runnable -> 13 | runnable.run() 14 | } 15 | 16 | override fun post(runnable: Runnable) { 17 | runnable.run() 18 | } 19 | 20 | override fun postDelayed(delay: Long, unit: TimeUnit, runnable: Runnable) { 21 | post(runnable) 22 | } 23 | 24 | override fun cancel(runnable: Runnable) { 25 | // Do nothing 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /MapboxSearch/sdk/src/test/java/com/mapbox/search/tests_support/record/StubRecordsStorage.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.tests_support.record 2 | 3 | import com.mapbox.search.record.IndexableRecord 4 | import com.mapbox.search.record.RecordsStorage 5 | 6 | internal class StubRecordsStorage( 7 | records: List = emptyList() 8 | ) : RecordsStorage { 9 | 10 | val records: MutableList = records.toMutableList() 11 | 12 | override fun load(): List { 13 | return records 14 | } 15 | 16 | override fun save(records: List) { 17 | this.records.clear() 18 | this.records.addAll(records) 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MapboxSearch/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | gradlePluginPortal() 4 | } 5 | } 6 | 7 | include ':custom-detekt-rules' 8 | include ':common-tests' 9 | // For more info check https://github.com/mapbox/mapbox-search-android#notes-about-japicmp-usage 10 | // include ':gradle:japicmp' 11 | include ':sdk', ':ui', ':offline', ':autofill', ':discover', ':place-autocomplete', ':sdk-common', ':base', ':sample' 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | src/main/assets/sdk_versions/com.mapbox.search.ui 3 | LICENSE_THIRDPARTY_SDK_UI.md-validate -------------------------------------------------------------------------------- /MapboxSearch/ui/gradle.properties: -------------------------------------------------------------------------------- 1 | mapboxArtifactName=mapbox-search-android-ui 2 | mapboxArtifactTitle=Mapbox Search UI SDK for Android 3 | mapboxArtifactDescription=Mapbox Search UI SDK for Android 4 | -------------------------------------------------------------------------------- /MapboxSearch/ui/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /MapboxSearch/ui/proguard/consumer-proguard-ui.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-search-android/2fbaafd157fada7f57c360155b61149188f96a02/MapboxSearch/ui/proguard/consumer-proguard-ui.txt -------------------------------------------------------------------------------- /MapboxSearch/ui/src/androidTest/assets/suggestions-successful-empty-results.json: -------------------------------------------------------------------------------- 1 | { 2 | "suggestions": [], 3 | "attribution": "© 2021 Mapbox and its suppliers. All rights reserved. Use of this data is subject to the Mapbox Terms of Service. (https://www.mapbox.com/about/maps/)", 4 | "version": "44:9d58434d7f88e4515b1edfbad545cc8c527e303f", 5 | "response_uuid": "d36a7cdc-39c7-4173-b762-7058fc42f5b1" 6 | } -------------------------------------------------------------------------------- /MapboxSearch/ui/src/androidTest/java/com/mapbox/search/ui/extensions/Builders.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.extensions 2 | 3 | import com.mapbox.search.ui.robots.builders.SearchResultsRecyclerBuilder 4 | 5 | internal fun SearchResultsRecyclerBuilder.noInternetConnectionError() { 6 | error( 7 | errorTitle = "No internet connection", 8 | errorSubtitle = "You’re offline. Try to reconnect." 9 | ) 10 | } 11 | 12 | internal fun SearchResultsRecyclerBuilder.unknownError() { 13 | error( 14 | errorTitle = "Error", 15 | errorSubtitle = "Something went wrong." 16 | ) 17 | } 18 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/androidTest/java/com/mapbox/search/ui/extensions/MockWebServer.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.extensions 2 | 3 | import okhttp3.mockwebserver.MockResponse 4 | import okhttp3.mockwebserver.MockWebServer 5 | 6 | internal fun MockWebServer.enqueue(firstResponse: MockResponse, vararg responses: MockResponse) { 7 | enqueue(firstResponse) 8 | responses.forEach { mockResponse -> 9 | enqueue(mockResponse) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/androidTest/java/com/mapbox/search/ui/robots/RobotDsl.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.robots 2 | 3 | @DslMarker 4 | internal annotation class RobotDsl 5 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/androidTest/java/com/mapbox/search/ui/tools/actions/ClickSearchResultItemPopulateButton.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.tools.actions 2 | 3 | import android.view.View 4 | import android.widget.ImageView 5 | import androidx.test.espresso.UiController 6 | import androidx.test.espresso.ViewAction 7 | import androidx.test.espresso.matcher.ViewMatchers 8 | import com.mapbox.search.ui.R 9 | import org.hamcrest.Matcher 10 | 11 | internal class ClickSearchResultItemPopulateButton : ViewAction { 12 | 13 | override fun getDescription() = "Search result item populate button click" 14 | 15 | override fun getConstraints(): Matcher { 16 | return ViewMatchers.withId(R.id.search_result_item) 17 | } 18 | 19 | override fun perform(uiController: UiController?, view: View) { 20 | view.findViewById(R.id.result_populate)?.callOnClick() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/androidTest/java/com/mapbox/search/ui/tools/matchers/RecentSearchesMatcher.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.tools.matchers 2 | 3 | import android.view.View 4 | import android.widget.TextView 5 | import com.mapbox.search.ui.R 6 | import org.hamcrest.Description 7 | import org.hamcrest.TypeSafeMatcher 8 | 9 | internal class RecentSearchesMatcher : TypeSafeMatcher() { 10 | 11 | override fun describeTo(description: Description) { 12 | description.appendText("Matcher for \"RECENT SEARCHES\" title") 13 | } 14 | 15 | override fun matchesSafely(item: View?): Boolean { 16 | val uiHistoryName = item?.findViewById(R.id.history_item)?.text?.toString() 17 | return uiHistoryName == "Recent searches" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/androidTest/java/com/mapbox/search/ui/tools/matchers/SingleViewIdMatcher.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.tools.matchers 2 | 3 | import android.view.View 4 | import androidx.annotation.IdRes 5 | import org.hamcrest.Description 6 | import org.hamcrest.TypeSafeMatcher 7 | 8 | internal class SingleViewIdMatcher( 9 | @IdRes private val viewId: Int, 10 | private val matcherDescription: String 11 | ) : TypeSafeMatcher() { 12 | 13 | override fun describeTo(description: Description) { 14 | description.appendText(matcherDescription) 15 | } 16 | 17 | override fun matchesSafely(item: View?): Boolean { 18 | return item?.id == viewId 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/androidTest/res/menu/test_activity_menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | 16 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/androidTest/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #007AFF 4 | #000000 5 | #9B9B9B 6 | #6E8BF7 7 | 8 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/java/com/mapbox/search/ui/adapter/location/LocationObservationTimeoutSetter.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.adapter.location 2 | 3 | import com.mapbox.search.base.location.LocationObservationProperties 4 | 5 | /** 6 | * Sets location observation timeout for LocationEngineAdapter 7 | * @param timeout in mls, if null - timeout is not used 8 | */ 9 | public fun setLocationObservationTimeout(timeout: Long?) { 10 | LocationObservationProperties.locationObservationTimeout = timeout 11 | } 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/java/com/mapbox/search/ui/utils/BottomSheetBehaviorCallbackAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.utils 2 | 3 | import android.view.View 4 | import com.google.android.material.bottomsheet.BottomSheetBehavior 5 | 6 | internal open class BottomSheetBehaviorCallbackAdapter : BottomSheetBehavior.BottomSheetCallback() { 7 | override fun onSlide(bottomSheet: View, slideOffset: Float) { 8 | // Nothing to do by default 9 | } 10 | 11 | override fun onStateChanged(bottomSheet: View, @BottomSheetBehavior.State newState: Int) { 12 | // Nothing to do by default 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/java/com/mapbox/search/ui/utils/StringToLongIdMapper.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.utils 2 | 3 | internal class StringToLongIdMapper { 4 | 5 | private val map = mutableMapOf() 6 | private var currentId = 0L 7 | 8 | fun getId(string: String): Long { 9 | return map.getOrPut(string) { 10 | currentId++ 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/java/com/mapbox/search/ui/utils/ThemePatcher.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.utils 2 | 3 | import android.content.Context 4 | import androidx.appcompat.view.ContextThemeWrapper 5 | import com.mapbox.search.ui.R 6 | import com.mapbox.search.ui.utils.extenstion.resolveAttr 7 | 8 | private class SearchSdkContextThemeWrapper(context: Context) : ContextThemeWrapper( 9 | context, 10 | context.resolveAttr( 11 | R.attr.mapboxSearchSdkTheme, 12 | R.style.MapboxSearchSdk_Theme_Auto 13 | ) 14 | ) 15 | 16 | internal fun wrapWithSearchTheme(context: Context): Context { 17 | return if (context is SearchSdkContextThemeWrapper) { 18 | context 19 | } else { 20 | SearchSdkContextThemeWrapper(context) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/java/com/mapbox/search/ui/utils/adapter/BaseRecyclerViewAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.utils.adapter 2 | 3 | import androidx.annotation.Keep 4 | import androidx.recyclerview.widget.RecyclerView 5 | 6 | internal abstract class BaseRecyclerViewAdapter : RecyclerView.Adapter() { 7 | 8 | @get:Keep 9 | var items: List = emptyList() 10 | set(value) { 11 | field = value 12 | notifyDataSetChanged() 13 | } 14 | 15 | override fun getItemCount() = items.size 16 | 17 | fun clearItems() { 18 | items = emptyList() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/java/com/mapbox/search/ui/utils/extenstion/Drawable.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.utils.extenstion 2 | 3 | import android.graphics.PorterDuff 4 | import android.graphics.PorterDuffColorFilter 5 | import android.graphics.drawable.Drawable 6 | import android.os.Build 7 | import androidx.annotation.ColorInt 8 | import androidx.core.graphics.drawable.DrawableCompat 9 | 10 | internal fun Drawable.setTintCompat(@ColorInt color: Int, mode: PorterDuff.Mode = PorterDuff.Mode.SRC_IN): Drawable { 11 | return if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) { 12 | DrawableCompat.wrap(this).mutate().apply { 13 | DrawableCompat.setTintMode(this, mode) 14 | DrawableCompat.setTint(this, color) 15 | } 16 | } else { 17 | mutate().apply { 18 | colorFilter = PorterDuffColorFilter(color, mode) 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/java/com/mapbox/search/ui/utils/extenstion/Locale.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.utils.extenstion 2 | 3 | import android.view.View 4 | import androidx.core.text.layoutDirection 5 | import java.util.Locale 6 | 7 | internal val isLayoutDirectionLtr: Boolean 8 | get() = Locale.getDefault().layoutDirection == View.LAYOUT_DIRECTION_LTR 9 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/java/com/mapbox/search/ui/utils/offline/OfflineSearchAddress.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.utils.offline 2 | 3 | import com.mapbox.search.offline.OfflineSearchAddress 4 | import com.mapbox.search.result.SearchAddress 5 | 6 | @JvmSynthetic 7 | internal fun OfflineSearchAddress.mapToSdkSearchResultType(): SearchAddress { 8 | return SearchAddress( 9 | houseNumber = houseNumber, 10 | street = street, 11 | neighborhood = neighborhood, 12 | locality = locality, 13 | postcode = null, 14 | place = place, 15 | district = null, 16 | region = region, 17 | country = country 18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/java/com/mapbox/search/ui/utils/offline/OfflineSearchResultType.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.utils.offline 2 | 3 | import com.mapbox.search.base.failDebug 4 | import com.mapbox.search.offline.NewOfflineSearchResultType 5 | import com.mapbox.search.result.SearchResultType 6 | 7 | internal fun createSearchResultTypeFromOfflineType(@NewOfflineSearchResultType.Type type: String): SearchResultType { 8 | return when (type) { 9 | NewOfflineSearchResultType.PLACE -> SearchResultType.PLACE 10 | NewOfflineSearchResultType.STREET -> SearchResultType.STREET 11 | NewOfflineSearchResultType.ADDRESS -> SearchResultType.ADDRESS 12 | NewOfflineSearchResultType.POI -> SearchResultType.POI 13 | else -> { 14 | failDebug { 15 | "Unprocessed offline search result type: $type" 16 | } 17 | SearchResultType.ADDRESS 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/java/com/mapbox/search/ui/view/CommonSearchViewConfiguration.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.view 2 | 3 | import android.os.Parcelable 4 | import kotlinx.parcelize.Parcelize 5 | import java.util.Locale 6 | 7 | /** 8 | * Common configuration options used for Search SDK views. 9 | */ 10 | @Parcelize 11 | public class CommonSearchViewConfiguration( 12 | 13 | /** 14 | * [DistanceUnitType] used in the view. By default unit type is determined from the current locale. 15 | */ 16 | public val distanceUnitType: DistanceUnitType = DistanceUnitType.getFromLocale(Locale.getDefault()), 17 | ) : Parcelable 18 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/java/com/mapbox/search/ui/view/GlobalViewPreferences.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.view 2 | 3 | import com.mapbox.search.SearchOptions 4 | 5 | internal object GlobalViewPreferences { 6 | 7 | const val DEFAULT_CLICK_DEBOUNCE_MILLIS = 300L 8 | const val DEFAULT_REQUESTS_DEBOUNCE_MILLIS = 300 9 | const val SEARCH_LIMIT = 10 10 | 11 | val DEFAULT_SEARCH_OPTIONS = SearchOptions( 12 | limit = SEARCH_LIMIT, 13 | requestDebounce = DEFAULT_REQUESTS_DEBOUNCE_MILLIS 14 | ) 15 | } 16 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/java/com/mapbox/search/ui/view/SearchMode.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.view 2 | 3 | import com.mapbox.common.ReachabilityInterface 4 | 5 | /** 6 | * Enum that represents search mode. 7 | */ 8 | public enum class SearchMode { 9 | 10 | /** 11 | * Online more. 12 | */ 13 | ONLINE, 14 | 15 | /** 16 | * Offline mode. 17 | */ 18 | OFFLINE, 19 | 20 | /** 21 | * Determined automatically based on the device's network reachability. 22 | */ 23 | AUTO; 24 | 25 | internal fun isOnlineSearch(reachabilityInterface: ReachabilityInterface): Boolean { 26 | return when (this) { 27 | ONLINE -> true 28 | OFFLINE -> false 29 | AUTO -> reachabilityInterface.isReachable 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/java/com/mapbox/search/ui/view/adapter/SearchLoadingViewHolder.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.search.ui.view.adapter 2 | 3 | import android.view.ViewGroup 4 | import com.mapbox.search.ui.R 5 | import com.mapbox.search.ui.utils.adapter.BaseViewHolder 6 | import com.mapbox.search.ui.view.SearchResultAdapterItem 7 | 8 | internal class SearchLoadingViewHolder(parent: ViewGroup) : BaseViewHolder( 9 | parent, R.layout.mapbox_search_sdk_loading_item_layout 10 | ) { 11 | override fun bind(item: SearchResultAdapterItem.Loading) { 12 | // Nothing to bind 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_close_drawable.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_add_favorite.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_added_to_favorites.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_category_atm.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 16 | 17 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_category_clothing_store.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_category_hospital.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_category_hotel.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_category_restaurant.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_error.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_favorite_uncategorized.xml: -------------------------------------------------------------------------------- 1 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_history.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_airport.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_blood_bank.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_building_alt1.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_campsite.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_circle.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_circle_stroked.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_clothing_store.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_commercial.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_farm.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_fire_station.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_fitness_centre.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_heart.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_industry.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_marker.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_monument.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_ranger_station.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_religious_christian.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_religious_jewish.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_roadblock.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_shelter.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_square.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_square_stroked.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_star.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_town_hall.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_triangle.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_triangle_stroked.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_maki_water.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_mdi_search.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_navigate_to.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_populate.xml: -------------------------------------------------------------------------------- 1 | 7 | 14 | 21 | 22 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_search_result_address.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_ic_search_result_place.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_list_divider.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_primary_button_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/drawable/mapbox_search_sdk_search_view_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/layout/mapbox_search_sdk_error_item_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/layout/mapbox_search_sdk_history_empty_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/layout/mapbox_search_sdk_history_header_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/layout/mapbox_search_sdk_loading_item_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 15 | 16 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/layout/mapbox_search_sdk_result_empty_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/layout/mapbox_search_sdk_result_missing_feedback_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 14 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/values-land/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10dp 5 | 6 | 7 | -------------------------------------------------------------------------------- /MapboxSearch/ui/src/main/res/values-night/themes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |