fix: map cluster crash#4317
Merged
Merged
Conversation
This commit addresses two issues: a bug in the waypoint expiration date/time picker and a rendering crash in Google Maps clustering.
### Key Changes:
- **fix(map): Waypoint Expiration Picker**
- The date and time pickers for waypoint expiration are now correctly initialized. Previously, they would reset to the current time plus eight hours, discarding any existing expiration value. Now, they correctly reflect the waypoint's current expiration time when it exists.
- State handling for the picker's calendar instance is improved to ensure date and time selections are preserved correctly across interactions.
- **fix(map): Google Maps Cluster Rendering**
- A workaround has been implemented to resolve a crash related to `googlemaps/android-maps-compose/issues/858`.
- The `NodeClusterMarkers` composable now manually sets the `LifecycleOwner` and `SavedStateRegistryOwner` on the activity's decor view. This ensures that the internal `ComposeView` used by the clustering library can correctly find these owners when traversing the view tree, preventing a crash during marker rendering.
- Added `lifecycle-runtime-ktx`, `lifecycle-viewmodel-ktx`, and `savedstate-ktx` dependencies to support this fix.
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4317 +/- ##
=====================================
Coverage 0.00% 0.00%
=====================================
Files 3 3
Lines 28 28
Branches 8 8
=====================================
Misses 28 28 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several improvements and fixes to the map feature, particularly around waypoint expiration handling and AndroidX library integration. The most significant changes include more robust handling of waypoint expiration date/time selection, a workaround for a Compose/Maps integration issue, and dependency updates to support new AndroidX features.
Waypoint Expiration Handling Improvements:
EditWaypointDialogto ensure correct handling when editing or setting new waypoints, including proper default values and state management. [1] [2] [3] [4] [5] [6]CyclomaticComplexMethodsuppression to indicate increased complexity in the dialog logic.AndroidX Integration and Dependency Updates:
androidx.lifecycle.runtime.ktx,androidx.lifecycle.viewmodel.ktx, andandroidx.savedstate.ktxto the project and updated thelibs.versions.tomlfile to include these libraries. [1] [2] [3] [4]Google Maps Compose Workaround:
NodeClusterMarkersto set lifecycle and saved state owners on the activity's decor view, addressing a known issue with Google Maps Compose clustering. [1] [2]Copyright
NodeClusterMarkers.kt.Build Script Cleanup:
build.gradle.ktsfor the map feature.