[DrawablePainter] Use mutableStateOf(Unit, neverEqualPolicy()) / mutableIntStateOf to invalidate
- Dominant language
- Kotlin
- Stars
- 7.8k
- Forks
- 683
- PR merge metrics
- No merged PRs in 30d
Description
https://github.com/google/accompanist/blob/fda7f06a24a42b0b1afa75591e768d82d2941984/drawablepainter/src/main/java/com/google/accompanist/drawablepainter/DrawablePainter.kt#L59
Could be replaced with `mutableStateOf(Unit, neverEqualPolicy())`.
Though according to [this](https://github.com/androidx/androidx/blob/3b824e8b3b8a52d5925cd1c69ae97bf9efc50709/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/graphics/vector/VectorPainter.kt#L225) there is an internal [bug](https://issuetracker.google.com/291647821) which I can't tell if it's already addressed.
If not, `mutableIntStateOf` can be used instead.
https://github.com/google/accompanist/blob/fda7f06a24a42b0b1afa75591e768d82d2941984/drawablepainter/src/main/java/com/google/accompanist/drawablepainter/DrawablePainter.kt#L60
Can also be replaced with `mutableLongStateOf` but I'm not sure if it's worth it.
Contributor guide
Assessment
This issue has not been assessed yet.