-
Notifications
You must be signed in to change notification settings - Fork 2
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
홈과 보관함 폴더 생성/이름 변경 UI 및 navigation 추가 #67
Changes from 22 commits
98d27bd
0f2dcb1
fab70fa
59a9d3b
f7d407a
4f4141e
5a5d642
47f7320
b0e0a0e
b39c6f8
637e0e6
bcdb5b8
fd66fbc
2f80adf
776d6b6
b087a47
c749480
2e35cb8
af5835a
ff0bd1a
bb8d8ea
a8dac49
66093bb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
package com.mashup.dorabangs.feature.createfolder | ||
|
||
import android.util.Log | ||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.foundation.layout.Spacer | ||
import androidx.compose.foundation.layout.fillMaxSize | ||
import androidx.compose.foundation.layout.fillMaxWidth | ||
import androidx.compose.foundation.layout.height | ||
import androidx.compose.foundation.layout.padding | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.res.stringResource | ||
import androidx.compose.ui.unit.dp | ||
import androidx.hilt.navigation.compose.hiltViewModel | ||
import com.mashup.dorabangs.core.designsystem.component.buttons.DoraButtons | ||
import com.mashup.dorabangs.core.designsystem.component.textfield.DoraTextField | ||
import com.mashup.dorabangs.core.designsystem.component.topbar.DoraTopBar | ||
import com.mashup.dorabangs.core.designsystem.theme.LinkSaveColorTokens | ||
import com.mashup.dorabangs.feature.home.HomeViewModel | ||
import com.mashup.dorabangs.home.R | ||
|
||
@Composable | ||
fun HomeCreateFolderRoute( | ||
homeViewModel: HomeViewModel = hiltViewModel(), | ||
onClickBackIcon: () -> Unit, | ||
) { | ||
Log.d("DOAROA", "HomeCreateFolderRoute: $homeViewModel") | ||
HomeCreateFolderScreen( | ||
onClickBackIcon = onClickBackIcon, | ||
onClickSaveButton = {}, | ||
) | ||
} | ||
|
||
@Composable | ||
fun HomeCreateFolderScreen( | ||
onClickBackIcon: () -> Unit, | ||
onClickSaveButton: () -> Unit, | ||
modifier: Modifier = Modifier, | ||
) { | ||
Column( | ||
modifier = modifier | ||
.fillMaxSize() | ||
.background(color = LinkSaveColorTokens.ContainerColor), | ||
) { | ||
DoraTopBar.BackNavigationTopBar( | ||
modifier = Modifier, | ||
title = stringResource(id = R.string.home_create_folder_title), | ||
isTitleCenter = true, | ||
onClickBackIcon = onClickBackIcon, | ||
) | ||
Spacer(modifier = Modifier.height(height = 24.dp)) | ||
Column( | ||
modifier = modifier | ||
.fillMaxSize() | ||
.padding(horizontal = 20.dp), | ||
) { | ||
DoraTextField( | ||
text = "", | ||
hintText = stringResource(id = R.string.home_create_folder_hint), | ||
labelText = stringResource(id = R.string.home_create_folder_label), | ||
helperText = stringResource(id = R.string.home_create_folder_helper), | ||
helperEnabled = true, | ||
counterEnabled = true, | ||
onValueChanged = {}, | ||
) | ||
Spacer(modifier = Modifier.height(20.dp)) | ||
DoraButtons.DoraBtnMaxFull( | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.padding(vertical = 20.dp), | ||
buttonText = stringResource(id = R.string.home_create_folder_save), | ||
enabled = true, | ||
onClickButton = onClickSaveButton, | ||
) | ||
Spacer(modifier = Modifier.height(20.dp)) | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.mashup.dorabangs.feature.navigation | ||
|
||
import androidx.hilt.navigation.compose.hiltViewModel | ||
import androidx.navigation.NavController | ||
import androidx.navigation.NavGraphBuilder | ||
import androidx.navigation.NavOptions | ||
import androidx.navigation.compose.composable | ||
import com.mashup.core.navigation.NavigationRoute | ||
import com.mashup.dorabangs.feature.createfolder.HomeCreateFolderRoute | ||
import com.mashup.dorabangs.feature.home.HomeViewModel | ||
|
||
fun NavController.navigateToHomeCrateFolder(navOptions: NavOptions? = null) = | ||
navigate(NavigationRoute.HomeScreen.HomeCreateFolder.route, navOptions) | ||
|
||
fun NavGraphBuilder.homeCreateFolderNavigation( | ||
navController: NavController, | ||
onClickBackIcon: () -> Unit, | ||
) { | ||
composable( | ||
route = NavigationRoute.HomeScreen.HomeCreateFolder.route, | ||
) { | ||
navController.currentBackStackEntry?.let { backStackEntry -> | ||
val homeViewModel: HomeViewModel = hiltViewModel(backStackEntry) | ||
homeViewModel.savedStateHandle["isVisibleMovingBottomSheet"] = true | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기서 결국은 그래서 일단은 navcontroller 받는걸로 했는뎀 불만 있는 사람 이유 찾아죠ㅠㅠㅎ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ㅋㅋㅋ 일단 난 뭔 소린지 이해 못했어. |
||
HomeCreateFolderRoute( | ||
homeViewModel = homeViewModel, | ||
onClickBackIcon = onClickBackIcon, | ||
) | ||
} ?: HomeCreateFolderRoute( | ||
onClickBackIcon = onClickBackIcon, | ||
) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ddyeon
리소스 어노테이션 붙이면 더 좋을듯 ~~