-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from mash-up-kr/feature/create-folder-ui
홈과 보관함 폴더 생성/이름 변경 UI 및 navigation 추가
- Loading branch information
Showing
26 changed files
with
484 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
...re/home/src/main/java/com/mashup/dorabangs/feature/createfolder/HomeCreateFolderScreen.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
.../home/src/main/java/com/mashup/dorabangs/feature/navigation/HomeCreateFolderNavigation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.previousBackStackEntry?.let { backStackEntry -> | ||
val homeViewModel: HomeViewModel = hiltViewModel(backStackEntry) | ||
homeViewModel.savedStateHandle["isVisibleMovingBottomSheet"] = true | ||
|
||
HomeCreateFolderRoute( | ||
homeViewModel = homeViewModel, | ||
onClickBackIcon = onClickBackIcon, | ||
) | ||
} ?: HomeCreateFolderRoute( | ||
onClickBackIcon = onClickBackIcon, | ||
) | ||
} | ||
} |
Oops, something went wrong.