Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Toast invocations out of Camera/VideoEdit ViewModels. #39

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Changing some vars to vals.
  • Loading branch information
donovanfm committed Mar 26, 2024
commit ed065cc76ac34801fb3d83bb6b146c8176b6e5c7
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class CameraViewModel @Inject constructor(

val chatId: Long? = savedStateHandle.get("chatId")
var viewFinderState = MutableStateFlow(ViewFinderState())
private var _imageCaptureState = MutableStateFlow(ImageCaptureState.PENDING)
private val _imageCaptureState = MutableStateFlow(ImageCaptureState.PENDING)
val imageCaptureState: StateFlow<ImageCaptureState> = _imageCaptureState

val aspectRatioStrategy =
Expand Down Expand Up @@ -195,7 +195,7 @@ class CameraViewModel @Inject constructor(
}

override fun onImageSaved(output: ImageCapture.OutputFileResults) {
var state: ImageCaptureState
val state: ImageCaptureState
val savedUri = output.savedUri
if (savedUri != null) {
state = ImageCaptureState.IMAGE_CAPTURE_SUCCESS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class VideoEditScreenViewModel @Inject constructor(
private val _isProcessing = MutableStateFlow(false)
val isProcessing: StateFlow<Boolean> = _isProcessing

private var _videoSaveState = MutableStateFlow(VideoSaveState.PENDING)
private val _videoSaveState = MutableStateFlow(VideoSaveState.PENDING)
val videoSaveState: StateFlow<VideoSaveState> = _videoSaveState

fun setChatId(chatId: Long) {
Expand Down
Loading