Aperture: Move camera view model to .viewmodels
Change-Id: I27c08fceaad6c9a2e57979d605e432c2ebc099d8
diff --git a/app/src/main/java/org/lineageos/aperture/CameraActivity.kt b/app/src/main/java/org/lineageos/aperture/CameraActivity.kt
index e82a02b..7f1cfe4 100644
--- a/app/src/main/java/org/lineageos/aperture/CameraActivity.kt
+++ b/app/src/main/java/org/lineageos/aperture/CameraActivity.kt
@@ -99,7 +99,6 @@
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.withContext
import org.lineageos.aperture.camera.CameraManager
-import org.lineageos.aperture.camera.CameraViewModel
import org.lineageos.aperture.ext.*
import org.lineageos.aperture.models.AssistantIntent
import org.lineageos.aperture.models.CameraFacing
@@ -143,6 +142,7 @@
import org.lineageos.aperture.utils.PermissionsUtils
import org.lineageos.aperture.utils.ShortcutsUtils
import org.lineageos.aperture.utils.StorageUtils
+import org.lineageos.aperture.viewmodels.CameraViewModel
import java.io.ByteArrayInputStream
import java.io.ByteArrayOutputStream
import java.io.FileNotFoundException
diff --git a/app/src/main/java/org/lineageos/aperture/ui/CameraModeSelectorLayout.kt b/app/src/main/java/org/lineageos/aperture/ui/CameraModeSelectorLayout.kt
index c61207a..243ce97 100644
--- a/app/src/main/java/org/lineageos/aperture/ui/CameraModeSelectorLayout.kt
+++ b/app/src/main/java/org/lineageos/aperture/ui/CameraModeSelectorLayout.kt
@@ -18,11 +18,11 @@
import androidx.lifecycle.findViewTreeLifecycleOwner
import com.google.android.material.button.MaterialButton
import org.lineageos.aperture.R
-import org.lineageos.aperture.camera.CameraViewModel
import org.lineageos.aperture.ext.px
import org.lineageos.aperture.models.CameraMode
import org.lineageos.aperture.models.CameraState
import org.lineageos.aperture.utils.TimeUtils
+import org.lineageos.aperture.viewmodels.CameraViewModel
import kotlin.reflect.cast
class CameraModeSelectorLayout @JvmOverloads constructor(
diff --git a/app/src/main/java/org/lineageos/aperture/ui/CapturePreviewLayout.kt b/app/src/main/java/org/lineageos/aperture/ui/CapturePreviewLayout.kt
index 1c42e1c..9b45480 100644
--- a/app/src/main/java/org/lineageos/aperture/ui/CapturePreviewLayout.kt
+++ b/app/src/main/java/org/lineageos/aperture/ui/CapturePreviewLayout.kt
@@ -19,11 +19,11 @@
import androidx.media3.exoplayer.ExoPlayer
import androidx.media3.ui.PlayerView
import org.lineageos.aperture.R
-import org.lineageos.aperture.camera.CameraViewModel
import org.lineageos.aperture.ext.*
import org.lineageos.aperture.models.MediaType
import org.lineageos.aperture.models.Rotation
import org.lineageos.aperture.utils.ExifUtils
+import org.lineageos.aperture.viewmodels.CameraViewModel
import java.io.InputStream
/**
diff --git a/app/src/main/java/org/lineageos/aperture/ui/CountDownView.kt b/app/src/main/java/org/lineageos/aperture/ui/CountDownView.kt
index fd3ec1e..1d44f33 100644
--- a/app/src/main/java/org/lineageos/aperture/ui/CountDownView.kt
+++ b/app/src/main/java/org/lineageos/aperture/ui/CountDownView.kt
@@ -21,9 +21,9 @@
import androidx.lifecycle.Observer
import androidx.lifecycle.findViewTreeLifecycleOwner
import org.lineageos.aperture.R
-import org.lineageos.aperture.camera.CameraViewModel
import org.lineageos.aperture.ext.*
import org.lineageos.aperture.models.Rotation
+import org.lineageos.aperture.viewmodels.CameraViewModel
/**
* This class manages the looks of the countdown.
diff --git a/app/src/main/java/org/lineageos/aperture/ui/InfoChipView.kt b/app/src/main/java/org/lineageos/aperture/ui/InfoChipView.kt
index bc278f9..96261da 100644
--- a/app/src/main/java/org/lineageos/aperture/ui/InfoChipView.kt
+++ b/app/src/main/java/org/lineageos/aperture/ui/InfoChipView.kt
@@ -19,9 +19,9 @@
import androidx.lifecycle.Observer
import androidx.lifecycle.findViewTreeLifecycleOwner
import org.lineageos.aperture.R
-import org.lineageos.aperture.camera.CameraViewModel
import org.lineageos.aperture.models.CameraMode
import org.lineageos.aperture.models.Rotation
+import org.lineageos.aperture.viewmodels.CameraViewModel
import kotlin.math.roundToInt
class InfoChipView @JvmOverloads constructor(
diff --git a/app/src/main/java/org/lineageos/aperture/ui/LensSelectorLayout.kt b/app/src/main/java/org/lineageos/aperture/ui/LensSelectorLayout.kt
index 7958ecf..932ac39 100644
--- a/app/src/main/java/org/lineageos/aperture/ui/LensSelectorLayout.kt
+++ b/app/src/main/java/org/lineageos/aperture/ui/LensSelectorLayout.kt
@@ -18,10 +18,10 @@
import androidx.lifecycle.findViewTreeLifecycleOwner
import org.lineageos.aperture.R
import org.lineageos.aperture.camera.Camera
-import org.lineageos.aperture.camera.CameraViewModel
import org.lineageos.aperture.ext.*
import org.lineageos.aperture.models.CameraState
import org.lineageos.aperture.models.Rotation
+import org.lineageos.aperture.viewmodels.CameraViewModel
import java.util.Locale
@androidx.camera.camera2.interop.ExperimentalCamera2Interop
diff --git a/app/src/main/java/org/lineageos/aperture/camera/CameraViewModel.kt b/app/src/main/java/org/lineageos/aperture/viewmodels/CameraViewModel.kt
similarity index 97%
rename from app/src/main/java/org/lineageos/aperture/camera/CameraViewModel.kt
rename to app/src/main/java/org/lineageos/aperture/viewmodels/CameraViewModel.kt
index a8d30a5..f260d27 100644
--- a/app/src/main/java/org/lineageos/aperture/camera/CameraViewModel.kt
+++ b/app/src/main/java/org/lineageos/aperture/viewmodels/CameraViewModel.kt
@@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
-package org.lineageos.aperture.camera
+package org.lineageos.aperture.viewmodels
import android.app.Application
import android.net.Uri
@@ -17,6 +17,7 @@
import kotlinx.coroutines.flow.SharingStarted
import kotlinx.coroutines.flow.flowOn
import kotlinx.coroutines.flow.stateIn
+import org.lineageos.aperture.camera.Camera
import org.lineageos.aperture.ext.*
import org.lineageos.aperture.models.CameraMode
import org.lineageos.aperture.models.CameraState