googlemaps / googlemaps/android-maps-compose

Create lint rules for Maps Compose

Open
#218 1 comment 0 reactions 0 assignees View on GitHub
priority: p3 type: feature request
Dominant language
Kotlin
Stars
1.3k
Forks
181
Avg merge
2d 23h
Merged PRs (30d)
18

Description

**Is your feature request related to a problem? Please describe.**
Maps Compose has frequently changing state that should not be read in composition. Example of this are:
* `MarkerPositionState.positon` - this changes frequently when a marker is dragged
* `CameraPositionState.position` - this changes frequently as the map's camera changes

**Describe the solution you'd like**
Provide lint rules that give warnings when the state mentioned above is read within composition.

**Describe alternatives you've considered**
Do nothing.

**Additional context**
Take a look at https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/foundation/foundation-lint/src/test/java/androidx/compose/foundation/lint/LazyLayoutStateReadInCompositionDetectorTest.kt?q=firstVisibleItemIndex&start=21 and https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/foundation/foundation-lint/src/main/java/androidx/compose/foundation/lint/LazyLayoutStateReadInCompositionDetector.kt;l=40?q=LazyLayoutStateReadInCom&sq= as an example

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.