android / android/nowinandroid
[FR]: Misused of DisposableEffect instead of LaunchedEffect
- Dominant language
- Kotlin
- Stars
- 21.8k
- Forks
- 4.6k
- Avg merge
- 19h 20m
- Merged PRs (30d)
- 2
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the problem
in MainActivity to update the dark content of the system bars to match the theme, there is a DisposableEffect which `onDispose` method is empty with no comment
```
DisposableEffect(systemUiController, darkTheme) {
systemUiController.systemBarsDarkContentEnabled = !darkTheme
onDispose {}
}
```
this code exists in MainActivity:103
### Describe the solution
I can update it and use LaunchedEffect instead
### Additional context
_No response_
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Contributor guide
Research direction
Start in MainActivity around line 103 and inspect the effect that updates the system bar dark-content setting for the theme. Replace the empty-disposal effect as described, then verify that the system bars still match the current theme; no test file is mentioned in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100