feat(samples): add 0.2.2 showcase features (Camera Animation, Path Following, Data Viz, Roadmap Mode, FOV) - #50
Conversation
… Field of View, Path Following, and Advanced Camera Animation
There was a problem hiding this comment.
Android Lint found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
| <activity android:name=".placedetails.PlaceDetailsActivity" android:exported="true" android:label="Place Details" android:theme="@style/Theme.AppCompat.DayNight.NoActionBar" /> | ||
| <activity android:name=".advancedcameraanimation.AdvancedCameraAnimationActivity" android:exported="true" android:label="Advanced Camera Animation" /> | ||
| <activity android:name=".datavisualization.DataVisualizationActivity" android:exported="true" android:label="Data Visualization" /> | ||
| <activity android:name=".cloudstyling.CloudStylingActivity" android:exported="true" android:label="Cloud Map Styling" /> |
There was a problem hiding this comment.
This has been removed, but CloudStylingActivity is still an activity on the code. Regression?
| import com.google.maps.android.compose3d.PolylineConfig | ||
| import kotlinx.coroutines.delay | ||
|
|
||
| class PathFollowingActivity : ComponentActivity() { |
There was a problem hiding this comment.
This doesn't seem to use SampleBaseActivity.
There was a problem hiding this comment.
Yes, I did this intentionally. The reason is that PathFollowingActivity needs its own specific UI controllers for the demonstration. If I were to extend SampleBaseActivity here, it would unnecessarily result in two different layouts trying to initialize the map instance.
However, if you look at the other features like DataVisualizationActivity, RoadmapModeActivity, etc., I did utilize the SampleBaseActivity layout by dynamically adding their respective controllers inside the activity_common_map layout.
Soon I will change for PathFollowingActivity also
|
There are a bunch of changes introducing only reformatting changes (like in ComposeDemos/MainActivity.kt). What if we agree to use the formatting rules from Android Studio, to avoid introducing those changes? Or if we want to formalise it, we could agree on using spotless, which can run on CI/CD. |
…atting - Add showcase demos for Advanced Camera Animation, Path Following, Data Visualization, Roadmap Mode, and Field of View - Synchronize hardware frame loops to VSYNC and improve touch-fade UX - Format codebase using spotless to adhere to 4-space ktlint rules
… auto-fade, and literate docs (#54) * Enhance Advanced Camera Animation and Path Following samples - Advanced Camera Animation: - Add modular step animation pipeline (FlyToStep, OrbitStep, DwellStep, FlyAroundStep, KeyframeStep). - Add high-altitude San Francisco starting camera view. - Implement full reset and continuous orbit support. - Sync Java, Kotlin, and Jetpack Compose implementations. - Path Following: - Implement two-polyline progress tracking with wide blue base route (lower z-index) and narrow purple progress route (higher z-index). - Use in-place fixed polyline IDs to eliminate rendering flickering. - Default altitude mode to 'Clamp to Ground' with support for Relative to Ground, Relative to Mesh, and Absolute. - Add dynamic path height slider to avoid z-fighting with terrain. - Add collapsible control panel with explicit collapse/expand button, auto-slide dismissal, and subtle idle opacity. - Extract all hardcoded strings into strings.xml resources. - Align Java and Kotlin implementations. * feat(fieldofview,datavisualization): polish FOV and Data Visualization with collapsible cards and literate docs * feat(roadmapmode): polish Roadmap Mode with collapsible header and literate docs * feat(routes): polish Routes API sample with collapsible control panel, auto-fade, and literate docs * docs(samples): augment literate comments explaining 3D coordinates, extrusion, and smoothing * build: untrack and gitignore gradle-daemon-jvm.properties * docs: update copyright headers to 2026 for camera animation step classes * fix(samples): address PR review feedback on animation timing, tour resume, onPause, and TransitionManager collapse
| android:layout_height="wrap_content" | ||
| android:layout_weight="1" | ||
| android:text="@string/fov_telephoto" | ||
| android:textSize="10sp" |
| android:layout_marginStart="2dp" | ||
| android:layout_marginEnd="2dp" | ||
| android:text="@string/fov_standard" | ||
| android:textSize="10sp" |
| android:layout_weight="1" | ||
| android:layout_marginEnd="2dp" | ||
| android:text="@string/fov_wide" | ||
| android:textSize="10sp" |
| android:layout_height="wrap_content" | ||
| android:layout_weight="1" | ||
| android:text="@string/fov_ultrawide" | ||
| android:textSize="10sp" |
| android:paddingBottom="12dp" | ||
| > | ||
|
|
||
| <RadioGroup |
| when { | ||
| currentFloodHeightMeters <= 2.0 -> { | ||
| floodRiskBadge.setText(R.string.flood_risk_baseline) | ||
| floodRiskBadge.setTextColor(Color.parseColor("#008800")) |
| currentFloodHeightMeters <= 2.0 -> { | ||
| floodRiskBadge.setText(R.string.flood_risk_baseline) | ||
| floodRiskBadge.setTextColor(Color.parseColor("#008800")) | ||
| floodRiskBadge.setBackgroundColor(Color.parseColor("#2000AA00")) |
|
|
||
| currentFloodHeightMeters <= 8.0 -> { | ||
| floodRiskBadge.setText(R.string.flood_risk_minor) | ||
| floodRiskBadge.setTextColor(Color.parseColor("#BB7700")) |
| currentFloodHeightMeters <= 8.0 -> { | ||
| floodRiskBadge.setText(R.string.flood_risk_minor) | ||
| floodRiskBadge.setTextColor(Color.parseColor("#BB7700")) | ||
| floodRiskBadge.setBackgroundColor(Color.parseColor("#20FFAA00")) |
|
|
||
| currentFloodHeightMeters <= 20.0 -> { | ||
| floodRiskBadge.setText(R.string.flood_risk_moderate) | ||
| floodRiskBadge.setTextColor(Color.parseColor("#0077CC")) |
| else -> { | ||
| floodRiskBadge.setText(R.string.flood_risk_extreme) | ||
| floodRiskBadge.setTextColor(Color.parseColor("#CC0000")) | ||
| floodRiskBadge.setBackgroundColor(Color.parseColor("#25FF0000")) |
| val staticOptions = PolylineOptions().apply { | ||
| id = STATIC_ROUTE_POLYLINE_ID | ||
| path = staticVertices | ||
| strokeColor = Color.parseColor("#4285F4") // Wide blue route |
| val staticOptions = PolylineOptions().apply { | ||
| id = STATIC_ROUTE_POLYLINE_ID | ||
| path = staticVertices | ||
| strokeColor = Color.parseColor("#4285F4") // Wide blue route |
| val progressOptions = PolylineOptions().apply { | ||
| id = PROGRESS_POLYLINE_ID | ||
| path = progressCoordinates | ||
| strokeColor = Color.parseColor("#9C27B0") // Narrow purple progress |
| val progressOptions = PolylineOptions().apply { | ||
| id = PROGRESS_POLYLINE_ID | ||
| path = progressCoordinates | ||
| strokeColor = Color.parseColor("#9C27B0") // Narrow purple progress |
Summary
This PR introduces 5 new major showcase demonstration features for the Google Maps 3D SDK (0.2.2 release) across Java Views, Kotlin Views, and Jetpack Compose (
ApiDemosandComposeDemos), alongside automated visual tests, performance optimizations, and stability polish.Features Included in This PR
AdvancedCameraAnimationActivity)PathFollowingActivity)DataVisualizationActivity)extruded = true).RoadmapModeActivity)ROADMAP,HYBRID, andSATELLITEmodes with dynamic camera orientation.FieldOfViewActivity)Tooling & Code Health
./gradlew spotlessApplyacross all modified files to strictly adhere to standard 4-spacektlintrules and remove all formatting diff noise../gradlew test assembleDebugand./gradlew spotlessCheckwith 100% passing results across all modules.