Skip to content

Commit

Permalink
add ViewModels for each screens [FoKE-Developers#46]
Browse files Browse the repository at this point in the history
- 각 Screen별 ViewModel 추가 (1:1 매칭)
  • Loading branch information
DokySp committed Sep 29, 2024
1 parent 90bd89e commit 2326e1a
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.sp
import androidx.hilt.navigation.compose.hiltViewModel
import com.foke.together.presenter.ui.theme.FourCutTogetherTheme
import com.foke.together.presenter.viewmodel.CameraViewModel

@Composable
fun CameraScreen(
navigateToFrame: () -> Unit,
popBackStack: () -> Unit
popBackStack: () -> Unit,
viewModel: CameraViewModel = hiltViewModel()
) {
Column (
modifier = Modifier.fillMaxWidth(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.sp
import androidx.hilt.navigation.compose.hiltViewModel
import com.foke.together.presenter.ui.theme.FourCutTogetherTheme
import com.foke.together.presenter.viewmodel.SelectFrameViewModel

@Composable
fun FrameScreen(
navigateShare: () -> Unit,
popBackStack: () -> Unit
popBackStack: () -> Unit,
viewModel: SelectFrameViewModel = hiltViewModel()
) {
Column (
modifier = Modifier.fillMaxWidth(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package com.foke.together.presenter.screen
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.Button
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
Expand All @@ -12,11 +11,14 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.sp
import androidx.hilt.navigation.compose.hiltViewModel
import com.foke.together.presenter.ui.theme.FourCutTogetherTheme
import com.foke.together.presenter.viewmodel.SettingViewModel

@Composable
fun SettingScreen(
popBackStack: () -> Unit
popBackStack: () -> Unit,
viewModel: SettingViewModel = hiltViewModel()
) {
Column (
modifier = Modifier.fillMaxWidth(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.sp
import androidx.hilt.navigation.compose.hiltViewModel
import com.foke.together.presenter.ui.theme.FourCutTogetherTheme
import com.foke.together.presenter.viewmodel.ShareViewModel

@Composable
fun ShareScreen(
popBackStack: () -> Unit
popBackStack: () -> Unit,
viewModel: ShareViewModel = hiltViewModel()
) {
Column (
modifier = Modifier.fillMaxWidth(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.foke.together.presenter.viewmodel

import androidx.lifecycle.ViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class CameraViewModel @Inject constructor(
): ViewModel() {
// TODO: add viewmodel code here
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.foke.together.presenter.viewmodel

import androidx.lifecycle.ViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class SelectFrameViewModel @Inject constructor(
): ViewModel() {
// TODO: add viewmodel code here
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.foke.together.presenter.viewmodel

import androidx.lifecycle.ViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class SelectMethodViewModel @Inject constructor(
): ViewModel() {
// TODO: add viewmodel code here
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.foke.together.presenter.viewmodel

import androidx.lifecycle.ViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class SettingViewModel @Inject constructor(
): ViewModel() {
// TODO: add viewmodel code here
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.foke.together.presenter.viewmodel

import androidx.lifecycle.ViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class ShareViewModel @Inject constructor(
): ViewModel() {
// TODO: add viewmodel code here
}

0 comments on commit 2326e1a

Please sign in to comment.