Skip to content

Commit

Permalink
🔨 인자 위치 컨벤션에 맞게 수정 및 finish 로 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
SEO-J17 committed Aug 12, 2024
1 parent 5d0dbc2 commit 9b3d790
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import androidx.activity.viewModels
import androidx.compose.runtime.getValue
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.navigation.compose.rememberNavController
import com.mashup.gabbangzip.sharedalbum.presentation.ui.main.MainActivity
import com.mashup.gabbangzip.sharedalbum.presentation.ui.model.PicPhotoFrame
import com.mashup.gabbangzip.sharedalbum.presentation.ui.vote.navigation.VoteNavHost
import com.mashup.gabbangzip.sharedalbum.presentation.ui.vote.navigation.VoteNavRoute
Expand All @@ -31,12 +30,11 @@ class VoteActivity : ComponentActivity() {
state = state,
navController = navController,
startDestination = VoteNavRoute.initRoute,
frameResId = PicPhotoFrame.getTypeByKeyword(state.voteResult.groupKeyword.name).frameResId,
thumbnailUrl = state.voteResult.randomImageUrl,
onDialogConfirm = { viewModel.updateVoteDialog(isVisible = false) },
onCancelVote = { viewModel.updateVoteDialog(isVisible = true) },
onVoteExit = {
MainActivity.openActivity(this@VoteActivity)
finish()
},
onVoteExit = { finish() },
onVoteBySwiped = { voteType, photo ->
viewModel.updateVoteEvent(voteType)
viewModel.addVoteResult(voteType, photo)
Expand All @@ -57,8 +55,6 @@ class VoteActivity : ComponentActivity() {
// TODO: 향후 논의해서 업로드 실패시 에러토스트..? 스낵바..? 정하기.
}
},
frameResId = PicPhotoFrame.getTypeByKeyword(state.voteResult.groupKeyword.name).frameResId,
thumbnailUrl = state.voteResult.randomImageUrl,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ fun VoteNavHost(
navController: NavHostController,
startDestination: String,
state: PhotoVoteState,
frameResId: Int,
thumbnailUrl: String,
onDialogConfirm: () -> Unit,
onCancelVote: () -> Unit,
onVoteExit: () -> Unit,
Expand All @@ -24,8 +26,6 @@ fun VoteNavHost(
onCompleteButtonClicked: () -> Unit,
onClickNavigationBack: () -> Unit,
onUploadPicture: (Boolean) -> Unit,
frameResId: Int,
thumbnailUrl: String,
) {
NavHost(
modifier = modifier,
Expand Down

0 comments on commit 9b3d790

Please sign in to comment.