Add ViewModel for state preservation and centralize color constants
- Create CameraViewModel with AndroidViewModel to survive configuration changes (rotation). All blur params, capture state, gallery preview, and thumbnail state now live in StateFlow fields - Create AppColors object to centralize the 12+ hardcoded color literals into a single source of truth - Add lifecycle-viewmodel-compose dependency Fixes: state lost on rotation, orphaned capture coroutines on config change, accent color maintenance risk Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5e08fb9c13
commit
6a1d66bd4b
4 changed files with 229 additions and 0 deletions
|
|
@ -80,6 +80,7 @@ dependencies {
|
|||
implementation(libs.androidx.core.ktx)
|
||||
implementation(libs.androidx.lifecycle.runtime.ktx)
|
||||
implementation(libs.androidx.lifecycle.runtime.compose)
|
||||
implementation(libs.androidx.lifecycle.viewmodel.compose)
|
||||
implementation(libs.androidx.activity.compose)
|
||||
|
||||
// Compose
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue