├── map-sample
├── local.defaults.properties
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── app
│ └── src
│ │ └── main
│ │ ├── res
│ │ ├── drawable-hdpi
│ │ │ ├── arrow.png
│ │ │ ├── pegman.png
│ │ │ ├── badge_nsw.png
│ │ │ ├── badge_qld.png
│ │ │ ├── badge_sa.png
│ │ │ ├── ic_launcher.png
│ │ │ ├── badge_victoria.png
│ │ │ └── custom_info_bubble.9.png
│ │ ├── drawable-mdpi
│ │ │ ├── arrow.png
│ │ │ ├── pegman.png
│ │ │ ├── ic_launcher.png
│ │ │ └── custom_info_bubble.9.png
│ │ ├── drawable-nodpi
│ │ │ ├── ook.png
│ │ │ └── chevron.png
│ │ ├── drawable-xhdpi
│ │ │ ├── pegman.png
│ │ │ └── ic_launcher.png
│ │ ├── drawable-xxhdpi
│ │ │ ├── pegman.png
│ │ │ └── ic_launcher.png
│ │ ├── drawable
│ │ │ ├── harbour_bridge.jpg
│ │ │ ├── newark_nj_1922.png
│ │ │ └── newark_prudential_sunny.jpg
│ │ ├── drawable-ldpi
│ │ │ └── ic_launcher.png
│ │ ├── drawable-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ ├── raw
│ │ │ ├── outline_style.json
│ │ │ ├── blue_essence.json
│ │ │ ├── blue_water.json
│ │ │ ├── pale_dawn.json
│ │ │ ├── light_dream.json
│ │ │ └── black_and_white.json
│ │ ├── layout
│ │ │ ├── programmatic_demo.xml
│ │ │ ├── street_view_panorama_view_demo.xml
│ │ │ ├── text_fragment.xml
│ │ │ ├── indoor_demo.xml
│ │ │ ├── map_in_pager_demo.xml
│ │ │ ├── raw_view_demo_maps_flavor.xml
│ │ │ ├── day_night_circle_demo_maps_flavor.xml
│ │ │ ├── raw_view_demo_nav_flavor.xml
│ │ │ ├── day_night_circle_demo_nav_flavor.xml
│ │ │ ├── marker_close_info_window_on_retap_demo_maps_flavor.xml
│ │ │ ├── basic_demo_maps_flavor.xml
│ │ │ ├── marker_close_info_window_on_retap_demo_nav_flavor.xml
│ │ │ ├── street_view_panorama_basic_demo.xml
│ │ │ ├── basic_demo_nav_flavor.xml
│ │ │ ├── width_control_fragment.xml
│ │ │ ├── feature.xml
│ │ │ ├── tags_demo_maps_flavor.xml
│ │ │ ├── tags_demo_nav_flavor.xml
│ │ │ ├── save_state_demo_maps_flavor.xml
│ │ │ ├── save_state_demo_nav_flavor.xml
│ │ │ ├── other_options_control_fragment.xml
│ │ │ ├── options_demo_maps_flavor.xml
│ │ │ ├── options_demo_nav_flavor.xml
│ │ │ ├── tile_coordinate_demo_maps_flavor.xml
│ │ │ ├── events_demo_maps_flavor.xml
│ │ │ ├── tile_coordinate_demo_nav_flavor.xml
│ │ │ ├── events_demo_nav_flavor.xml
│ │ │ ├── joint_control_fragment.xml
│ │ │ ├── polyline_color_control_fragment.xml
│ │ │ ├── background_color_customization_programmatic_demo_maps_flavor.xml
│ │ │ ├── background_color_customization_programmatic_demo_nav_flavor.xml
│ │ │ ├── main.xml
│ │ │ ├── background_color_customization_demo_maps_flavor.xml
│ │ │ ├── background_color_customization_demo_nav_flavor.xml
│ │ │ ├── split_street_view_panorama_and_map_demo_maps_flavor.xml
│ │ │ ├── split_street_view_panorama_and_map_demo_nav_flavor.xml
│ │ │ ├── custom_info_contents.xml
│ │ │ ├── my_location_demo_maps_flavor.xml
│ │ │ ├── custom_info_window.xml
│ │ │ ├── my_location_demo_nav_flavor.xml
│ │ │ ├── street_view_panorama_events_demo.xml
│ │ │ ├── top_styles_demo_maps_flavor.xml
│ │ │ ├── top_styles_demo_nav_flavor.xml
│ │ │ ├── layers_demo_maps_flavor.xml
│ │ │ ├── layers_demo_nav_flavor.xml
│ │ │ ├── spans_control_fragment.xml
│ │ │ ├── street_view_anywhere_demo.xml
│ │ │ ├── snapshot_demo_maps_flavor.xml
│ │ │ ├── snapshot_demo_nav_flavor.xml
│ │ │ ├── pattern_control_fragment.xml
│ │ │ ├── street_view_multiple_panorama_demo.xml
│ │ │ ├── polygon_color_control_fragment.xml
│ │ │ ├── street_view_panorama_options_demo.xml
│ │ │ └── indoor_multimap_demo.xml
│ │ ├── values
│ │ │ └── common_strings.xml
│ │ └── layout-land
│ │ │ ├── snapshot_demo_nav_flavor.xml
│ │ │ └── snapshot_demo_maps_flavor.xml
│ │ └── java
│ │ └── com
│ │ └── example
│ │ └── mapdemo
│ │ ├── PolygonControlFragment.java
│ │ ├── PolylineControlFragment.java
│ │ ├── ActivityIntents.java
│ │ ├── ConversionUtils.java
│ │ ├── DemoDetails.java
│ │ ├── IndoorDemoActivity.java
│ │ ├── IndoorMultiMapDemoActivity.java
│ │ ├── MoonTileProvider.java
│ │ ├── OptionsDemoActivity.java
│ │ ├── FeatureView.java
│ │ ├── AnimationManager.java
│ │ ├── MoveDirection.java
│ │ ├── StreetViewPanoramaBasicDemoActivity.java
│ │ ├── PolylineOtherOptionsControlFragment.java
│ │ └── StreetViewMultiplePanoramaDemoActivity.java
├── settings.gradle
├── README.md
└── build.gradle
├── .gitignore
├── navigation-sample
├── local.defaults.properties
├── gradle.properties
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── app
│ ├── src
│ │ └── main
│ │ │ ├── res
│ │ │ ├── drawable
│ │ │ │ ├── ic_merge.png
│ │ │ │ ├── ic_road.png
│ │ │ │ ├── ic_depart.png
│ │ │ │ ├── ic_ferry_boat.png
│ │ │ │ ├── ic_fork_left.png
│ │ │ │ ├── ic_fork_right.png
│ │ │ │ ├── ic_merge_left.png
│ │ │ │ ├── ic_straight.png
│ │ │ │ ├── ic_turn_left.png
│ │ │ │ ├── ic_turn_right.png
│ │ │ │ ├── ic_destination.png
│ │ │ │ ├── ic_ferry_train.png
│ │ │ │ ├── ic_merge_right.png
│ │ │ │ ├── ic_turn_sharp_left.png
│ │ │ │ ├── ic_destination_left.png
│ │ │ │ ├── ic_destination_right.png
│ │ │ │ ├── ic_turn_sharp_right.png
│ │ │ │ ├── ic_turn_slight_left.png
│ │ │ │ ├── ic_turn_slight_right.png
│ │ │ │ ├── ic_roundabout_clockwise.png
│ │ │ │ ├── ic_turn_u_turn_clockwise.png
│ │ │ │ ├── ic_roundabout_exit_clockwise.png
│ │ │ │ ├── ic_roundabout_left_clockwise.png
│ │ │ │ ├── ic_roundabout_counterclockwise.png
│ │ │ │ ├── ic_roundabout_right_clockwise.png
│ │ │ │ ├── ic_roundabout_u_turn_clockwise.png
│ │ │ │ ├── ic_roundabout_straight_clockwise.png
│ │ │ │ ├── ic_turn_u_turn_counterclockwise.png
│ │ │ │ ├── ic_roundabout_exit_counterclockwise.png
│ │ │ │ ├── ic_roundabout_left_counterclockwise.png
│ │ │ │ ├── ic_roundabout_sharp_left_clockwise.png
│ │ │ │ ├── ic_roundabout_sharp_right_clockwise.png
│ │ │ │ ├── ic_roundabout_slight_left_clockwise.png
│ │ │ │ ├── ic_roundabout_right_counterclockwise.png
│ │ │ │ ├── ic_roundabout_slight_right_clockwise.png
│ │ │ │ ├── ic_roundabout_u_turn_counterclockwise.png
│ │ │ │ ├── ic_roundabout_straight_counterclockwise.png
│ │ │ │ ├── ic_roundabout_sharp_left_counterclockwise.png
│ │ │ │ ├── ic_roundabout_sharp_right_counterclockwise.png
│ │ │ │ ├── ic_roundabout_slight_left_counterclockwise.png
│ │ │ │ └── ic_roundabout_slight_right_counterclockwise.png
│ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── drawable-hdpi
│ │ │ │ ├── google_maps_logo.png
│ │ │ │ └── ic_navigation_white_24dp.png
│ │ │ ├── drawable-mdpi
│ │ │ │ ├── google_maps_logo.png
│ │ │ │ └── ic_navigation_white_24dp.png
│ │ │ ├── drawable-xhdpi
│ │ │ │ ├── google_maps_logo.png
│ │ │ │ └── ic_navigation_white_24dp.png
│ │ │ ├── drawable-xxhdpi
│ │ │ │ ├── google_maps_logo.png
│ │ │ │ └── ic_navigation_white_24dp.png
│ │ │ ├── drawable-xxxhdpi
│ │ │ │ ├── google_maps_logo.png
│ │ │ │ └── ic_navigation_white_24dp.png
│ │ │ ├── values
│ │ │ │ ├── dimens.xml
│ │ │ │ ├── colors.xml
│ │ │ │ └── styles.xml
│ │ │ ├── layout
│ │ │ │ ├── activity_swapping_map_and_nav.xml
│ │ │ │ ├── control_panels.xml
│ │ │ │ ├── spinner_item.xml
│ │ │ │ ├── activity_splash_screen.xml
│ │ │ │ ├── activity_place_picker.xml
│ │ │ │ ├── main.xml
│ │ │ │ ├── controls_nav.xml
│ │ │ │ ├── control_toggles_container.xml
│ │ │ │ ├── controls_map.xml
│ │ │ │ ├── controls_view.xml
│ │ │ │ ├── activity_nav_view.xml
│ │ │ │ └── activity_nav_fragment.xml
│ │ │ ├── values-w820dp
│ │ │ │ └── dimens.xml
│ │ │ └── menu
│ │ │ │ ├── menu_default.xml
│ │ │ │ └── menu_swapping_map_and_nav.xml
│ │ │ └── java
│ │ │ └── com
│ │ │ └── example
│ │ │ └── navigationapidemo
│ │ │ ├── SampleAppGlideModule.kt
│ │ │ ├── InitializedMapScope.kt
│ │ │ ├── InitializedNavScope.kt
│ │ │ └── MainActivity.kt
│ └── proguard-rules.pro
├── settings.gradle
├── README.md
└── build.gradle
├── .github
├── blunderbuss.yml
└── workflows
│ └── android.yml
├── NOTICE.txt
├── CONTRIBUTING.md
└── README.md
/map-sample/local.defaults.properties:
--------------------------------------------------------------------------------
1 | MAPS_API_KEY=YOUR_API_KEY
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | build/
2 | .gradle/
3 | local.properties
4 | .idea/
5 |
--------------------------------------------------------------------------------
/navigation-sample/local.defaults.properties:
--------------------------------------------------------------------------------
1 | MAPS_API_KEY=YOUR_API_KEY
--------------------------------------------------------------------------------
/map-sample/gradle.properties:
--------------------------------------------------------------------------------
1 | android.useAndroidX=true
2 | org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
--------------------------------------------------------------------------------
/.github/blunderbuss.yml:
--------------------------------------------------------------------------------
1 | assign_issues:
2 | - cwoodwar6
3 | - ArturoSalazarB16
4 | assign_prs:
5 | - cwoodwar6
6 | - ArturoSalazarB16
7 |
--------------------------------------------------------------------------------
/navigation-sample/gradle.properties:
--------------------------------------------------------------------------------
1 | android.useAndroidX=true
2 | org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
--------------------------------------------------------------------------------
/map-sample/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-hdpi/arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-hdpi/arrow.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-mdpi/arrow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-mdpi/arrow.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-nodpi/ook.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-nodpi/ook.png
--------------------------------------------------------------------------------
/navigation-sample/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-hdpi/pegman.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-hdpi/pegman.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-mdpi/pegman.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-mdpi/pegman.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-xhdpi/pegman.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-xhdpi/pegman.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-hdpi/badge_nsw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-hdpi/badge_nsw.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-hdpi/badge_qld.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-hdpi/badge_qld.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-hdpi/badge_sa.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-hdpi/badge_sa.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-nodpi/chevron.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-nodpi/chevron.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-xxhdpi/pegman.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-xxhdpi/pegman.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable/harbour_bridge.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable/harbour_bridge.jpg
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable/newark_nj_1922.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable/newark_nj_1922.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_merge.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_merge.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_road.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_road.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-ldpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-ldpi/ic_launcher.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_depart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_depart.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-hdpi/badge_victoria.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-hdpi/badge_victoria.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_ferry_boat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_ferry_boat.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_fork_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_fork_left.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_fork_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_fork_right.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_merge_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_merge_left.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_straight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_straight.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_turn_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_turn_left.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_turn_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_turn_right.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_destination.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_destination.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_ferry_train.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_ferry_train.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_merge_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_merge_right.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-hdpi/custom_info_bubble.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-hdpi/custom_info_bubble.9.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable-mdpi/custom_info_bubble.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable-mdpi/custom_info_bubble.9.png
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/drawable/newark_prudential_sunny.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/map-sample/app/src/main/res/drawable/newark_prudential_sunny.jpg
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_turn_sharp_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_turn_sharp_left.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_destination_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_destination_left.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_destination_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_destination_right.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_turn_sharp_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_turn_sharp_right.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_turn_slight_left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_turn_slight_left.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_turn_slight_right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_turn_slight_right.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable-hdpi/google_maps_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable-hdpi/google_maps_logo.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable-mdpi/google_maps_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable-mdpi/google_maps_logo.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable-xhdpi/google_maps_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable-xhdpi/google_maps_logo.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable-xxhdpi/google_maps_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable-xxhdpi/google_maps_logo.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_clockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_clockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable-xxxhdpi/google_maps_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable-xxxhdpi/google_maps_logo.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_turn_u_turn_clockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_turn_u_turn_clockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_exit_clockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_exit_clockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_left_clockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_left_clockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable-hdpi/ic_navigation_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable-hdpi/ic_navigation_white_24dp.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable-mdpi/ic_navigation_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable-mdpi/ic_navigation_white_24dp.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable-xhdpi/ic_navigation_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable-xhdpi/ic_navigation_white_24dp.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_counterclockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_counterclockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_right_clockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_right_clockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_u_turn_clockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_u_turn_clockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable-xxhdpi/ic_navigation_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable-xxhdpi/ic_navigation_white_24dp.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable-xxxhdpi/ic_navigation_white_24dp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable-xxxhdpi/ic_navigation_white_24dp.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_straight_clockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_straight_clockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_turn_u_turn_counterclockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_turn_u_turn_counterclockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_exit_counterclockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_exit_counterclockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_left_counterclockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_left_counterclockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_sharp_left_clockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_sharp_left_clockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_sharp_right_clockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_sharp_right_clockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_slight_left_clockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_slight_left_clockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_right_counterclockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_right_counterclockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_slight_right_clockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_slight_right_clockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_u_turn_counterclockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_u_turn_counterclockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_straight_counterclockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_straight_counterclockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_sharp_left_counterclockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_sharp_left_counterclockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_sharp_right_counterclockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_sharp_right_counterclockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_slight_left_counterclockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_slight_left_counterclockwise.png
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/drawable/ic_roundabout_slight_right_counterclockwise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/googlemaps-samples/android-navigation-samples/HEAD/navigation-sample/app/src/main/res/drawable/ic_roundabout_slight_right_counterclockwise.png
--------------------------------------------------------------------------------
/NOTICE.txt:
--------------------------------------------------------------------------------
1 | Google Maps/Google Earth Additional Terms of Service available at:
2 | https://www.google.com/help/terms_maps.html
3 |
4 | Legal Notices for Google Maps and Google Maps APIs available at:
5 | https://www.google.com/help/legalnotices_maps.html
6 |
--------------------------------------------------------------------------------
/map-sample/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/navigation-sample/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/raw/outline_style.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "elementType": "labels.text.stroke",
4 | "stylers": [
5 | {
6 | "visibility": "on"
7 | },
8 | {
9 | "color": "#ff0000"
10 | },
11 | {
12 | "lightness": 16
13 | }
14 | ]
15 | }
16 | ]
17 |
--------------------------------------------------------------------------------
/map-sample/settings.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | include ':app'
17 |
--------------------------------------------------------------------------------
/navigation-sample/settings.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 | include ':app'
17 |
--------------------------------------------------------------------------------
/.github/workflows/android.yml:
--------------------------------------------------------------------------------
1 | name: Android CI
2 |
3 | on:
4 | push:
5 | branches: [ "main" ]
6 | pull_request:
7 | branches: [ "main" ]
8 |
9 | jobs:
10 | build:
11 |
12 | runs-on: ubuntu-latest
13 |
14 | steps:
15 | - uses: actions/checkout@v4
16 | - name: set up JDK 21
17 | uses: actions/setup-java@v3
18 | with:
19 | java-version: '21'
20 | distribution: 'temurin'
21 | cache: gradle
22 |
23 | - name: Grant execute permission for gradlew
24 | run: chmod +x map-sample/gradlew && chmod +x navigation-sample/gradlew
25 | - name: Build map-sample with Gradle
26 | run: cd map-sample && ./gradlew build
27 | - name: Build navigation-sample with Gradle
28 | run: cd navigation-sample && ./gradlew build
29 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | 10dp
20 | 14sp
21 | 48dp
22 |
23 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | #3F51B5
20 | #303F9F
21 | #FF4081
22 | #555555
23 |
24 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/programmatic_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
23 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/street_view_panorama_view_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/text_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/values/common_strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 | GoogleMap demo
20 | Demonstrating behaviors with …
21 | MapView
22 | NavView
23 |
24 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/layout/activity_swapping_map_and_nav.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
25 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/java/com/example/navigationapidemo/SampleAppGlideModule.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.navigationapidemo
18 |
19 | import com.bumptech.glide.annotation.GlideModule
20 | import com.bumptech.glide.module.AppGlideModule
21 |
22 | /** An AppGlideModule implementation for Glide's Generated APIs */
23 | @GlideModule class SampleAppGlideModule : AppGlideModule()
24 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/java/com/example/navigationapidemo/InitializedMapScope.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.navigationapidemo
18 |
19 | import com.google.android.gms.maps.GoogleMap
20 |
21 | /**
22 | * Used in [NavViewActivity.withMapAsync] and [NavFragmentActivity.withMapAsync] to provide
23 | * asynchronous access to the Google Map.
24 | */
25 | interface InitializedMapScope {
26 | val map: GoogleMap
27 | }
28 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
21 | 64dp
22 |
23 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/layout/control_panels.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
18 |
19 |
20 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/indoor_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
27 |
28 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/map_in_pager_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
26 |
27 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/java/com/example/navigationapidemo/InitializedNavScope.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.navigationapidemo
18 |
19 | import com.google.android.libraries.navigation.Navigator
20 |
21 | /**
22 | * Used with in [NavViewActivity.withNavigatorAsync] and [NavFragmentActivity.withNavigatorAsync] to
23 | * provide asynchronous access to the Navigator.
24 | */
25 | open class InitializedNavScope(val navigator: Navigator)
26 |
27 | typealias InitializedNavRunnable = InitializedNavScope.() -> Unit
28 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/layout/spinner_item.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
28 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/java/com/example/mapdemo/PolygonControlFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.mapdemo;
18 |
19 | import androidx.fragment.app.Fragment;
20 | import com.google.android.gms.maps.model.Polygon;
21 |
22 | /** Polygon Control Fragment. */
23 | public abstract class PolygonControlFragment extends Fragment {
24 | protected Polygon polygon;
25 |
26 | public void setPolygon(Polygon polygon) {
27 | this.polygon = polygon;
28 | refresh();
29 | }
30 |
31 | public abstract void refresh();
32 | }
33 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/raw_view_demo_maps_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
23 |
27 |
28 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/java/com/example/mapdemo/PolylineControlFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.mapdemo;
18 |
19 | import androidx.fragment.app.Fragment;
20 | import com.google.android.gms.maps.model.Polyline;
21 |
22 | /** Polyline control fragment. */
23 | public abstract class PolylineControlFragment extends Fragment {
24 | protected Polyline polyline;
25 |
26 | public void setPolyline(Polyline polyline) {
27 | this.polyline = polyline;
28 | refresh();
29 | }
30 |
31 | public abstract void refresh();
32 | }
33 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/day_night_circle_demo_maps_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
23 |
28 |
29 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/raw_view_demo_nav_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
23 |
27 |
28 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/layout/activity_splash_screen.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
25 |
29 |
30 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/day_night_circle_demo_nav_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
23 |
28 |
29 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/java/com/example/mapdemo/ActivityIntents.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.mapdemo;
18 |
19 | /** Utilities related to the Intents that start demo Activities. */
20 | final class ActivityIntents {
21 |
22 | /**
23 | * Identifier for extra that indicates whether to inflate the NavigationView flavor or the MapView
24 | * flavor of the corresponding demo.
25 | */
26 | public static final String EXTRA_SHOULD_USE_NAVIGATION_FLAVOR_FOR_DEMO =
27 | "should_use_navigation_flavor_for_demo";
28 |
29 | private ActivityIntents() {}
30 | }
31 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/marker_close_info_window_on_retap_demo_maps_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
28 |
29 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # How to Contribute
2 |
3 | We'd love to accept your patches and contributions to this project. There are
4 | just a few small guidelines you need to follow.
5 |
6 | ## Contributor License Agreement
7 |
8 | Contributions to this project must be accompanied by a Contributor License
9 | Agreement (CLA). You (or your employer) retain the copyright to your
10 | contribution; this simply gives us permission to use and redistribute your
11 | contributions as part of the project. Head over to
12 | to see your current agreements on file or
13 | to sign a new one.
14 |
15 | You generally only need to submit a CLA once, so if you've already submitted one
16 | (even if it was for a different project), you probably don't need to do it
17 | again.
18 |
19 | ## Code reviews
20 |
21 | All submissions, including submissions by project members, require review. We
22 | use GitHub pull requests for this purpose. Consult
23 | [GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
24 | information on using pull requests.
25 |
26 | ## Community Guidelines
27 |
28 | This project follows
29 | [Google's Open Source Community Guidelines](https://opensource.google/conduct/).
30 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/basic_demo_maps_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
23 |
28 |
29 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/marker_close_info_window_on_retap_demo_nav_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
28 |
29 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/street_view_panorama_basic_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
23 |
28 |
29 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/menu/menu_default.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
28 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/layout/activity_place_picker.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
28 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/basic_demo_nav_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
19 |
23 |
28 |
29 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/menu/menu_swapping_map_and_nav.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
29 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/width_control_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
26 |
31 |
32 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/feature.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
29 |
34 |
35 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/tags_demo_maps_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
27 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/tags_demo_nav_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
27 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/java/com/example/mapdemo/ConversionUtils.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.mapdemo;
18 |
19 | import com.google.android.gms.maps.GoogleMap.OnCameraMoveStartedListener;
20 |
21 | /** A utility class with methods to convert one objet type to another. */
22 | public final class ConversionUtils {
23 | public static String toAnimationReasonString(int reason) {
24 | switch (reason) {
25 | case OnCameraMoveStartedListener.REASON_GESTURE:
26 | return "REASON_GESTURE";
27 | case OnCameraMoveStartedListener.REASON_API_ANIMATION:
28 | return "REASON_API_ANIMATION";
29 | case OnCameraMoveStartedListener.REASON_DEVELOPER_ANIMATION:
30 | return "REASON_DEVELOPER_ANIMATION";
31 | default:
32 | return "Unknown";
33 | }
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/save_state_demo_maps_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
24 |
29 |
30 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/save_state_demo_nav_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
24 |
29 |
30 |
35 |
36 |
37 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/java/com/example/mapdemo/DemoDetails.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.mapdemo;
18 |
19 | import android.app.Activity;
20 |
21 | /** A simple POJO that holds the details about the demo that are used by the List Adapter. */
22 | public class DemoDetails {
23 | /** The resource id of the title of the demo. */
24 | public final int titleId;
25 |
26 | /** The resources id of the description of the demo. */
27 | public final int descriptionId;
28 |
29 | /** The demo activity's class. */
30 | public final Class extends Activity> activityClass;
31 |
32 | public DemoDetails(int titleId, int descriptionId, Class extends Activity> activityClass) {
33 | this.titleId = titleId;
34 | this.descriptionId = descriptionId;
35 | this.activityClass = activityClass;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/other_options_control_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
26 |
30 |
34 |
35 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
33 |
37 |
38 |
--------------------------------------------------------------------------------
/navigation-sample/README.md:
--------------------------------------------------------------------------------
1 | # Google Navigation SDK Sample Project
2 |
3 | This sample project provides an example of using the Google Navigation SDK in an
4 | Android Studio project.
5 |
6 | ## Installation
7 |
8 | - Open this sample app in Android Studio.
9 |
10 | - This demo app is compatible with a range of supported Navigation SDK
11 | versions, as indicated by the name of the containing .zip file in Google
12 | Drive.
13 |
14 | - A default compatible version number has been supplied in the app-level
15 | `build.gradle` file under the variable named `navSdkVersion`. Make sure to
16 | update that variable's value to the version of NavSDK you'd like to test.
17 |
18 | - Update the YOUR_API_KEY value in the local.defaults.properties to your own
19 | API key from a project that has been authorized to use the Google Navigation
20 | SDK. This API key must also have access to the Google Places API enabled in
21 | order to be able to search for places in the sample application.
22 | See [instructions](https://developers.google.com/maps/documentation/android-sdk/start#get-key)
23 | for how to get your own key and learn more about
24 | [Secrets Gradle plugin](https://developers.google.com/maps/documentation/android-sdk/secrets-gradle-plugin)
25 | to keep the key out of version control systems.
26 |
27 | - In the **Gradle Scripts folder**, open the `gradle.properties` file and add
28 | the following if not already present: `android.useAndroidX=true`
29 |
30 | - Build and run the sample application.
31 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/java/com/example/mapdemo/IndoorDemoActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.mapdemo;
18 |
19 | import android.os.Bundle;
20 | import androidx.appcompat.app.AppCompatActivity;
21 | import com.example.mapdemo.EdgeToEdgeUtil.EdgeToEdgeMarginConfig;
22 | import com.google.common.collect.ImmutableList;
23 |
24 | /** Demo of indoor maps. */
25 | public class IndoorDemoActivity extends AppCompatActivity {
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 | setContentView(R.layout.indoor_demo);
31 | // Margins are only set if the edge-to-edge mode is enabled, it's enabled by default for Android
32 | // V+ devices.
33 | // No margins are set for pre-Android V devices.
34 | EdgeToEdgeUtil.setMarginForEdgeToEdgeSupport(
35 | ImmutableList.of(
36 | EdgeToEdgeMarginConfig.builder().setView(findViewById(R.id.layout_container)).build()));
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/java/com/example/mapdemo/IndoorMultiMapDemoActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.mapdemo;
18 |
19 | import android.os.Bundle;
20 | import androidx.appcompat.app.AppCompatActivity;
21 | import com.example.mapdemo.EdgeToEdgeUtil.EdgeToEdgeMarginConfig;
22 | import com.google.common.collect.ImmutableList;
23 |
24 | /** Demo for indoor multimaps. */
25 | public class IndoorMultiMapDemoActivity extends AppCompatActivity {
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 | setContentView(R.layout.indoor_multimap_demo);
31 | // Margins are only set if the edge-to-edge mode is enabled, it's enabled by default for Android
32 | // V+ devices.
33 | // No margins are set for pre-Android V devices.
34 | EdgeToEdgeUtil.setMarginForEdgeToEdgeSupport(
35 | ImmutableList.of(
36 | EdgeToEdgeMarginConfig.builder().setView(findViewById(R.id.layout_container)).build()));
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/options_demo_maps_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
41 |
42 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/options_demo_nav_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
41 |
42 |
--------------------------------------------------------------------------------
/navigation-sample/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users//Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | #glide start
20 | -keep public class * implements com.bumptech.glide.module.GlideModule
21 | -keep public class * extends com.bumptech.glide.module.AppGlideModule
22 | -keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
23 | **[] $VALUES;
24 | public *;
25 | }
26 | #glide end
27 |
28 | #okhttp start
29 | # JSR 305 annotations are for embedding nullability information.
30 | -dontwarn javax.annotation.**
31 |
32 | # A resource is loaded with a relative path so the package of this class must be preserved.
33 | -keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
34 |
35 | # Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
36 | -dontwarn org.codehaus.mojo.animal_sniffer.*
37 |
38 | # OkHttp platform used only on JVM and when Conscrypt dependency is available.
39 | -dontwarn okhttp3.internal.platform.ConscryptPlatform
40 | #okhttp end
41 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/layout/controls_nav.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
32 |
33 |
41 |
42 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/java/com/example/mapdemo/MoonTileProvider.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.mapdemo;
18 |
19 | import com.google.android.gms.maps.model.UrlTileProvider;
20 | import java.net.MalformedURLException;
21 | import java.net.URL;
22 | import java.util.Locale;
23 |
24 | /** Provider of "moon" raster tiles. */
25 | public class MoonTileProvider extends UrlTileProvider {
26 |
27 | private static final String MOON_MAP_URL_FORMAT =
28 | "http://mw1.google.com/mw-planetary/lunar/lunarmaps_v1/clem_bw/%d/%d/%d.jpg";
29 |
30 | public MoonTileProvider() {
31 | super(256 /* width */, 256 /* height */);
32 | }
33 |
34 | @Override
35 | public URL getTileUrl(int x, int y, int zoom) {
36 | // The moon tile coordinate system is reversed. This is not normal.
37 | int reversedY = (1 << zoom) - y - 1;
38 | String s = String.format(Locale.US, MOON_MAP_URL_FORMAT, zoom, x, reversedY);
39 | try {
40 | return new URL(s);
41 | } catch (MalformedURLException e) {
42 | throw new RuntimeException(e);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/layout/control_toggles_container.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
24 |
29 |
30 |
35 |
36 |
41 |
42 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/raw/blue_essence.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "featureType": "landscape.natural",
4 | "elementType": "geometry.fill",
5 | "stylers": [
6 | {
7 | "visibility": "on"
8 | },
9 | {
10 | "color": "#e0efef"
11 | }
12 | ]
13 | },
14 | {
15 | "featureType": "poi",
16 | "elementType": "geometry.fill",
17 | "stylers": [
18 | {
19 | "visibility": "on"
20 | },
21 | {
22 | "hue": "#1900ff"
23 | },
24 | {
25 | "color": "#c0e8e8"
26 | }
27 | ]
28 | },
29 | {
30 | "featureType": "road",
31 | "elementType": "geometry",
32 | "stylers": [
33 | {
34 | "lightness": 100
35 | },
36 | {
37 | "visibility": "simplified"
38 | }
39 | ]
40 | },
41 | {
42 | "featureType": "road",
43 | "elementType": "labels",
44 | "stylers": [
45 | {
46 | "visibility": "off"
47 | }
48 | ]
49 | },
50 | {
51 | "featureType": "transit.line",
52 | "elementType": "geometry",
53 | "stylers": [
54 | {
55 | "visibility": "on"
56 | },
57 | {
58 | "lightness": 700
59 | }
60 | ]
61 | },
62 | {
63 | "featureType": "water",
64 | "elementType": "all",
65 | "stylers": [
66 | {
67 | "color": "#7dcdcd"
68 | }
69 | ]
70 | }
71 | ]
72 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/tile_coordinate_demo_maps_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
27 |
32 |
36 |
37 |
42 |
43 |
--------------------------------------------------------------------------------
/map-sample/README.md:
--------------------------------------------------------------------------------
1 | # Google Navigation SDK: GoogleMap Demo
2 |
3 | This sample project provides examples for how the Navigation SDK supports map
4 | styling and features through the "GoogleMap" entry point.
5 |
6 | ## Description
7 |
8 | The source code will look familiar if you've used the
9 | [Google Maps API demos](https://github.com/googlemaps/android-samples/) before.
10 |
11 | The toggle switch at the top of the app will allow you to select what kind of
12 | view is stressed as part of each demo. If you choose the "MapView" toggle, the
13 | demo will use a MapView or SupportMapFragment as part of the UI. If you choose
14 | the "NavView" toggle, the demo will use a NavigationView or
15 | SupportNavigationFragment as part of the UI.
16 |
17 | This is to showcase that NavigationView supports the behaviors you may have come
18 | to expect from your previous usage of the public Maps APIs.
19 |
20 | ## Installation
21 |
22 | - Open this sample app in Android Studio.
23 |
24 | - This demo app is compatible with a range of supported Navigation SDK
25 | versions, as indicated by the name of the containing .zip file in Google
26 | Drive.
27 |
28 | - A default compatible version number has been supplied in the app-level
29 | `build.gradle` file under the variable named `navSdkVersion`. Make sure to
30 | update that variable's value to the version of NavSDK you'd like to test.
31 |
32 | - Update the YOUR_API_KEY value in local.defaults.properties to your own API
33 | key that has been authorized to use the Google Navigation SDK. Visit
34 | https://developers.google.com/maps/documentation/android-sdk/start#get-key
35 | for instructions on how to get your own key.
36 |
37 | - Build and run the sample application.
38 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/events_demo_maps_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
27 |
32 |
37 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/tile_coordinate_demo_nav_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
27 |
32 |
36 |
37 |
42 |
43 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/events_demo_nav_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
27 |
32 |
37 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/joint_control_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
20 |
27 |
32 |
35 |
38 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/polyline_color_control_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
26 |
28 |
30 |
31 |
35 |
37 |
39 |
40 |
44 |
46 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/background_color_customization_programmatic_demo_maps_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
28 |
33 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/background_color_customization_programmatic_demo_nav_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
28 |
33 |
40 |
41 |
42 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/main.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
28 |
33 |
39 |
40 |
45 |
46 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/raw/blue_water.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "featureType": "administrative",
4 | "elementType": "labels.text.fill",
5 | "stylers": [
6 | {
7 | "color": "#444444"
8 | }
9 | ]
10 | },
11 | {
12 | "featureType": "landscape",
13 | "elementType": "all",
14 | "stylers": [
15 | {
16 | "color": "#f2f2f2"
17 | }
18 | ]
19 | },
20 | {
21 | "featureType": "poi",
22 | "elementType": "all",
23 | "stylers": [
24 | {
25 | "visibility": "off"
26 | }
27 | ]
28 | },
29 | {
30 | "featureType": "road",
31 | "elementType": "all",
32 | "stylers": [
33 | {
34 | "saturation": -100
35 | },
36 | {
37 | "lightness": 45
38 | }
39 | ]
40 | },
41 | {
42 | "featureType": "road.highway",
43 | "elementType": "all",
44 | "stylers": [
45 | {
46 | "visibility": "simplified"
47 | }
48 | ]
49 | },
50 | {
51 | "featureType": "road.arterial",
52 | "elementType": "labels.icon",
53 | "stylers": [
54 | {
55 | "visibility": "off"
56 | }
57 | ]
58 | },
59 | {
60 | "featureType": "transit",
61 | "elementType": "all",
62 | "stylers": [
63 | {
64 | "visibility": "off"
65 | }
66 | ]
67 | },
68 | {
69 | "featureType": "water",
70 | "elementType": "all",
71 | "stylers": [
72 | {
73 | "color": "#46bcec"
74 | },
75 | {
76 | "visibility": "on"
77 | }
78 | ]
79 | }
80 | ]
81 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/background_color_customization_demo_maps_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
29 |
34 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/java/com/example/mapdemo/OptionsDemoActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.mapdemo;
18 |
19 | import android.os.Bundle;
20 | import androidx.appcompat.app.AppCompatActivity;
21 | import com.example.mapdemo.EdgeToEdgeUtil.EdgeToEdgeMarginConfig;
22 | import com.google.common.collect.ImmutableList;
23 |
24 | /** An activity that creates a map with some initial options. */
25 | public final class OptionsDemoActivity extends AppCompatActivity {
26 |
27 | @Override
28 | protected void onCreate(Bundle savedInstanceState) {
29 | super.onCreate(savedInstanceState);
30 | if (getIntent()
31 | .getBooleanExtra(
32 | ActivityIntents.EXTRA_SHOULD_USE_NAVIGATION_FLAVOR_FOR_DEMO,
33 | /* defaultValue= */ false)) {
34 | setContentView(R.layout.options_demo_nav_flavor);
35 | } else {
36 | setContentView(R.layout.options_demo_maps_flavor);
37 | }
38 |
39 | // Margins are only set if the edge-to-edge mode is enabled, it's enabled by default for Android
40 | // V+ devices.
41 | // No margins are set for pre-Android V devices.
42 | EdgeToEdgeUtil.setMarginForEdgeToEdgeSupport(
43 | ImmutableList.of(
44 | EdgeToEdgeMarginConfig.builder().setView(findViewById(R.id.layout_container)).build()));
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/background_color_customization_demo_nav_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
29 |
34 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/map-sample/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
18 |
19 | buildscript {
20 | repositories {
21 | mavenCentral()
22 | google()
23 | }
24 | dependencies {
25 | classpath 'com.android.tools.build:gradle:8.7.3'
26 | classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
27 |
28 | // NOTE: Do not place your application dependencies here; they belong
29 | // in the individual module build.gradle files
30 | }
31 | }
32 |
33 | plugins {
34 | id 'org.jetbrains.kotlin.android' version '2.1.10' apply false
35 | }
36 |
37 | allprojects {
38 | repositories {
39 | mavenCentral()
40 | }
41 | // Required: you must exclude the Google play service Maps SDK from
42 | // your transitive dependencies. This is to ensure there won't be
43 | // multiple copies of Google Maps SDK in your binary, as navigation SDK
44 | // already bundles the Google Maps SDK.
45 | configurations {
46 | implementation {
47 | exclude group: 'com.google.android.gms', module: 'play-services-maps'
48 | }
49 | }
50 | }
51 |
52 | task clean(type: Delete) {
53 | delete rootProject.buildDir
54 | }
55 |
--------------------------------------------------------------------------------
/navigation-sample/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
18 |
19 | buildscript {
20 | repositories {
21 | mavenCentral()
22 | google()
23 | }
24 | dependencies {
25 | classpath 'com.android.tools.build:gradle:8.7.3'
26 | classpath "com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.1"
27 |
28 | // NOTE: Do not place your application dependencies here; they belong
29 | // in the individual module build.gradle files
30 | }
31 | }
32 |
33 | plugins {
34 | id 'org.jetbrains.kotlin.android' version '2.1.10' apply false
35 | }
36 |
37 | allprojects {
38 | repositories {
39 | mavenCentral()
40 | }
41 | // Required: you must exclude the Google play service Maps SDK from
42 | // your transitive dependencies. This is to ensure there won't be
43 | // multiple copies of Google Maps SDK in your binary, as navigation SDK
44 | // already bundles the Google Maps SDK.
45 | configurations {
46 | implementation {
47 | exclude group: 'com.google.android.gms', module: 'play-services-maps'
48 | }
49 | }
50 | }
51 |
52 | task clean(type: Delete) {
53 | delete rootProject.buildDir
54 | }
55 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/split_street_view_panorama_and_map_demo_maps_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
30 |
36 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/split_street_view_panorama_and_map_demo_nav_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
30 |
36 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/java/com/example/mapdemo/FeatureView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.mapdemo;
18 |
19 | import android.content.Context;
20 | import android.view.LayoutInflater;
21 | import android.widget.FrameLayout;
22 | import android.widget.TextView;
23 |
24 | /** A widget that describes an activity that demonstrates a feature. */
25 | public final class FeatureView extends FrameLayout {
26 |
27 | /** Constructs a feature view by inflating layout/feature.xml. */
28 | public FeatureView(Context context) {
29 | super(context);
30 |
31 | LayoutInflater layoutInflater =
32 | (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
33 | layoutInflater.inflate(R.layout.feature, this);
34 | }
35 |
36 | /**
37 | * Set the resource id of the title of the demo.
38 | *
39 | * @param titleId the resource id of the title of the demo
40 | */
41 | public synchronized void setTitleId(int titleId) {
42 | ((TextView) (findViewById(R.id.title))).setText(titleId);
43 | }
44 |
45 | /**
46 | * Set the resource id of the description of the demo.
47 | *
48 | * @param descriptionId the resource id of the description of the demo
49 | */
50 | public synchronized void setDescriptionId(int descriptionId) {
51 | ((TextView) (findViewById(R.id.description))).setText(descriptionId);
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/layout/controls_map.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
32 |
33 |
41 |
42 |
49 |
50 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/custom_info_contents.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
30 |
31 |
35 |
45 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/my_location_demo_maps_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
27 |
36 |
43 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/layout/controls_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
25 |
26 |
34 |
35 |
43 |
44 |
51 |
52 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/custom_info_window.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
31 |
32 |
36 |
46 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/my_location_demo_nav_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
27 |
36 |
43 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/layout/activity_nav_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
23 |
27 |
28 |
33 |
34 |
41 |
42 |
43 |
44 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/raw/pale_dawn.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "featureType": "administrative",
4 | "elementType": "all",
5 | "stylers": [
6 | {
7 | "visibility": "on"
8 | },
9 | {
10 | "lightness": 33
11 | }
12 | ]
13 | },
14 | {
15 | "featureType": "landscape",
16 | "elementType": "all",
17 | "stylers": [
18 | {
19 | "color": "#f2e5d4"
20 | }
21 | ]
22 | },
23 | {
24 | "featureType": "poi.park",
25 | "elementType": "geometry",
26 | "stylers": [
27 | {
28 | "color": "#c5dac6"
29 | }
30 | ]
31 | },
32 | {
33 | "featureType": "poi.park",
34 | "elementType": "labels",
35 | "stylers": [
36 | {
37 | "visibility": "on"
38 | },
39 | {
40 | "lightness": 20
41 | }
42 | ]
43 | },
44 | {
45 | "featureType": "road",
46 | "elementType": "all",
47 | "stylers": [
48 | {
49 | "lightness": 20
50 | }
51 | ]
52 | },
53 | {
54 | "featureType": "road.highway",
55 | "elementType": "geometry",
56 | "stylers": [
57 | {
58 | "color": "#c5c6c6"
59 | }
60 | ]
61 | },
62 | {
63 | "featureType": "road.arterial",
64 | "elementType": "geometry",
65 | "stylers": [
66 | {
67 | "color": "#e4d7c6"
68 | }
69 | ]
70 | },
71 | {
72 | "featureType": "road.local",
73 | "elementType": "geometry",
74 | "stylers": [
75 | {
76 | "color": "#fbfaf7"
77 | }
78 | ]
79 | },
80 | {
81 | "featureType": "water",
82 | "elementType": "all",
83 | "stylers": [
84 | {
85 | "visibility": "on"
86 | },
87 | {
88 | "color": "#acbcc9"
89 | }
90 | ]
91 | }
92 | ]
93 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/street_view_panorama_events_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
27 |
32 |
37 |
42 |
47 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/top_styles_demo_maps_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
27 |
28 |
37 |
41 |
47 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/top_styles_demo_nav_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
27 |
28 |
37 |
41 |
47 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/res/layout/activity_nav_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
23 |
29 |
30 |
34 |
35 |
42 |
43 |
44 |
45 |
46 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Google Navigation SDK Sample Applications
2 |
3 | These sample applications provide an example of using the Google Navigation SDK in an Android Studio project.
4 |
5 | For more information about using the Navigation SDK for Android, see the [developer documentation](https://developers.google.com/maps/documentation/navigation/android-sdk).
6 |
7 | ## Description
8 |
9 | This repository contains two sample projects:
10 | 1. Map-sample: A showcase of the MapView and NavView UI.
11 | 2. Navigation-sample: The fundamental navigation experience.
12 |
13 | ## Contributing
14 |
15 | See the [Contributing guide](https://github.com/googlemaps-samples/android-navigation-samples/blob/main/CONTRIBUTING.md).
16 |
17 | ## Terms of Service
18 |
19 | This package uses Google Maps Platform services, and any use of Google Maps Platform is subject to the [Terms of Service](https://cloud.google.com/maps-platform/terms).
20 |
21 | For clarity, this package, and each underlying component, is not a Google Maps Platform Core Service.
22 |
23 | ## Support
24 |
25 | This package is offered via an open source license. It is not governed by the Google Maps Platform Support [Technical Support Services Guidelines](https://cloud.google.com/maps-platform/terms/tssg), the [SLA](https://cloud.google.com/maps-platform/terms/sla), or the [Deprecation Policy](https://cloud.google.com/maps-platform/terms) (however, any Google Maps Platform services used by the library remain subject to the Google Maps Platform Terms of Service).
26 |
27 | This package adheres to [semantic versioning](https://semver.org/) to indicate when backwards-incompatible changes are introduced. Accordingly, while the library is in version 0.x, backwards-incompatible changes may be introduced at any time.
28 |
29 | If you find a bug, or have a feature request, please [file an issue](https://github.com/googlemaps-samples/android-navigation-samples/issues) on GitHub. If you would like to get answers to technical questions from other Google Maps Platform developers, ask through one of our [developer community channels](https://developers.google.com/maps/developer-community). If you'd like to contribute, please check the [Contributing guide](https://github.com/googlemaps-samples/android-navigation-samples/blob/main/CONTRIBUTING.md).
30 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/layers_demo_maps_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
27 |
28 |
37 |
43 |
50 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/layers_demo_nav_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
27 |
28 |
37 |
43 |
50 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/spans_control_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
26 |
31 |
32 |
36 |
43 |
48 |
51 |
54 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/navigation-sample/app/src/main/java/com/example/navigationapidemo/MainActivity.kt:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.navigationapidemo
18 |
19 | import android.content.Intent
20 | import android.os.Bundle
21 | import android.widget.AdapterView.OnItemClickListener
22 | import android.widget.ArrayAdapter
23 | import android.widget.ListView
24 | import androidx.appcompat.app.AppCompatActivity
25 | import com.example.navigationapidemo.EdgeToEdgeUtil.EdgeToEdgeMarginConfig
26 |
27 | /** Main activity that lets the user choose a demo to launch. */
28 | class MainActivity : AppCompatActivity() {
29 | public override fun onCreate(savedInstanceState: Bundle?) {
30 | super.onCreate(savedInstanceState)
31 | setContentView(R.layout.main)
32 |
33 | // Margins are only set if the edge-to-edge mode is enabled, it's enabled by default for Android
34 | // V+ devices.
35 | // No margins are set for pre-Android V devices.
36 | EdgeToEdgeUtil.setMarginForEdgeToEdgeSupport(
37 | listOf(EdgeToEdgeMarginConfig(view = findViewById(R.id.main_layout_container)))
38 | )
39 |
40 | val listAdapter = ArrayAdapter(this, android.R.layout.simple_list_item_1, DEMOS.keys.toList())
41 | val listView = findViewById(R.id.list_view)
42 | listView.adapter = listAdapter
43 | listView.onItemClickListener = OnItemClickListener { parent, view, position, _ ->
44 | val demoName = parent.getItemAtPosition(position) as String
45 | startActivity(Intent(view.context, DEMOS[demoName]))
46 | }
47 | }
48 |
49 | companion object {
50 | private val DEMOS =
51 | mapOf>(
52 | "NavViewActivity" to NavViewActivity::class.java,
53 | "NavFragmentActivity" to NavFragmentActivity::class.java,
54 | "SwappingMapAndNavActivity" to SwappingMapAndNavActivity::class.java,
55 | )
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout-land/snapshot_demo_nav_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
27 |
33 |
39 |
40 |
46 |
50 |
55 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/street_view_anywhere_demo.xml:
--------------------------------------------------------------------------------
1 |
16 |
17 |
22 |
26 |
30 |
36 |
37 |
41 |
45 |
49 |
55 |
56 |
61 |
62 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/snapshot_demo_maps_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
28 |
34 |
40 |
41 |
47 |
51 |
56 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout-land/snapshot_demo_maps_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
28 |
34 |
40 |
41 |
47 |
51 |
56 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/snapshot_demo_nav_flavor.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
23 |
28 |
34 |
40 |
41 |
47 |
51 |
56 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/java/com/example/mapdemo/AnimationManager.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.mapdemo;
18 |
19 | import android.os.Handler;
20 | import android.os.Looper;
21 |
22 | /** Simple manager for UI-thread animation. All methods must be invoked on the UI thread only. */
23 | public class AnimationManager {
24 | private static final double INITIAL_FRAME_RATE_FPS = 60.0;
25 |
26 | private final Handler animationHandler;
27 | private final Runnable animationRunnable;
28 |
29 | private double frameRateFps;
30 | private boolean running;
31 |
32 | public AnimationManager(final Runnable frameRunnable) {
33 | frameRateFps = INITIAL_FRAME_RATE_FPS;
34 | running = false;
35 | animationHandler = new Handler(Looper.getMainLooper());
36 |
37 | animationRunnable =
38 | new Runnable() {
39 | @Override
40 | public void run() {
41 | if (!running) {
42 | return;
43 | }
44 | frameRunnable.run();
45 | requestAnimationFrame();
46 | }
47 | };
48 | }
49 |
50 | private void requestAnimationFrame() {
51 | if (frameRateFps <= 0.0) {
52 | return;
53 | }
54 |
55 | long delayMs = (long) Math.floor(1000.0 / frameRateFps);
56 | animationHandler.postDelayed(animationRunnable, delayMs);
57 | }
58 |
59 | public void startAnimation() {
60 | if (running) {
61 | return;
62 | }
63 |
64 | requestAnimationFrame();
65 | running = true;
66 | }
67 |
68 | public void stopAnimation() {
69 | if (!running) {
70 | return;
71 | }
72 |
73 | animationHandler.removeCallbacks(animationRunnable);
74 | running = false;
75 | }
76 |
77 | public void setFrameRateFps(double frameRateFps) {
78 | this.frameRateFps = frameRateFps;
79 | }
80 |
81 | public double getFrameRateFps() {
82 | return frameRateFps;
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/java/com/example/mapdemo/MoveDirection.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.mapdemo;
18 |
19 | import com.google.android.gms.maps.model.LatLng;
20 | import java.util.ArrayList;
21 | import java.util.List;
22 |
23 | /** Helper to translate all given LatLngs by the same amount in one of the predefined directions. */
24 | public enum MoveDirection {
25 | UP(1, 0),
26 | DOWN(-1, 0),
27 | LEFT(0, -1),
28 | RIGHT(0, 1);
29 |
30 | private final int numLatSteps;
31 | private final int numLngSteps;
32 |
33 | MoveDirection(int numLatSteps, int numLngSteps) {
34 | this.numLatSteps = numLatSteps;
35 | this.numLngSteps = numLngSteps;
36 | }
37 |
38 | public double getLatDistance(double stepSizeDeg) {
39 | return numLatSteps * stepSizeDeg;
40 | }
41 |
42 | public double getLngDistance(double stepSizeDeg) {
43 | return numLngSteps * stepSizeDeg;
44 | }
45 |
46 | private static LatLng movePoint(LatLng oldPoint, double latMoveDistance, double lngMoveDistance) {
47 | return new LatLng(oldPoint.latitude + latMoveDistance, oldPoint.longitude + lngMoveDistance);
48 | }
49 |
50 | public static List movePointsInList(
51 | List oldPoints, double latMoveDistance, double lngMoveDistance) {
52 | List newPoints = new ArrayList<>(oldPoints.size());
53 | for (LatLng oldPoint : oldPoints) {
54 | newPoints.add(movePoint(oldPoint, latMoveDistance, lngMoveDistance));
55 | }
56 |
57 | return newPoints;
58 | }
59 |
60 | public static List> movePointsInNestedList(
61 | List> oldPointLists, double latMoveDistance, double lngMoveDistance) {
62 | List> newPointLists = new ArrayList<>(oldPointLists.size());
63 | for (List oldPointList : oldPointLists) {
64 | newPointLists.add(movePointsInList(oldPointList, latMoveDistance, lngMoveDistance));
65 | }
66 |
67 | return newPointLists;
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/java/com/example/mapdemo/StreetViewPanoramaBasicDemoActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.mapdemo;
18 |
19 | import android.os.Bundle;
20 | import androidx.appcompat.app.AppCompatActivity;
21 | import com.example.mapdemo.EdgeToEdgeUtil.EdgeToEdgeMarginConfig;
22 | import com.google.android.gms.maps.SupportStreetViewPanoramaFragment;
23 | import com.google.android.gms.maps.model.LatLng;
24 | import com.google.common.collect.ImmutableList;
25 |
26 | /** This shows how to create a simple activity with streetview */
27 | public class StreetViewPanoramaBasicDemoActivity extends AppCompatActivity {
28 |
29 | // Pitt St, Sydney
30 | private static final LatLng SYDNEY = new LatLng(-33.8682624, 151.2083773);
31 |
32 | @Override
33 | protected void onCreate(final Bundle savedInstanceState) {
34 | super.onCreate(savedInstanceState);
35 | setContentView(R.layout.street_view_panorama_basic_demo);
36 |
37 | // Margins are only set if the edge-to-edge mode is enabled, it's enabled by default for Android
38 | // V+ devices.
39 | // No margins are set for pre-Android V devices.
40 | EdgeToEdgeUtil.setMarginForEdgeToEdgeSupport(
41 | ImmutableList.of(
42 | EdgeToEdgeMarginConfig.builder().setView(findViewById(R.id.layout_container)).build()));
43 |
44 | SupportStreetViewPanoramaFragment streetViewPanoramaFragment =
45 | (SupportStreetViewPanoramaFragment)
46 | getSupportFragmentManager().findFragmentById(R.id.streetviewpanorama);
47 | streetViewPanoramaFragment.setRetainInstance(true);
48 | streetViewPanoramaFragment.getStreetViewPanoramaAsync(
49 | panorama -> {
50 | // Only set the panorama to SYDNEY on startup (when no panoramas have been
51 | // loaded which is when the savedInstanceState is null).
52 | if (savedInstanceState == null) {
53 | panorama.setPosition(SYDNEY);
54 | }
55 | });
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/pattern_control_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
20 |
27 |
31 |
35 |
40 |
45 |
50 |
55 |
56 |
60 |
61 |
62 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/raw/light_dream.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "featureType": "landscape",
4 | "stylers": [
5 | {
6 | "hue": "#FFBB00"
7 | },
8 | {
9 | "saturation": 43.400000000000006
10 | },
11 | {
12 | "lightness": 37.599999999999994
13 | },
14 | {
15 | "gamma": 1
16 | }
17 | ]
18 | },
19 | {
20 | "featureType": "road.highway",
21 | "stylers": [
22 | {
23 | "hue": "#FFC200"
24 | },
25 | {
26 | "saturation": -61.8
27 | },
28 | {
29 | "lightness": 45.599999999999994
30 | },
31 | {
32 | "gamma": 1
33 | }
34 | ]
35 | },
36 | {
37 | "featureType": "road.arterial",
38 | "stylers": [
39 | {
40 | "hue": "#FF0300"
41 | },
42 | {
43 | "saturation": -100
44 | },
45 | {
46 | "lightness": 51.19999999999999
47 | },
48 | {
49 | "gamma": 1
50 | }
51 | ]
52 | },
53 | {
54 | "featureType": "road.local",
55 | "stylers": [
56 | {
57 | "hue": "#FF0300"
58 | },
59 | {
60 | "saturation": -100
61 | },
62 | {
63 | "lightness": 52
64 | },
65 | {
66 | "gamma": 1
67 | }
68 | ]
69 | },
70 | {
71 | "featureType": "water",
72 | "stylers": [
73 | {
74 | "hue": "#0078FF"
75 | },
76 | {
77 | "saturation": -13.200000000000003
78 | },
79 | {
80 | "lightness": 2.4000000000000057
81 | },
82 | {
83 | "gamma": 1
84 | }
85 | ]
86 | },
87 | {
88 | "featureType": "poi",
89 | "stylers": [
90 | {
91 | "hue": "#00FF6A"
92 | },
93 | {
94 | "saturation": -1.0989010989011234
95 | },
96 | {
97 | "lightness": 11.200000000000017
98 | },
99 | {
100 | "gamma": 1
101 | }
102 | ]
103 | }
104 | ]
105 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/street_view_multiple_panorama_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
30 |
37 |
44 |
45 |
51 |
58 |
65 |
66 |
67 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/raw/black_and_white.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "featureType": "road",
4 | "elementType": "labels",
5 | "stylers": [
6 | {
7 | "visibility": "on"
8 | }
9 | ]
10 | },
11 | {
12 | "featureType": "poi",
13 | "stylers": [
14 | {
15 | "visibility": "off"
16 | }
17 | ]
18 | },
19 | {
20 | "featureType": "administrative",
21 | "stylers": [
22 | {
23 | "visibility": "off"
24 | }
25 | ]
26 | },
27 | {
28 | "featureType": "road",
29 | "elementType": "geometry.fill",
30 | "stylers": [
31 | {
32 | "color": "#000000"
33 | },
34 | {
35 | "weight": 1
36 | }
37 | ]
38 | },
39 | {
40 | "featureType": "road",
41 | "elementType": "geometry.stroke",
42 | "stylers": [
43 | {
44 | "color": "#000000"
45 | },
46 | {
47 | "weight": 0.8
48 | }
49 | ]
50 | },
51 | {
52 | "featureType": "landscape",
53 | "stylers": [
54 | {
55 | "color": "#ffffff"
56 | }
57 | ]
58 | },
59 | {
60 | "featureType": "water",
61 | "stylers": [
62 | {
63 | "visibility": "off"
64 | }
65 | ]
66 | },
67 | {
68 | "featureType": "transit",
69 | "stylers": [
70 | {
71 | "visibility": "off"
72 | }
73 | ]
74 | },
75 | {
76 | "elementType": "labels",
77 | "stylers": [
78 | {
79 | "visibility": "off"
80 | }
81 | ]
82 | },
83 | {
84 | "elementType": "labels.text",
85 | "stylers": [
86 | {
87 | "visibility": "on"
88 | }
89 | ]
90 | },
91 | {
92 | "elementType": "labels.text.stroke",
93 | "stylers": [
94 | {
95 | "color": "#ffffff"
96 | }
97 | ]
98 | },
99 | {
100 | "elementType": "labels.text.fill",
101 | "stylers": [
102 | {
103 | "color": "#000000"
104 | }
105 | ]
106 | },
107 | {
108 | "elementType": "labels.icon",
109 | "stylers": [
110 | {
111 | "visibility": "on"
112 | }
113 | ]
114 | }
115 | ]
116 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/java/com/example/mapdemo/PolylineOtherOptionsControlFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.mapdemo;
18 |
19 | import android.os.Bundle;
20 | import android.view.LayoutInflater;
21 | import android.view.View;
22 | import android.view.ViewGroup;
23 | import android.widget.CheckBox;
24 |
25 | /**
26 | * Fragment with clickability, geodesic, and visibility UI controls for Polylines, to be used in
27 | * ViewPager.
28 | */
29 | public class PolylineOtherOptionsControlFragment extends PolylineControlFragment
30 | implements View.OnClickListener {
31 |
32 | private CheckBox clickabilityCheckBox;
33 | private CheckBox geodesicCheckBox;
34 | private CheckBox visibilityCheckBox;
35 |
36 | @Override
37 | public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle bundle) {
38 | View view = inflater.inflate(R.layout.other_options_control_fragment, container, false);
39 | clickabilityCheckBox = (CheckBox) view.findViewById(R.id.clickabilityCheckBox);
40 | clickabilityCheckBox.setOnClickListener(this);
41 | geodesicCheckBox = (CheckBox) view.findViewById(R.id.geodesicCheckBox);
42 | geodesicCheckBox.setOnClickListener(this);
43 | visibilityCheckBox = (CheckBox) view.findViewById(R.id.visibilityCheckBox);
44 | visibilityCheckBox.setOnClickListener(this);
45 | return view;
46 | }
47 |
48 | @Override
49 | public void onClick(View view) {
50 | if (polyline == null) {
51 | return;
52 | }
53 | if (view == clickabilityCheckBox) {
54 | polyline.setClickable(clickabilityCheckBox.isChecked());
55 | } else if (view == geodesicCheckBox) {
56 | polyline.setGeodesic(geodesicCheckBox.isChecked());
57 | } else if (view == visibilityCheckBox) {
58 | polyline.setVisible(visibilityCheckBox.isChecked());
59 | }
60 | }
61 |
62 | @Override
63 | public void refresh() {
64 | clickabilityCheckBox.setChecked((polyline != null) && polyline.isClickable());
65 | geodesicCheckBox.setChecked((polyline != null) && polyline.isGeodesic());
66 | visibilityCheckBox.setChecked((polyline != null) && polyline.isVisible());
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/polygon_color_control_fragment.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
26 |
28 |
30 |
31 |
35 |
37 |
39 |
40 |
44 |
46 |
49 |
50 |
54 |
56 |
58 |
59 |
63 |
65 |
67 |
68 |
72 |
74 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/street_view_panorama_options_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
22 |
28 |
29 |
30 |
31 |
40 |
47 |
54 |
61 |
68 |
69 |
70 |
71 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/res/layout/indoor_multimap_demo.xml:
--------------------------------------------------------------------------------
1 |
2 |
17 |
18 |
24 |
30 |
36 |
42 |
43 |
49 |
55 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/map-sample/app/src/main/java/com/example/mapdemo/StreetViewMultiplePanoramaDemoActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright 2024 Google LLC
3 | *
4 | * Licensed under the Apache License, Version 2.0 (the "License");
5 | * you may not use this file except in compliance with the License.
6 | * You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package com.example.mapdemo;
18 |
19 | import android.os.Bundle;
20 | import androidx.appcompat.app.AppCompatActivity;
21 | import com.example.mapdemo.EdgeToEdgeUtil.EdgeToEdgeMarginConfig;
22 | import com.google.android.gms.maps.SupportStreetViewPanoramaFragment;
23 | import com.google.android.gms.maps.model.LatLng;
24 | import com.google.common.collect.ImmutableList;
25 |
26 | /** Demo to show multiple StreetView panoramas in the same Activity. */
27 | public class StreetViewMultiplePanoramaDemoActivity extends AppCompatActivity {
28 |
29 | private static final LatLng SYDNEY = new LatLng(-33.8682624, 151.2083773);
30 | private static final LatLng SAN_FRAN = new LatLng(37.769263, -122.450727);
31 | private static final LatLng POLICE_PHONEBOX = new LatLng(51.4921451, -0.1929781);
32 | private static final LatLng ESPLANADE = new LatLng(-34.9661398, 138.5095255);
33 |
34 | @Override
35 | protected void onCreate(Bundle savedInstanceState) {
36 | super.onCreate(savedInstanceState);
37 | setContentView(R.layout.street_view_multiple_panorama_demo);
38 |
39 | // Margins are only set if the edge-to-edge mode is enabled, it's enabled by default for Android
40 | // V+ devices.
41 | // No margins are set for pre-Android V devices.
42 | EdgeToEdgeUtil.setMarginForEdgeToEdgeSupport(
43 | ImmutableList.of(
44 | EdgeToEdgeMarginConfig.builder().setView(findViewById(R.id.outer_container)).build()));
45 |
46 | if (savedInstanceState == null) {
47 | setPanoLocation(R.id.panorama1, SYDNEY);
48 | setPanoLocation(R.id.panorama2, SAN_FRAN);
49 | setPanoLocation(R.id.panorama3, POLICE_PHONEBOX);
50 | setPanoLocation(R.id.panorama4, ESPLANADE);
51 | }
52 | }
53 |
54 | private void setPanoLocation(int fragmentId, final LatLng location) {
55 | SupportStreetViewPanoramaFragment panoFragment =
56 | (SupportStreetViewPanoramaFragment)
57 | getSupportFragmentManager().findFragmentById(fragmentId);
58 | panoFragment.setRetainInstance(true);
59 | panoFragment.getStreetViewPanoramaAsync(
60 | panorama -> panorama.setPosition(location, 50 /* radius m */));
61 | }
62 | }
63 |
--------------------------------------------------------------------------------