├── .editorconfig ├── .github └── mbx-plugins-logo.png ├── .gitignore ├── .gitmodules ├── .tx └── config ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── README.md ├── app ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── mapbox │ │ └── mapboxsdk │ │ └── plugins │ │ ├── BaseActivityTest.java │ │ ├── activity.junit.ejs │ │ ├── annotation │ │ ├── CircleManagerTest.java │ │ ├── CircleTest.java │ │ ├── FillManagerTest.java │ │ ├── FillTest.java │ │ ├── LineManagerTest.java │ │ ├── LineTest.java │ │ ├── MapboxMapAction.java │ │ ├── SymbolManagerTest.java │ │ ├── SymbolTest.java │ │ └── WaitAction.java │ │ ├── building │ │ ├── BuildingPluginAction.java │ │ └── BuildingPluginTest.java │ │ ├── offline │ │ └── OfflinePluginTest.java │ │ ├── places │ │ └── autocomplete │ │ │ ├── LiveDataTestUtil.java │ │ │ ├── data │ │ │ ├── SearchHistoryDaoTest.java │ │ │ └── TestData.java │ │ │ └── ui │ │ │ └── PlaceAutocompleteFragmentTest.java │ │ ├── scalebar │ │ └── ScaleBarTest.java │ │ ├── traffic │ │ ├── TrafficPluginAction.java │ │ └── TrafficPluginTest.java │ │ └── utils │ │ └── OnMapReadyIdlingResource.java │ ├── debug │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── mapbox │ │ │ └── mapboxsdk │ │ │ └── plugins │ │ │ └── testapp │ │ │ └── activity │ │ │ ├── SingleFragmentActivity.java │ │ │ └── TestActivity.kt │ └── res │ │ ├── layout │ │ └── activity_test.xml │ │ └── values │ │ └── strings.xml │ └── main │ ├── AndroidManifest.xml │ ├── assets │ ├── IRN.geo.json │ ├── annotations.json │ └── points.geojson │ ├── ic_launcher-web.png │ ├── java │ └── com │ │ └── mapbox │ │ └── mapboxsdk │ │ └── plugins │ │ └── testapp │ │ ├── PluginApplication.kt │ │ ├── Utils.kt │ │ └── activity │ │ ├── FeatureOverviewActivity.java │ │ ├── annotation │ │ ├── BulkSymbolActivity.java │ │ ├── CircleActivity.java │ │ ├── ClusterSymbolActivity.java │ │ ├── DynamicSymbolChangeActivity.java │ │ ├── FillActivity.java │ │ ├── FillChangeActivity.java │ │ ├── LineActivity.java │ │ ├── LineChangeActivity.java │ │ ├── PressForSymbolActivity.java │ │ └── SymbolActivity.java │ │ ├── building │ │ └── BuildingActivity.kt │ │ ├── ktx │ │ └── maps │ │ │ └── MapboxKtxActivity.kt │ │ ├── localization │ │ └── LocalizationActivity.kt │ │ ├── markerview │ │ └── MarkerViewActivity.kt │ │ ├── offline │ │ ├── OfflineDownloadActivity.kt │ │ ├── OfflineRegionDetailActivity.kt │ │ ├── OfflineRegionListActivity.kt │ │ └── OfflineUiComponentsActivity.kt │ │ ├── places │ │ ├── AutocompleteFragmentActivity.kt │ │ ├── AutocompleteLauncherActivity.kt │ │ └── PickerLauncherActivity.kt │ │ ├── scalebar │ │ └── ScalebarActivity.kt │ │ └── traffic │ │ └── TrafficActivity.kt │ └── res │ ├── drawable │ ├── custom_user_arrow.xml │ ├── custom_user_icon.xml │ ├── custom_user_puck_icon.xml │ ├── custom_user_stroke_icon.xml │ ├── ic_airplanemode_active_black_24dp.xml │ ├── ic_business.xml │ ├── ic_camera.xml │ ├── ic_car.xml │ ├── ic_delete.xml │ ├── ic_file.xml │ ├── ic_layers.xml │ ├── ic_layers_clear.xml │ ├── ic_location.xml │ ├── ic_location_disabled.xml │ ├── ic_path.xml │ ├── ic_save.xml │ ├── ic_scale.xml │ ├── ic_translate_white_24dp.xml │ ├── ic_url.xml │ └── line_divider.xml │ ├── layout │ ├── activity_annotation.xml │ ├── activity_building.xml │ ├── activity_cluster.xml │ ├── activity_feature_overview.xml │ ├── activity_localization.xml │ ├── activity_maps_ktx.xml │ ├── activity_offline_download.xml │ ├── activity_offline_region_detail.xml │ ├── activity_offline_region_list.xml │ ├── activity_offline_ui_components.xml │ ├── activity_picker_launcher.xml │ ├── activity_places_fragment.xml │ ├── activity_places_launcher.xml │ ├── activity_scalebar.xml │ ├── activity_traffic.xml │ ├── item_feature.xml │ ├── marker_view.xml │ └── section_feature.xml │ ├── menu │ ├── menu_building.xml │ ├── menu_bulk_symbol.xml │ ├── menu_change_fill.xml │ ├── menu_change_line.xml │ ├── menu_circle.xml │ ├── menu_fill.xml │ ├── menu_languages.xml │ ├── menu_line.xml │ └── menu_symbol.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ └── ic_launcher_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-mdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-xxhdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ ├── ic_launcher_foreground.png │ └── ic_launcher_round.png │ ├── raw │ └── radar_search.json │ └── values │ ├── arrays.xml │ ├── colors.xml │ ├── dimens.xml │ ├── ic_launcher_background.xml │ ├── ids.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── circle.yml ├── config └── checkstyle │ └── checkstyle.xml ├── gradle.properties ├── gradle ├── artifact-settings.gradle ├── checkstyle.gradle ├── dependencies.gradle ├── generate-token.gradle ├── javadoc.gradle ├── nitpick.gradle ├── publish.gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── ktx-mapbox-maps ├── .gitignore ├── build.gradle ├── gradle.properties ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── mapbox │ │ └── mapboxsdk │ │ └── plugins │ │ └── maps │ │ ├── Geometry.kt │ │ └── Maps.kt │ └── test │ ├── java │ └── com │ │ └── mapbox │ │ └── mapboxsdk │ │ └── plugins │ │ └── maps │ │ └── GeometryTest.kt │ └── resources │ └── mockito-extensions │ └── org.mockito.plugins.MockMaker ├── package-lock.json ├── package.json ├── plugin-annotation ├── .gitignore ├── CHANGELOG.md ├── README.md ├── build.gradle ├── gradle.properties ├── scripts │ ├── annotation.java.ejs │ ├── annotation_click_listener.java.ejs │ ├── annotation_drag_listener.java.ejs │ ├── annotation_element_provider.java.ejs │ ├── annotation_instrumentation_test.junit.ejs │ ├── annotation_long_click_listener.java.ejs │ ├── annotation_manager.java.ejs │ ├── annotation_manager_instrumentation_test.junit.ejs │ ├── annotation_manager_unit_test.junit.ejs │ ├── annotation_options.java.ejs │ ├── code-gen.js │ └── package.json └── src │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── mapbox │ │ └── mapboxsdk │ │ └── plugins │ │ └── annotation │ │ ├── Annotation.java │ │ ├── AnnotationManager.java │ │ ├── Circle.java │ │ ├── CircleElementProvider.java │ │ ├── CircleManager.java │ │ ├── CircleOptions.java │ │ ├── ClusterOptions.java │ │ ├── ConvertUtils.java │ │ ├── CoreElementProvider.java │ │ ├── DraggableAnnotationController.java │ │ ├── Fill.java │ │ ├── FillElementProvider.java │ │ ├── FillManager.java │ │ ├── FillOptions.java │ │ ├── Line.java │ │ ├── LineElementProvider.java │ │ ├── LineManager.java │ │ ├── LineOptions.java │ │ ├── OnAnnotationClickListener.java │ │ ├── OnAnnotationDragListener.java │ │ ├── OnAnnotationLongClickListener.java │ │ ├── OnCircleClickListener.java │ │ ├── OnCircleDragListener.java │ │ ├── OnCircleLongClickListener.java │ │ ├── OnFillClickListener.java │ │ ├── OnFillDragListener.java │ │ ├── OnFillLongClickListener.java │ │ ├── OnLineClickListener.java │ │ ├── OnLineDragListener.java │ │ ├── OnLineLongClickListener.java │ │ ├── OnSymbolClickListener.java │ │ ├── OnSymbolDragListener.java │ │ ├── OnSymbolLongClickListener.java │ │ ├── Options.java │ │ ├── Symbol.java │ │ ├── SymbolElementProvider.java │ │ ├── SymbolManager.java │ │ └── SymbolOptions.java │ └── test │ └── java │ └── com │ └── mapbox │ └── mapboxsdk │ └── plugins │ └── annotation │ ├── CircleManagerTest.java │ ├── DraggableAnnotationControllerTest.java │ ├── FillManagerTest.java │ ├── LineManagerTest.java │ ├── PropertyValueMatcher.java │ └── SymbolManagerTest.java ├── plugin-building ├── CHANGELOG.md ├── README.md ├── build.gradle ├── gradle.properties └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── mapbox │ └── mapboxsdk │ └── plugins │ └── building │ ├── BuildingPlugin.java │ └── package-info.java ├── plugin-localization ├── CHANGELOG.md ├── README.md ├── build.gradle ├── gradle.properties └── src │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── mapbox │ │ └── mapboxsdk │ │ └── plugins │ │ └── localization │ │ ├── LocalizationPlugin.java │ │ ├── MapLocale.java │ │ └── package-info.java │ └── test │ └── java │ └── com │ └── mapbox │ └── mapboxsdk │ └── plugins │ └── localization │ ├── LocalizationPluginTest.java │ └── MapLocaleTest.java ├── plugin-locationlayer ├── CHANGELOG.md └── README.md ├── plugin-markerview ├── .gitignore ├── CHANGELOG.md ├── README.md ├── build.gradle ├── gradle.properties ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── mapbox │ └── mapboxsdk │ └── plugins │ └── markerview │ ├── MarkerView.java │ └── MarkerViewManager.java ├── plugin-offline ├── CHANGELOG.md ├── README.md ├── build.gradle ├── gradle.properties ├── proguard-consumer.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── mapbox │ │ └── mapboxsdk │ │ └── plugins │ │ └── offline │ │ ├── OfflinePluginConstants.java │ │ ├── OfflineRegionSelector.java │ │ ├── model │ │ ├── NotificationOptions.java │ │ ├── OfflineDownloadOptions.java │ │ └── RegionSelectionOptions.java │ │ ├── offline │ │ ├── OfflineConstants.java │ │ ├── OfflineDownloadChangeDispatcher.java │ │ ├── OfflineDownloadChangeListener.java │ │ ├── OfflineDownloadService.java │ │ ├── OfflineDownloadStateReceiver.java │ │ └── OfflinePlugin.java │ │ ├── ui │ │ ├── OfflineActivity.java │ │ ├── RegionSelectedCallback.java │ │ └── RegionSelectionFragment.java │ │ └── utils │ │ ├── ColorUtils.java │ │ ├── NotificationUtils.java │ │ └── OfflineUtils.java │ └── res │ ├── drawable │ ├── ic_cancel.xml │ ├── mapbox_ic_arrow_back.xml │ ├── mapbox_ic_check.xml │ └── mapbox_region_selection_scrim.xml │ ├── layout │ ├── mapbox_offline_activity.xml │ ├── mapbox_offline_region_selection_fragment.xml │ └── mapbox_offline_toolbar.xml │ └── values │ ├── mapbox_colors.xml │ ├── mapbox_dimens.xml │ └── mapbox_strings.xml ├── plugin-places ├── CHANGELOG.md ├── README.md ├── build.gradle ├── gradle.properties ├── proguard-consumer.pro ├── schemas │ ├── com.mapbox.mapboxsdk.plugins.places.autocomplete.data.SearchHistoryDatabase │ │ └── 1.json │ └── com.mapbox.plugins.places.autocomplete.data.SearchHistoryDatabase │ │ └── 1.json └── src │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── mapbox │ │ │ └── mapboxsdk │ │ │ └── plugins │ │ │ └── places │ │ │ ├── autocomplete │ │ │ ├── DataRepository.java │ │ │ ├── PlaceAutocomplete.java │ │ │ ├── data │ │ │ │ ├── SearchHistoryDatabase.java │ │ │ │ ├── converter │ │ │ │ │ ├── CarmenFeatureConverter.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── dao │ │ │ │ │ ├── SearchHistoryDao.java │ │ │ │ │ └── package-info.java │ │ │ │ ├── entity │ │ │ │ │ ├── SearchHistoryEntity.java │ │ │ │ │ └── package-info.java │ │ │ │ └── package-info.java │ │ │ ├── model │ │ │ │ ├── PlaceOptions.java │ │ │ │ ├── SearchHistory.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── ui │ │ │ │ ├── PlaceAutocompleteActivity.java │ │ │ │ ├── PlaceAutocompleteFragment.java │ │ │ │ ├── PlaceSelectionListener.java │ │ │ │ ├── ResultCardView.java │ │ │ │ ├── ResultClickCallback.java │ │ │ │ ├── ResultItemDecoration.java │ │ │ │ ├── ResultView.java │ │ │ │ ├── SearchResultAdapter.java │ │ │ │ ├── SearchView.java │ │ │ │ └── package-info.java │ │ │ └── viewmodel │ │ │ │ ├── PlaceAutocompleteViewModel.java │ │ │ │ └── package-info.java │ │ │ ├── common │ │ │ ├── PlaceConstants.java │ │ │ ├── model │ │ │ │ └── BasePlaceOptions.java │ │ │ ├── package-info.java │ │ │ └── utils │ │ │ │ ├── ColorUtils.java │ │ │ │ ├── GeocodingUtils.java │ │ │ │ └── KeyboardUtils.java │ │ │ └── picker │ │ │ ├── PlacePicker.java │ │ │ ├── model │ │ │ └── PlacePickerOptions.java │ │ │ ├── ui │ │ │ ├── CurrentPlaceSelectionBottomSheet.java │ │ │ └── PlacePickerActivity.java │ │ │ └── viewmodel │ │ │ └── PlacePickerViewModel.java │ └── res │ │ ├── drawable-hdpi │ │ ├── map_default_map_marker.png │ │ └── map_default_map_marker_shadow.png │ │ ├── drawable-mdpi │ │ ├── map_default_map_marker.png │ │ └── map_default_map_marker_shadow.png │ │ ├── drawable-xhdpi │ │ ├── map_default_map_marker.png │ │ └── map_default_map_marker_shadow.png │ │ ├── drawable-xxhdpi │ │ ├── map_default_map_marker.png │ │ └── map_default_map_marker_shadow.png │ │ ├── drawable-xxxhdpi │ │ ├── map_default_map_marker.png │ │ └── map_default_map_marker_shadow.png │ │ ├── drawable │ │ ├── mapbox_color_text_cursor.xml │ │ ├── mapbox_gradient_shadow_up.xml │ │ ├── mapbox_ic_arrow_back.xml │ │ ├── mapbox_ic_check.xml │ │ ├── mapbox_ic_clear.xml │ │ ├── mapbox_ic_offline.xml │ │ ├── mapbox_ic_place.xml │ │ ├── mapbox_list_line_divider.xml │ │ ├── mapbox_plugins_ic_user_location.xml │ │ └── mapbox_scroll_shadow.xml │ │ ├── layout │ │ ├── mapbox_activity_autocomplete.xml │ │ ├── mapbox_activity_place_picker.xml │ │ ├── mapbox_content_place_picker.xml │ │ ├── mapbox_fragment_autocomplete_card.xml │ │ ├── mapbox_fragment_autocomplete_full.xml │ │ ├── mapbox_item_offline_message.xml │ │ ├── mapbox_item_search_result.xml │ │ ├── mapbox_toolbar_place_picker.xml │ │ ├── mapbox_view_bottom_sheet_container.xml │ │ ├── mapbox_view_card_results.xml │ │ ├── mapbox_view_details_bottom_header.xml │ │ ├── mapbox_view_results.xml │ │ └── mapbox_view_search.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── mapbox │ └── mapboxsdk │ └── plugins │ └── places │ ├── autocomplete │ └── data │ │ ├── converter │ │ └── CarmenFeatureConverterTest.java │ │ └── entity │ │ └── SearchHistoryEntityTest.java │ └── picker │ ├── PlacePickerTest.java │ └── model │ └── PlacePickerOptionsTest.java ├── plugin-scalebar ├── .gitignore ├── CHANGELOG.md ├── README.md ├── build.gradle ├── gradle.properties ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── mapbox │ │ │ └── pluginscalebar │ │ │ ├── ScaleBarConstants.java │ │ │ ├── ScaleBarOptions.java │ │ │ ├── ScaleBarPlugin.java │ │ │ └── ScaleBarWidget.java │ └── res │ │ └── values │ │ └── dimens.xml │ └── test │ └── java │ └── com │ └── mapbox │ └── pluginscalebar │ └── ScaleBarPluginTest.kt ├── plugin-traffic ├── CHANGELOG.md ├── README.md ├── build.gradle ├── gradle.properties └── src │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── mapbox │ │ └── mapboxsdk │ │ └── plugins │ │ └── traffic │ │ ├── TrafficPlugin.java │ │ └── package-info.java │ └── test │ ├── java │ └── com │ │ └── mapbox │ │ └── mapboxsdk │ │ └── plugins │ │ └── traffic │ │ └── TrafficPluginTest.java │ └── resources │ └── mockito-extensions │ └── org.mockito.plugins.MockMaker ├── scripts ├── exclude-activity-gen.json └── generate-activity-test.js └── settings.gradle /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{kt,kts}] 2 | indent_size=2 -------------------------------------------------------------------------------- /.github/mbx-plugins-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-plugins-android/bdcbc3b74d742166198faba779395f9b1d7b391b/.github/mbx-plugins-logo.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea 5 | .DS_Store 6 | build/ 7 | /captures 8 | .externalNativeBuild 9 | /app/src/main/res/values/developer-config.xml 10 | 11 | ### Python ### 12 | *.pyc 13 | 14 | 15 | ### Code gen activity sanity tests ### 16 | /node_modules 17 | app/src/androidTest/java/com/mapbox/mapboxsdk/plugins/gen 18 | 19 | ### Code gen annotation plugin ### 20 | plugin-annotation/scripts/code-gen.list 21 | plugin-annotation/scripts/node_modules/ 22 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "plugin-annotation/gl-js"] 2 | path = plugin-annotation/gl-js 3 | url = https://github.com/mapbox/mapbox-gl-js 4 | -------------------------------------------------------------------------------- /.tx/config: -------------------------------------------------------------------------------- 1 | [main] 2 | host = https://www.transifex.com 3 | minimum_perc = 20 4 | lang_map = pt_BR: pt-rBR, pt_PT: pt-rPT 5 | 6 | [mapbox-plugins-for-android.plugin-offline-strings-file] 7 | file_filter = plugin-offline/src/main/res/values-/mapbox_strings.xml 8 | source_file = plugin-offline/src/main/res/values/mapbox_strings.xml 9 | source_lang = en 10 | type = ANDROID 11 | 12 | [mapbox-plugins-for-android.plugin-places-strings-file] 13 | file_filter = plugin-places/src/main/res/values-/strings.xml 14 | source_file = plugin-places/src/main/res/values/strings.xml 15 | source_lang = en 16 | type = ANDROID -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | Each Mapbox plugin for Android has a separate changelog that highlights changes relevant to the plugin: 4 | 5 | * [Location layer plugin](https://github.com/mapbox/mapbox-plugins-android/tree/master/plugin-locationlayer/CHANGELOG.md) 6 | * [Building plugin](https://github.com/mapbox/mapbox-plugins-android/tree/master/plugin-building/CHANGELOG.md) 7 | * [Traffic plugin](https://github.com/mapbox/mapbox-plugins-android/tree/master/plugin-traffic/CHANGELOG.md) 8 | * [Places plugin](https://github.com/mapbox/mapbox-plugins-android/tree/master/plugin-places/CHANGELOG.md) 9 | * [Offline plugin](https://github.com/mapbox/mapbox-plugins-android/tree/master/plugin-offline/CHANGELOG.md) 10 | * [Localization plugin](https://github.com/mapbox/mapbox-plugins-android/tree/master/plugin-localization/CHANGELOG.md) 11 | * [Annotation plugin](https://github.com/mapbox/mapbox-plugins-android/tree/master/plugin-annotation/CHANGELOG.md) 12 | * [MarkerView plugin](https://github.com/mapbox/mapbox-plugins-android/blob/master/plugin-markerview/CHANGELOG.md) 13 | * [Scalebar plugin](https://github.com/mapbox/mapbox-plugins-android/blob/master/plugin-scalebar/CHANGELOG.md) 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2019, Mapbox 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this 7 | list of conditions and the following disclaimer. 8 | 9 | * Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | MBGL_ANDROID_PLUGINS += traffic;plugin-traffic 2 | MBGL_ANDROID_PLUGINS += locationlayer;plugin-locationlayer 3 | MBGL_ANDROID_PLUGINS += building;plugin-building 4 | MBGL_ANDROID_PLUGINS += offline;plugin-offline 5 | MBGL_ANDROID_PLUGINS += places;plugin-places 6 | MBGL_ANDROID_PLUGINS += localization;plugin-localization 7 | MBGL_ANDROID_PLUGINS += scalebar;plugin-scalebar 8 | 9 | checkstyle: 10 | ./gradlew checkstyle && ./gradlew ktlintCheck 11 | 12 | kotlin-lint: 13 | ./gradlew ktlintCheck 14 | 15 | test: 16 | ./gradlew test --info 17 | 18 | build-release: 19 | ./gradlew assembleRelease 20 | 21 | javadoc: 22 | # Android modules 23 | # Output is ./mapbox/*/build/docs/javadoc/release 24 | ./gradlew javadocrelease 25 | 26 | # Uploads the compiled Android SDK to Mapbox SDK Registry 27 | publish: 28 | ./gradlew mapboxSDKRegistryUpload 29 | 30 | generate-sanity-test: 31 | npm install && node scripts/generate-activity-test.js 32 | 33 | generate-annotation-code: 34 | npm install && node plugin-annotation/scripts/code-gen.js 35 | 36 | # 37 | # individual Make commands 38 | # 39 | 40 | define ANDROID_RULES 41 | 42 | test-$1: 43 | ./gradlew :$2:test 44 | 45 | build-release-$1: 46 | ./gradlew :$2:assembleRelease 47 | 48 | javadoc-$1: 49 | # Android modules 50 | # Output is ./mapbox/*/build/docs/javadoc/release 51 | ./gradlew :$2:javadocrelease 52 | 53 | publish-$1: 54 | ./gradlew :$2:mapboxSDKRegistryUpload 55 | 56 | endef 57 | 58 | # Explodes the arguments into individual variables 59 | define ANDROID_RULES_INVOKER 60 | $(call ANDROID_RULES,$(word 1,$1),$(word 2,$1)) 61 | endef 62 | 63 | $(foreach plugin,$(MBGL_ANDROID_PLUGINS),$(eval $(call ANDROID_RULES_INVOKER,$(subst ;, ,$(plugin))))) 64 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Mapbox Plugin testapp ProGuard rules. 2 | 3 | # --- GMS --- 4 | -keep public class com.google.android.gms.* { public *; } 5 | -dontwarn com.sun.xml.internal.ws.spi.db.* 6 | -dontwarn com.google.android.gms.** -------------------------------------------------------------------------------- /app/src/androidTest/java/com/mapbox/mapboxsdk/plugins/activity.junit.ejs: -------------------------------------------------------------------------------- 1 | <% 2 | const activity = locals[0]; 3 | const subPackage = locals[1]; 4 | -%> 5 | // This file is generated 6 | package com.mapbox.mapboxsdk.plugins.gen.<%- subPackage %>; 7 | 8 | import androidx.test.ext.junit.runners.AndroidJUnit4; 9 | 10 | import com.mapbox.mapboxsdk.plugins.BaseActivityTest; 11 | import com.mapbox.mapboxsdk.plugins.testapp.activity.<%- subPackage %>.<%- activity %>; 12 | 13 | import org.junit.Test; 14 | import org.junit.runner.RunWith; 15 | 16 | /** 17 | * Sanity test for <%- activity %> 18 | */ 19 | @RunWith(AndroidJUnit4.class) 20 | public class <%- activity %>Test extends BaseActivityTest { 21 | 22 | @Test 23 | public void testSanity() { 24 | validateTestSetup(); 25 | } 26 | 27 | @Override 28 | protected Class getActivityClass() { 29 | return <%- activity %>.class; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/mapbox/mapboxsdk/plugins/annotation/MapboxMapAction.java: -------------------------------------------------------------------------------- 1 | package com.mapbox.mapboxsdk.plugins.annotation; 2 | 3 | import android.view.View; 4 | 5 | import com.mapbox.mapboxsdk.maps.MapboxMap; 6 | 7 | import org.hamcrest.Matcher; 8 | 9 | import androidx.test.espresso.UiController; 10 | import androidx.test.espresso.ViewAction; 11 | 12 | import static androidx.test.espresso.Espresso.onView; 13 | import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; 14 | import static androidx.test.espresso.matcher.ViewMatchers.withId; 15 | 16 | public class MapboxMapAction implements ViewAction { 17 | 18 | private OnInvokeActionListener invokeViewAction; 19 | private MapboxMap mapboxMap; 20 | 21 | public MapboxMapAction(OnInvokeActionListener invokeViewAction, MapboxMap mapboxMap) { 22 | this.invokeViewAction = invokeViewAction; 23 | this.mapboxMap = mapboxMap; 24 | } 25 | 26 | @Override 27 | public Matcher getConstraints() { 28 | return isDisplayed(); 29 | } 30 | 31 | @Override 32 | public String getDescription() { 33 | return getClass().getSimpleName(); 34 | } 35 | 36 | @Override 37 | public void perform(UiController uiController, View view) { 38 | invokeViewAction.onInvokeAction(uiController, mapboxMap); 39 | } 40 | 41 | public static void invoke(MapboxMap mapboxMap, OnInvokeActionListener invokeViewAction) { 42 | onView(withId(android.R.id.content)).perform(new MapboxMapAction(invokeViewAction, mapboxMap)); 43 | } 44 | 45 | public interface OnInvokeActionListener { 46 | void onInvokeAction(UiController uiController, MapboxMap mapboxMap); 47 | } 48 | } 49 | 50 | 51 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/mapbox/mapboxsdk/plugins/annotation/WaitAction.java: -------------------------------------------------------------------------------- 1 | package com.mapbox.mapboxsdk.plugins.annotation; 2 | 3 | import android.view.View; 4 | 5 | import org.hamcrest.Matcher; 6 | 7 | import androidx.test.espresso.UiController; 8 | import androidx.test.espresso.ViewAction; 9 | 10 | import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; 11 | 12 | 13 | public final class WaitAction implements ViewAction { 14 | 15 | private static final long DEFAULT_LOOP_TIME = 375; 16 | private final long loopTime; 17 | 18 | public WaitAction() { 19 | this(DEFAULT_LOOP_TIME); 20 | } 21 | 22 | public WaitAction(long loopTime) { 23 | this.loopTime = loopTime; 24 | } 25 | 26 | @Override 27 | public Matcher getConstraints() { 28 | return isDisplayed(); 29 | } 30 | 31 | @Override 32 | public String getDescription() { 33 | return getClass().getSimpleName(); 34 | } 35 | 36 | @Override 37 | public void perform(UiController uiController, View view) { 38 | uiController.loopMainThreadForAtLeast(loopTime); 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/mapbox/mapboxsdk/plugins/building/BuildingPluginAction.java: -------------------------------------------------------------------------------- 1 | package com.mapbox.mapboxsdk.plugins.building; 2 | 3 | import android.content.Context; 4 | import android.view.View; 5 | 6 | import com.mapbox.mapboxsdk.maps.MapboxMap; 7 | 8 | import org.hamcrest.Matcher; 9 | 10 | import androidx.test.espresso.UiController; 11 | import androidx.test.espresso.ViewAction; 12 | 13 | import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; 14 | 15 | 16 | class BuildingPluginAction implements ViewAction { 17 | 18 | private MapboxMap mapboxMap; 19 | private BuildingPlugin buildingPlugin; 20 | private OnPerformBuildingPluginAction onPerformBuildingPluginAction; 21 | 22 | BuildingPluginAction(MapboxMap mapboxMap, BuildingPlugin buildingPlugin, 23 | OnPerformBuildingPluginAction onPerformBuildingPluginAction) { 24 | this.buildingPlugin = buildingPlugin; 25 | this.mapboxMap = mapboxMap; 26 | this.onPerformBuildingPluginAction = onPerformBuildingPluginAction; 27 | } 28 | 29 | @Override 30 | public Matcher getConstraints() { 31 | return isDisplayed(); 32 | } 33 | 34 | @Override 35 | public String getDescription() { 36 | return getClass().getSimpleName(); 37 | } 38 | 39 | @Override 40 | public void perform(UiController uiController, View view) { 41 | if (onPerformBuildingPluginAction != null) { 42 | onPerformBuildingPluginAction.onBuildingPluginAction(buildingPlugin, mapboxMap, 43 | uiController, view.getContext()); 44 | } 45 | } 46 | 47 | interface OnPerformBuildingPluginAction { 48 | void onBuildingPluginAction(BuildingPlugin locationLayerPlugin, MapboxMap mapboxMap, 49 | UiController uiController, Context context); 50 | } 51 | } -------------------------------------------------------------------------------- /app/src/androidTest/java/com/mapbox/mapboxsdk/plugins/offline/OfflinePluginTest.java: -------------------------------------------------------------------------------- 1 | package com.mapbox.mapboxsdk.plugins.offline; 2 | 3 | import com.mapbox.mapboxsdk.plugins.offline.model.OfflineDownloadOptions; 4 | import com.mapbox.mapboxsdk.plugins.offline.offline.OfflinePlugin; 5 | import com.mapbox.mapboxsdk.plugins.testapp.R; 6 | import com.mapbox.mapboxsdk.plugins.testapp.activity.offline.OfflineDownloadActivity; 7 | 8 | import org.junit.Before; 9 | import org.junit.Ignore; 10 | import org.junit.Rule; 11 | import org.junit.Test; 12 | import org.junit.runner.RunWith; 13 | 14 | import java.util.List; 15 | 16 | import androidx.test.ext.junit.runners.AndroidJUnit4; 17 | import androidx.test.rule.ActivityTestRule; 18 | 19 | import static androidx.test.espresso.Espresso.onView; 20 | import static androidx.test.espresso.action.ViewActions.click; 21 | import static androidx.test.espresso.matcher.ViewMatchers.withId; 22 | import static org.hamcrest.CoreMatchers.equalTo; 23 | import static org.hamcrest.CoreMatchers.notNullValue; 24 | import static org.junit.Assert.assertThat; 25 | 26 | @RunWith(AndroidJUnit4.class) 27 | @Ignore public class OfflinePluginTest { 28 | 29 | @Rule 30 | public ActivityTestRule rule = new ActivityTestRule<>(OfflineDownloadActivity.class); 31 | 32 | private OfflinePlugin plugin; 33 | 34 | @Before 35 | public void setUp() { 36 | plugin = OfflinePlugin.getInstance(rule.getActivity()); 37 | } 38 | 39 | @Test 40 | public void sanity() { 41 | assertThat(plugin, notNullValue()); 42 | } 43 | 44 | @Test 45 | public void getActiveDownloads_doesReflectCorrectListSize() { 46 | // Ensure our current list is empty 47 | List options = plugin.getActiveDownloads(); 48 | assertThat(options.size(), equalTo(0)); 49 | 50 | // Initiate the offline download and ensure the active download list has one item 51 | onView(withId(R.id.fabStartDownload)).perform(click()); 52 | options = plugin.getActiveDownloads(); 53 | assertThat(options.size(), equalTo(1)); 54 | } 55 | 56 | 57 | } 58 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/mapbox/mapboxsdk/plugins/places/autocomplete/LiveDataTestUtil.java: -------------------------------------------------------------------------------- 1 | package com.mapbox.mapboxsdk.plugins.places.autocomplete; 2 | 3 | import java.util.concurrent.CountDownLatch; 4 | import java.util.concurrent.TimeUnit; 5 | 6 | import androidx.annotation.Nullable; 7 | import androidx.lifecycle.LiveData; 8 | import androidx.lifecycle.Observer; 9 | 10 | public class LiveDataTestUtil { 11 | 12 | /** 13 | * Get the value from a LiveData object. We're waiting for LiveData to emit, for 2 seconds. 14 | * Once we got a notification via onChanged, we stop observing. 15 | */ 16 | public static T getValue(final LiveData liveData) throws InterruptedException { 17 | final Object[] data = new Object[1]; 18 | final CountDownLatch latch = new CountDownLatch(1); 19 | Observer observer = new Observer() { 20 | @Override 21 | public void onChanged(@Nullable T o) { 22 | data[0] = o; 23 | latch.countDown(); 24 | liveData.removeObserver(this); 25 | } 26 | }; 27 | liveData.observeForever(observer); 28 | latch.await(2, TimeUnit.SECONDS); 29 | //noinspection unchecked 30 | return (T) data[0]; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/mapbox/mapboxsdk/plugins/places/autocomplete/data/TestData.java: -------------------------------------------------------------------------------- 1 | package com.mapbox.mapboxsdk.plugins.places.autocomplete.data; 2 | 3 | import com.google.gson.JsonObject; 4 | import com.mapbox.api.geocoding.v5.models.CarmenFeature; 5 | import com.mapbox.geojson.Point; 6 | import com.mapbox.mapboxsdk.plugins.places.autocomplete.data.entity.SearchHistoryEntity; 7 | 8 | public final class TestData { 9 | 10 | public static final CarmenFeature CARMEN_FEATURE = CarmenFeature.builder() 11 | .geometry(Point.fromLngLat(1.0, 2.0)) 12 | .id("placeId") 13 | .address("address") 14 | .language("language") 15 | .placeName("placeName") 16 | .relevance(1.0) 17 | .text("text") 18 | .properties(new JsonObject()) 19 | .build(); 20 | 21 | public static final CarmenFeature CARMEN_FEATURE_TWO = CarmenFeature.builder() 22 | .geometry(Point.fromLngLat(5.0, 6.0)) 23 | .id("placeIdTwo") 24 | .address("addressTwo") 25 | .language("languageTwo") 26 | .placeName("placeNameTwo") 27 | .relevance(0.5) 28 | .text("textTwo") 29 | .properties(new JsonObject()) 30 | .build(); 31 | 32 | static final SearchHistoryEntity SEARCH_HISTORY_ENTITY 33 | = new SearchHistoryEntity(CARMEN_FEATURE.placeName(), CARMEN_FEATURE); 34 | 35 | static final SearchHistoryEntity SEARCH_HISTORY_ENTITY_TWO 36 | = new SearchHistoryEntity(CARMEN_FEATURE_TWO.placeName(), CARMEN_FEATURE_TWO); 37 | } 38 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/mapbox/mapboxsdk/plugins/traffic/TrafficPluginAction.java: -------------------------------------------------------------------------------- 1 | package com.mapbox.mapboxsdk.plugins.traffic; 2 | 3 | import android.view.View; 4 | 5 | import com.mapbox.mapboxsdk.maps.MapboxMap; 6 | 7 | import org.hamcrest.Matcher; 8 | 9 | import androidx.test.espresso.UiController; 10 | import androidx.test.espresso.ViewAction; 11 | 12 | import static androidx.test.espresso.matcher.ViewMatchers.isDisplayed; 13 | 14 | class TrafficPluginAction implements ViewAction { 15 | 16 | private MapboxMap mapboxMap; 17 | private TrafficPlugin trafficPlugin; 18 | private OnPerformTrafficAction onPerformTrafficAction; 19 | 20 | TrafficPluginAction(MapboxMap mapboxMap, TrafficPlugin trafficPlugin, OnPerformTrafficAction onPerformTrafficAction) { 21 | this.trafficPlugin = trafficPlugin; 22 | this.mapboxMap = mapboxMap; 23 | this.onPerformTrafficAction = onPerformTrafficAction; 24 | } 25 | 26 | @Override 27 | public Matcher getConstraints() { 28 | return isDisplayed(); 29 | } 30 | 31 | @Override 32 | public String getDescription() { 33 | return getClass().getSimpleName(); 34 | } 35 | 36 | @Override 37 | public void perform(UiController uiController, View view) { 38 | if (onPerformTrafficAction != null) { 39 | onPerformTrafficAction.onTrafficAction(trafficPlugin, mapboxMap, uiController); 40 | } 41 | } 42 | 43 | interface OnPerformTrafficAction { 44 | void onTrafficAction(TrafficPlugin trafficPlugin, MapboxMap mapboxMap, UiController uiController); 45 | } 46 | } -------------------------------------------------------------------------------- /app/src/androidTest/java/com/mapbox/mapboxsdk/plugins/utils/OnMapReadyIdlingResource.java: -------------------------------------------------------------------------------- 1 | package com.mapbox.mapboxsdk.plugins.utils; 2 | 3 | import android.app.Activity; 4 | import android.os.Handler; 5 | import android.os.Looper; 6 | 7 | import com.mapbox.mapboxsdk.maps.MapView; 8 | import com.mapbox.mapboxsdk.maps.MapboxMap; 9 | import com.mapbox.mapboxsdk.maps.OnMapReadyCallback; 10 | import com.mapbox.mapboxsdk.maps.Style; 11 | import com.mapbox.mapboxsdk.plugins.testapp.R; 12 | 13 | import androidx.annotation.NonNull; 14 | import androidx.test.espresso.IdlingResource; 15 | 16 | public class OnMapReadyIdlingResource implements IdlingResource, OnMapReadyCallback { 17 | 18 | private MapboxMap mapboxMap; 19 | private MapView mapView; 20 | private IdlingResource.ResourceCallback resourceCallback; 21 | 22 | public OnMapReadyIdlingResource(Activity activity) { 23 | new Handler(Looper.getMainLooper()).post(() -> { 24 | mapView = activity.findViewById(R.id.mapView); 25 | if (mapView == null) { 26 | // some activities have different MapView id 27 | mapView = activity.findViewById(R.id.map_view); 28 | } 29 | 30 | if (mapView != null) { 31 | mapView.getMapAsync(OnMapReadyIdlingResource.this); 32 | } 33 | }); 34 | } 35 | 36 | @Override 37 | public String getName() { 38 | return getClass().getSimpleName(); 39 | } 40 | 41 | @Override 42 | public boolean isIdleNow() { 43 | return mapboxMap != null && mapboxMap.getStyle() != null && mapboxMap.getStyle().isFullyLoaded(); 44 | } 45 | 46 | @Override 47 | public void registerIdleTransitionCallback(ResourceCallback resourceCallback) { 48 | this.resourceCallback = resourceCallback; 49 | } 50 | 51 | public MapView getMapView() { 52 | return mapView; 53 | } 54 | 55 | public MapboxMap getMapboxMap() { 56 | return mapboxMap; 57 | } 58 | 59 | @Override 60 | public void onMapReady(@NonNull MapboxMap mapboxMap) { 61 | this.mapboxMap = mapboxMap; 62 | mapboxMap.setStyle(Style.MAPBOX_STREETS, style -> { 63 | if (resourceCallback != null) { 64 | resourceCallback.onTransitionToIdle(); 65 | } 66 | }); 67 | } 68 | } -------------------------------------------------------------------------------- /app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/debug/java/com/mapbox/mapboxsdk/plugins/testapp/activity/SingleFragmentActivity.java: -------------------------------------------------------------------------------- 1 | package com.mapbox.mapboxsdk.plugins.testapp.activity; 2 | 3 | import android.os.Bundle; 4 | import android.view.ViewGroup; 5 | import android.widget.FrameLayout; 6 | 7 | import com.mapbox.mapboxsdk.plugins.testapp.R; 8 | 9 | import androidx.annotation.Nullable; 10 | import androidx.appcompat.app.AppCompatActivity; 11 | import androidx.fragment.app.Fragment; 12 | 13 | /** 14 | * Used for testing fragments inside a fake activity. 15 | */ 16 | public class SingleFragmentActivity extends AppCompatActivity { 17 | @Override 18 | protected void onCreate(@Nullable Bundle savedInstanceState) { 19 | super.onCreate(savedInstanceState); 20 | FrameLayout content = new FrameLayout(this); 21 | content.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 22 | ViewGroup.LayoutParams.MATCH_PARENT)); 23 | content.setId(R.id.container); 24 | setContentView(content); 25 | } 26 | 27 | public void setFragment(Fragment fragment) { 28 | getSupportFragmentManager().beginTransaction() 29 | .add(R.id.container, fragment, "TEST") 30 | .commit(); 31 | } 32 | 33 | public void replaceFragment(Fragment fragment) { 34 | getSupportFragmentManager().beginTransaction() 35 | .replace(R.id.container, fragment).commit(); 36 | } 37 | } -------------------------------------------------------------------------------- /app/src/debug/java/com/mapbox/mapboxsdk/plugins/testapp/activity/TestActivity.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.mapboxsdk.plugins.testapp.activity 2 | 3 | import android.os.Bundle 4 | import androidx.appcompat.app.AppCompatActivity 5 | import com.mapbox.mapboxsdk.maps.MapView 6 | import com.mapbox.mapboxsdk.plugins.testapp.R 7 | 8 | class TestActivity : AppCompatActivity() { 9 | 10 | lateinit var mapView: MapView 11 | 12 | override fun onCreate(savedInstanceState: Bundle?) { 13 | super.onCreate(savedInstanceState) 14 | setContentView(R.layout.activity_test) 15 | this.mapView = findViewById(R.id.mapView) 16 | mapView.onCreate(savedInstanceState) 17 | } 18 | 19 | override fun onStart() { 20 | super.onStart() 21 | mapView.onStart() 22 | } 23 | 24 | override fun onResume() { 25 | super.onResume() 26 | mapView.onResume() 27 | } 28 | 29 | override fun onPause() { 30 | super.onPause() 31 | mapView.onPause() 32 | } 33 | 34 | override fun onStop() { 35 | super.onStop() 36 | mapView.onStop() 37 | } 38 | 39 | override fun onSaveInstanceState(outState: Bundle) { 40 | super.onSaveInstanceState(outState) 41 | mapView.onSaveInstanceState(outState) 42 | } 43 | 44 | override fun onDestroy() { 45 | super.onDestroy() 46 | mapView.onDestroy() 47 | } 48 | 49 | override fun onLowMemory() { 50 | super.onLowMemory() 51 | mapView.onLowMemory() 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/debug/res/layout/activity_test.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/debug/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | TestActivity 4 | -------------------------------------------------------------------------------- /app/src/main/assets/IRN.geo.json: -------------------------------------------------------------------------------- 1 | {"type":"FeatureCollection","features":[ 2 | {"type":"Feature","id":"IRN","properties":{"name":"Iran"},"geometry":{"type":"Polygon","coordinates":[[[53.921598,37.198918],[54.800304,37.392421],[55.511578,37.964117],[56.180375,37.935127],[56.619366,38.121394],[57.330434,38.029229],[58.436154,37.522309],[59.234762,37.412988],[60.377638,36.527383],[61.123071,36.491597],[61.210817,35.650072],[60.803193,34.404102],[60.52843,33.676446],[60.9637,33.528832],[60.536078,32.981269],[60.863655,32.18292],[60.941945,31.548075],[61.699314,31.379506],[61.781222,30.73585],[60.874248,29.829239],[61.369309,29.303276],[61.771868,28.699334],[62.72783,28.259645],[62.755426,27.378923],[63.233898,27.217047],[63.316632,26.756532],[61.874187,26.239975],[61.497363,25.078237],[59.616134,25.380157],[58.525761,25.609962],[57.397251,25.739902],[56.970766,26.966106],[56.492139,27.143305],[55.72371,26.964633],[54.71509,26.480658],[53.493097,26.812369],[52.483598,27.580849],[51.520763,27.86569],[50.852948,28.814521],[50.115009,30.147773],[49.57685,29.985715],[48.941333,30.31709],[48.567971,29.926778],[48.014568,30.452457],[48.004698,30.985137],[47.685286,30.984853],[47.849204,31.709176],[47.334661,32.469155],[46.109362,33.017287],[45.416691,33.967798],[45.64846,34.748138],[46.151788,35.093259],[46.07634,35.677383],[45.420618,35.977546],[44.77267,37.17045],[44.225756,37.971584],[44.421403,38.281281],[44.109225,39.428136],[44.79399,39.713003],[44.952688,39.335765],[45.457722,38.874139],[46.143623,38.741201],[46.50572,38.770605],[47.685079,39.508364],[48.060095,39.582235],[48.355529,39.288765],[48.010744,38.794015],[48.634375,38.270378],[48.883249,38.320245],[49.199612,37.582874],[50.147771,37.374567],[50.842354,36.872814],[52.264025,36.700422],[53.82579,36.965031],[53.921598,37.198918]]]}} 3 | ]} 4 | -------------------------------------------------------------------------------- /app/src/main/assets/annotations.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FeatureCollection", 3 | "features": [ 4 | { 5 | "type": "Feature", 6 | "geometry": { 7 | "type": "Point", 8 | "coordinates": [ 9 | 12.5, 10 | 41.9 11 | ] 12 | }, 13 | "properties": { 14 | "icon-image": "cafe-15", 15 | "is-draggable": true 16 | } 17 | }, 18 | { 19 | "type": "Feature", 20 | "geometry": { 21 | "type": "Point", 22 | "coordinates": [ 23 | 10.5, 24 | 35.9 25 | ] 26 | }, 27 | "properties": { 28 | "circle-color": "rgba(255, 255, 255, 1)", 29 | "circle-radius": "25", 30 | "is-draggable": true 31 | } 32 | }, 33 | { 34 | "type": "Feature", 35 | "geometry": { 36 | "type": "LineString", 37 | "coordinates": [ 38 | [ 39 | 10.5, 40 | 35.9 41 | ], 42 | [ 43 | 12.5, 44 | 41.9 45 | ] 46 | ] 47 | }, 48 | "properties": { 49 | "line-color": "rgba(255, 255, 255, 1)", 50 | "line-width": "15", 51 | "is-draggable": true 52 | } 53 | }, 54 | { 55 | "type": "Feature", 56 | "geometry": { 57 | "type": "Polygon", 58 | "coordinates": [ 59 | [ 60 | [ 61 | 12.5, 62 | 41.9 63 | ], 64 | [ 65 | 10.5, 66 | 35.9 67 | ], 68 | [ 69 | 41.9, 70 | 35.9 71 | ], 72 | [ 73 | 12.5, 74 | 41.9 75 | ] 76 | ] 77 | ] 78 | }, 79 | "properties": { 80 | "fill-color": "rgba(255, 255, 255, 1)", 81 | "fill-outline-color": "rgba(255, 0, 0, 1)", 82 | "is-draggable": true 83 | } 84 | } 85 | ] 86 | } -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-plugins-android/bdcbc3b74d742166198faba779395f9b1d7b391b/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /app/src/main/java/com/mapbox/mapboxsdk/plugins/testapp/PluginApplication.kt: -------------------------------------------------------------------------------- 1 | package com.mapbox.mapboxsdk.plugins.testapp 2 | 3 | import androidx.multidex.MultiDexApplication 4 | 5 | import com.mapbox.mapboxsdk.Mapbox 6 | 7 | import timber.log.Timber 8 | 9 | class PluginApplication : MultiDexApplication() { 10 | 11 | override fun onCreate() { 12 | super.onCreate() 13 | initializeLogger() 14 | Mapbox.getInstance(this, getString(R.string.mapbox_access_token)) 15 | } 16 | 17 | private fun initializeLogger() { 18 | if (BuildConfig.DEBUG) { 19 | Timber.plant(Timber.DebugTree()) 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/custom_user_arrow.xml: -------------------------------------------------------------------------------- 1 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/custom_user_icon.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/custom_user_puck_icon.xml: -------------------------------------------------------------------------------- 1 | 7 | 13 | 18 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/custom_user_stroke_icon.xml: -------------------------------------------------------------------------------- 1 | 7 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_airplanemode_active_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_business.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_camera.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_car.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_delete.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_file.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_layers.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_layers_clear.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_location.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_location_disabled.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_path.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_save.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_scale.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_translate_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_url.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/line_divider.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_annotation.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 19 | 20 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_building.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 20 | 21 | 32 | 33 | 41 | 42 | 46 | 47 | 51 | 52 | 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_cluster.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_feature_overview.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_maps_ktx.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_offline_region_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_offline_ui_components.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_places_fragment.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_places_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | 31 | 32 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_scalebar.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_traffic.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 17 | 18 | 30 | 31 | 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_feature.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 24 | 25 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/layout/marker_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 19 | 20 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/section_feature.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_building.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 10 | 13 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_bulk_symbol.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_change_fill.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | 12 | 16 | 20 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_change_line.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 9 | 13 | 17 | 21 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_circle.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_fill.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_languages.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | 24 | 25 | 29 | 30 | 34 | 35 | 39 | 40 | 41 | 45 | 46 | 50 | 51 | 55 | 56 | 60 | 61 | 65 | 66 | 70 | 71 | 75 | 76 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_line.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-plugins-android/bdcbc3b74d742166198faba779395f9b1d7b391b/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-plugins-android/bdcbc3b74d742166198faba779395f9b1d7b391b/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-plugins-android/bdcbc3b74d742166198faba779395f9b1d7b391b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-plugins-android/bdcbc3b74d742166198faba779395f9b1d7b391b/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-plugins-android/bdcbc3b74d742166198faba779395f9b1d7b391b/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-plugins-android/bdcbc3b74d742166198faba779395f9b1d7b391b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-plugins-android/bdcbc3b74d742166198faba779395f9b1d7b391b/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-plugins-android/bdcbc3b74d742166198faba779395f9b1d7b391b/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-plugins-android/bdcbc3b74d742166198faba779395f9b1d7b391b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-plugins-android/bdcbc3b74d742166198faba779395f9b1d7b391b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-plugins-android/bdcbc3b74d742166198faba779395f9b1d7b391b/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-plugins-android/bdcbc3b74d742166198faba779395f9b1d7b391b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-plugins-android/bdcbc3b74d742166198faba779395f9b1d7b391b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-plugins-android/bdcbc3b74d742166198faba779395f9b1d7b391b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mapbox/mapbox-plugins-android/bdcbc3b74d742166198faba779395f9b1d7b391b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values/arrays.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 5 | 100 6 | 500 7 | 1000 8 | 10000 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | @color/mapboxBlue 4 | @color/mapboxBlueDark 5 | @color/mapboxRed 6 | 7 | #F5F5F5 8 | #DFDFDF 9 | 10 | #ffffff 11 | #3BB2D0 12 | #56B881 13 | #3887BE 14 | #1F6EA5 15 | #8A8ACB 16 | #7171b2 17 | #A4A4E5 18 | 19 | #50667F 20 | #41AFA5 21 | #F9886C 22 | #E55E5E 23 | #ED6498 24 | #FBB03B 25 | #28353D 26 | #222B30 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3887BE 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 17 | 18 | 11 | 12 | -------------------------------------------------------------------------------- /plugin-places/src/test/java/com/mapbox/mapboxsdk/plugins/places/autocomplete/data/entity/SearchHistoryEntityTest.java: -------------------------------------------------------------------------------- 1 | package com.mapbox.mapboxsdk.plugins.places.autocomplete.data.entity; 2 | 3 | import com.google.gson.JsonObject; 4 | import com.mapbox.api.geocoding.v5.models.CarmenFeature; 5 | 6 | import org.junit.Test; 7 | 8 | import static junit.framework.Assert.assertNotNull; 9 | import static org.hamcrest.CoreMatchers.equalTo; 10 | import static org.junit.Assert.assertThat; 11 | 12 | public class SearchHistoryEntityTest { 13 | 14 | @Test 15 | public void sanity() throws Exception { 16 | CarmenFeature feature = CarmenFeature.builder() 17 | .properties(new JsonObject()) 18 | .build(); 19 | SearchHistoryEntity entity = new SearchHistoryEntity("placeId", feature); 20 | assertNotNull(entity); 21 | } 22 | 23 | @Test 24 | public void getPlaceId_doesReturnTheSetPlaceId() throws Exception { 25 | CarmenFeature feature = CarmenFeature.builder() 26 | .properties(new JsonObject()) 27 | .build(); 28 | SearchHistoryEntity entity = new SearchHistoryEntity("placeId", feature); 29 | assertThat(entity.getPlaceId(), equalTo("placeId")); 30 | } 31 | 32 | @Test 33 | public void getCarmenFeature_doesReturnTheSetCarmenFeature() throws Exception { 34 | CarmenFeature feature = CarmenFeature.builder() 35 | .id("myCarmenFeature") 36 | .properties(new JsonObject()) 37 | .build(); 38 | SearchHistoryEntity entity = new SearchHistoryEntity("placeId", feature); 39 | assertNotNull(entity.getCarmenFeature()); 40 | assertThat(entity.getCarmenFeature().id(), equalTo("myCarmenFeature")); 41 | } 42 | } -------------------------------------------------------------------------------- /plugin-places/src/test/java/com/mapbox/mapboxsdk/plugins/places/picker/model/PlacePickerOptionsTest.java: -------------------------------------------------------------------------------- 1 | package com.mapbox.mapboxsdk.plugins.places.picker.model; 2 | 3 | import com.mapbox.api.geocoding.v5.GeocodingCriteria; 4 | import com.mapbox.mapboxsdk.plugins.places.autocomplete.model.PlaceOptions; 5 | 6 | import org.junit.Assert; 7 | import org.junit.Test; 8 | 9 | import static junit.framework.Assert.assertNotNull; 10 | import static org.hamcrest.CoreMatchers.equalTo; 11 | 12 | public class PlacePickerOptionsTest { 13 | 14 | @Test 15 | public void builder() throws Exception { 16 | PlaceOptions.Builder builder = PlaceOptions.builder(); 17 | assertNotNull(builder); 18 | } 19 | 20 | @Test 21 | public void builder_geocodingTypes() { 22 | PlaceOptions placeOptions = PlaceOptions.builder() 23 | .geocodingTypes(GeocodingCriteria.TYPE_ADDRESS, GeocodingCriteria.TYPE_DISTRICT).build(); 24 | Assert.assertThat(placeOptions.geocodingTypes(), equalTo("address,district")); 25 | } 26 | } -------------------------------------------------------------------------------- /plugin-scalebar/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /plugin-scalebar/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog for the Mapbox Scale Bar Plugin 2 | 3 | Mapbox welcomes participation and contributions from everyone. 4 | 5 | ### mapbox-android-plugin-scalebar-v9:0.5.0 - March 31, 2020 6 | ####Features 7 | 8 | - Add option to config max width of scalebar [#1048](https://github.com/mapbox/mapbox-plugins-android/pull/1048) 9 | 10 | ####Bugs 11 | 12 | - Fix scalebar not show correctly when pixelRatio is set [#1104](https://github.com/mapbox/mapbox-plugins-android/pull/1104) 13 | 14 | ### mapbox-android-plugin-scalebar-v9:0.4.0 - March 5, 2020 15 | #### Features 16 | - Switching all plugins to AndroidX [#1100](https://github.com/mapbox/mapbox-plugins-android/pull/1100) 17 | #### Bugs 18 | - Fix scale bar incorrect scale [#1088](https://github.com/mapbox/mapbox-plugins-android/pull/1088) 19 | 20 | ### mapbox-android-plugin-scalebar-v8:0.3.0 - August 20, 2019 21 | 22 | #### Features 23 | - Refactor plugins state management in case of widget recreation [#1033](https://github.com/mapbox/mapbox-plugins-android/pull/1033) 24 | 25 | #### Bugs 26 | - Listen for camera idle event [#1035](https://github.com/mapbox/mapbox-plugins-android/pull/1035) 27 | - Invalidate the widget when plugin is toggled [#1036](https://github.com/mapbox/mapbox-plugins-android/pull/1036) 28 | 29 | 30 | ### mapbox-android-plugin-scalebar-v8:0.2.0 - July 29, 2019 31 | 32 | #### Bugs 33 | - Change the unit of scalebar according distance [#1010](https://github.com/mapbox/mapbox-plugins-android/pull/1010) 34 | - Remove .0 from distance text in scale bar [#1014](https://github.com/mapbox/mapbox-plugins-android/pull/1014) 35 | 36 | ### mapbox-android-plugin-scalebar-v8:0.1.0 - June 11, 2019 37 | 38 | - Initial release as a standalone package. -------------------------------------------------------------------------------- /plugin-scalebar/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'kotlin-android' 3 | 4 | android { 5 | compileSdkVersion androidVersions.compileSdkVersion 6 | 7 | defaultConfig { 8 | minSdkVersion androidVersions.minSdkVersion 9 | targetSdkVersion androidVersions.targetSdkVersion 10 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 11 | } 12 | 13 | configurations { 14 | javadocDeps 15 | } 16 | 17 | lintOptions { 18 | abortOnError false 19 | } 20 | 21 | testOptions { 22 | unitTests.returnDefaultValues true 23 | } 24 | } 25 | 26 | dependencies { 27 | implementation dependenciesList.mapboxMapSdk 28 | implementation dependenciesList.supportAnnotation 29 | implementation dependenciesList.androidCore 30 | javadocDeps dependenciesList.mapboxMapSdk 31 | testImplementation dependenciesList.kotlin 32 | testImplementation dependenciesList.mockk 33 | testImplementation dependenciesList.junit 34 | } 35 | 36 | apply from: "${rootDir}/gradle/javadoc.gradle" 37 | apply from: "${rootDir}/gradle/publish.gradle" 38 | apply from: "${rootDir}/gradle/checkstyle.gradle" 39 | -------------------------------------------------------------------------------- /plugin-scalebar/gradle.properties: -------------------------------------------------------------------------------- 1 | VERSION_NAME=0.6.0-SNAPSHOT 2 | POM_ARTIFACT_ID=mapbox-android-plugin-scalebar-v9 3 | POM_NAME=Mapbox Android Scalebar Plugin 4 | POM_DESCRIPTION=Mapbox Android Scalebar Plugin 5 | REGISTRY_SDK_NAME=com-mapbox-mapboxsdk-mapbox-android-plugin-scalebar-v9 6 | -------------------------------------------------------------------------------- /plugin-scalebar/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 | -------------------------------------------------------------------------------- /plugin-scalebar/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /plugin-scalebar/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8dp 4 | 10dp 5 | 2dp 6 | 8dp 7 | 1dp 8 | 2dp 9 | 2dp 10 | -------------------------------------------------------------------------------- /plugin-traffic/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog for the Mapbox traffic plugin 2 | 3 | ### mapbox-android-plugin-traffic-v9:0.10.0 - March 5, 2020 4 | #### Features 5 | - Switching all plugins to AndroidX [#1100](https://github.com/mapbox/mapbox-plugins-android/pull/1100) 6 | 7 | ### mapbox-android-plugin-traffic-v8:0.9.0 - June 11, 2019 8 | 9 | No changes since last release. Release happened to update the module to `-v8`. 10 | 11 | ### mapbox-android-plugin-traffic-v7:0.8.0 - January 8, 2019 12 | - Update Traffic plugin with the Maps SDK v7.0.0 [#793](https://github.com/mapbox/mapbox-plugins-android/pull/793) 13 | - Traffic plugin update [#785](https://github.com/mapbox/mapbox-plugins-android/pull/785) 14 | 15 | ### 0.7.0 - May 23, 2018 16 | - Updates the Map SDK to 6.1.3 [#531](https://github.com/mapbox/mapbox-plugins-android/pull/531) 17 | 18 | ### 0.6.0 - May 7, 2018 19 | - Updates Map SDK to 6.1.1 [#488](https://github.com/mapbox/mapbox-plugins-android/pull/488) 20 | - Lowered min SDK to API level 14 to match Map SDK [#472](https://github.com/mapbox/mapbox-plugins-android/pull/472) 21 | 22 | ### 0.5.0 - April 18, 2018 23 | - Updates Map SDK to 6.0.1 24 | 25 | ### 0.4.0 - March 7, 2018 26 | - Updates Map SDK to 5.5.0 27 | - Resolves issue with traffic tileset not being able to load correctly [#275](https://github.com/mapbox/mapbox-plugins-android/pull/275) -------------------------------------------------------------------------------- /plugin-traffic/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion androidVersions.compileSdkVersion 5 | 6 | defaultConfig { 7 | minSdkVersion androidVersions.minSdkVersion 8 | targetSdkVersion androidVersions.targetSdkVersion 9 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 10 | } 11 | 12 | configurations { 13 | javadocDeps 14 | } 15 | 16 | lintOptions { 17 | abortOnError false 18 | } 19 | } 20 | 21 | dependencies { 22 | implementation dependenciesList.mapboxMapSdk 23 | implementation dependenciesList.supportAnnotation 24 | implementation dependenciesList.timber 25 | 26 | // Unit testing 27 | testImplementation dependenciesList.junit 28 | testImplementation dependenciesList.mockito 29 | 30 | javadocDeps dependenciesList.mapboxMapSdk 31 | } 32 | 33 | apply from: "${rootDir}/gradle/javadoc.gradle" 34 | apply from: "${rootDir}/gradle/publish.gradle" 35 | apply from: "${rootDir}/gradle/checkstyle.gradle" 36 | -------------------------------------------------------------------------------- /plugin-traffic/gradle.properties: -------------------------------------------------------------------------------- 1 | VERSION_NAME=0.11.0-SNAPSHOT 2 | POM_ARTIFACT_ID=mapbox-android-plugin-traffic-v9 3 | POM_NAME=Mapbox Android Traffic Plugin 4 | POM_DESCRIPTION=Mapbox Android Traffic Plugin 5 | REGISTRY_SDK_NAME=com-mapbox-mapboxsdk-mapbox-android-plugin-traffic-v9 6 | -------------------------------------------------------------------------------- /plugin-traffic/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /plugin-traffic/src/main/java/com/mapbox/mapboxsdk/plugins/traffic/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Contains logic used for the Mapbox Traffic Plugin. 3 | * 4 | * @since 0.1.0 5 | */ 6 | package com.mapbox.mapboxsdk.plugins.traffic; -------------------------------------------------------------------------------- /plugin-traffic/src/test/java/com/mapbox/mapboxsdk/plugins/traffic/TrafficPluginTest.java: -------------------------------------------------------------------------------- 1 | package com.mapbox.mapboxsdk.plugins.traffic; 2 | 3 | import com.mapbox.mapboxsdk.log.Logger; 4 | import com.mapbox.mapboxsdk.log.LoggerDefinition; 5 | import com.mapbox.mapboxsdk.maps.MapView; 6 | import com.mapbox.mapboxsdk.maps.MapboxMap; 7 | import com.mapbox.mapboxsdk.maps.Style; 8 | 9 | import org.junit.Rule; 10 | import org.junit.Test; 11 | import org.mockito.Mock; 12 | import org.mockito.junit.MockitoJUnit; 13 | import org.mockito.junit.MockitoRule; 14 | 15 | import static junit.framework.TestCase.assertFalse; 16 | import static org.junit.Assert.assertTrue; 17 | import static org.mockito.Mockito.mock; 18 | import static org.mockito.Mockito.when; 19 | 20 | public class TrafficPluginTest { 21 | 22 | @Mock 23 | private MapView mapView; 24 | 25 | @Mock 26 | private MapboxMap mapboxMap; 27 | 28 | @Mock 29 | private Style style; 30 | 31 | @Rule 32 | public MockitoRule mockitoRule = MockitoJUnit.rule(); 33 | 34 | @Test(expected = RuntimeException.class) 35 | public void testNonNullAnnotatedArgs() { 36 | new TrafficPlugin(null, null, null); 37 | } 38 | 39 | @Test 40 | public void testSanity() { 41 | when(style.isFullyLoaded()).thenReturn(true); 42 | new TrafficPlugin(mapView, mapboxMap, style); 43 | } 44 | 45 | @Test 46 | public void testToggle() { 47 | Logger.setLoggerDefinition(mock(LoggerDefinition.class)); 48 | when(style.isFullyLoaded()).thenReturn(true); 49 | TrafficPlugin trafficPlugin = new TrafficPlugin(mapView, mapboxMap, style); 50 | assertFalse(trafficPlugin.isVisible()); 51 | trafficPlugin.setVisibility(true); 52 | assertTrue(trafficPlugin.isVisible()); 53 | } 54 | 55 | @Test(expected = RuntimeException.class) 56 | public void testNotLoadedStyle() { 57 | when(style.isFullyLoaded()).thenReturn(false); 58 | new TrafficPlugin(mapView, mapboxMap, style); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /plugin-traffic/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline -------------------------------------------------------------------------------- /scripts/exclude-activity-gen.json: -------------------------------------------------------------------------------- 1 | [ 2 | "LocationLayerFragmentActivity", 3 | "OfflineDownloadActivity", 4 | "OfflineRegionListActivity", 5 | "OfflineUiComponentsActivity", 6 | "AutocompleteFragmentActivity", 7 | "PickerLauncherActivity", 8 | "CompassListenerActivity", 9 | "LocationLayerFragmentActivity", 10 | "LocationLayerMapChangeActivity", 11 | "LocationLayerModesActivity", 12 | "ManualLocationUpdatesActivity" 13 | ] 14 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | include ':plugin-traffic' 3 | include ':plugin-building' 4 | include ':plugin-places' 5 | include ':plugin-offline' 6 | include ':plugin-localization' 7 | include ':plugin-annotation' 8 | include ':plugin-markerview' 9 | include ':ktx-mapbox-maps' 10 | include ':plugin-scalebar' --------------------------------------------------------------------------------