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:
Ole-Morten Duesund 2026-03-05 12:07:39 +01:00
commit 6a1d66bd4b
4 changed files with 229 additions and 0 deletions

View file

@ -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