add lifecycle-runtime-compose dependency#16
Conversation
There was a problem hiding this comment.
Pull request overview
This PR aims to address issue #6 by wiring androidx.lifecycle:lifecycle-runtime-compose into the Android app’s dependency setup so Compose screens can adopt lifecycle-aware state collection.
Changes:
- Added
androidx.lifecycle:lifecycle-runtime-composeto the Gradle version catalog. - Added the new lifecycle Compose artifact to the app module dependencies.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
gradle/libs.versions.toml |
Adds a version-catalog entry for lifecycle-runtime-compose. |
app/build.gradle.kts |
Adds the new catalog dependency to the app module’s implementation configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| dependencies { | ||
| implementation(libs.androidx.core.ktx) | ||
| implementation(libs.androidx.lifecycle.runtime.ktx) | ||
| implementation(libs.androidx.lifecycle.runtime.compose) |
There was a problem hiding this comment.
there's no collectAsState() to migrate, but the actual reason the dependency is needed is that MainActivity.kt and QrScannerScreen.kt already import LocalLifecycleOwner from lifecycle-runtime-compose without it being explicitly declared, it's just resolving transitively right now. This makes it explicit. There's nothing to migrate to collectAsStateWithLifecycle() yet since the codebase doesn't use StateFlow or collectAsState(), but the dependency is a prerequisite for when that's added.
Adds lifecycle-runtime-compose to the version catalog and app dependencies.
Fixed Issue #6
@f4w4z