-
Notifications
You must be signed in to change notification settings - Fork 1
feat: 컬렉션 생성 화면 기본 UI 구현 #943
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
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
a88bea1
feat: 컬렉션 생성 화면 추가 및 네비게이션 연결
devfeijoa e7c39cb
feat: 컬렉션 생성 버튼 내 클릭 상호작용 추가
devfeijoa 142052d
feat: 컬렉션 화면 내 생성 화면 이동 로직 추가
devfeijoa bf8acfa
feat: 컬렉션 생성 화면 내 앱바 추가 및 레이아웃 수정
devfeijoa bccf4ef
refactor: 컬렉션 생성 화면 내 임시 플레이스홀더 제거
devfeijoa 2b1a3b6
feat: 컬렉션 생성 화면 내 공개 여부 설정 컴포넌트 추가
devfeijoa 33b02f9
feat: 컬렉션 생성 화면 내 이름 입력 컴포넌트 추가
devfeijoa 4b72b18
feat: 컬렉션 생성 화면 내 설명 입력 필드 추가
devfeijoa a5add47
feat: 컬렉션 생성 화면 내 작품 리스트 섹션 추가
devfeijoa 7345478
refactor: feat/934 변경 사항을 feat/935에 동기화
devfeijoa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
78 changes: 78 additions & 0 deletions
78
...re/collection/src/main/java/com/into/websoso/feature/collection/CollectionCreateScreen.kt
This file contains hidden or 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,78 @@ | ||
| package com.into.websoso.feature.collection | ||
|
|
||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.fillMaxSize | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.layout.statusBarsPadding | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.getValue | ||
| import androidx.compose.runtime.mutableStateOf | ||
| import androidx.compose.runtime.saveable.rememberSaveable | ||
| import androidx.compose.runtime.setValue | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.into.websoso.core.designsystem.theme.WebsosoTheme | ||
| import com.into.websoso.core.designsystem.theme.White | ||
| import com.into.websoso.feature.collection.component.CollectionCreateAppBar | ||
| import com.into.websoso.feature.collection.component.CollectionDescriptionInput | ||
| import com.into.websoso.feature.collection.component.CollectionNameInput | ||
| import com.into.websoso.feature.collection.component.CollectionNovelSection | ||
| import com.into.websoso.feature.collection.component.CollectionPrivacySetting | ||
|
|
||
| @Composable | ||
| internal fun CollectionCreateScreen( | ||
| onNavigateBack: () -> Unit, | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
| var isPrivate by rememberSaveable { mutableStateOf(false) } | ||
| var collectionName by rememberSaveable { mutableStateOf("") } | ||
| var collectionDescription by rememberSaveable { mutableStateOf("") } | ||
|
|
||
| Column( | ||
| modifier = modifier | ||
| .fillMaxSize() | ||
| .background(White) | ||
| .statusBarsPadding(), | ||
| ) { | ||
| CollectionCreateAppBar(onNavigateBack = onNavigateBack) | ||
| CollectionPrivacySetting( | ||
| isPrivate = isPrivate, | ||
| onPrivateChange = { isPrivate = it }, | ||
| ) | ||
| CollectionNameInput( | ||
| value = collectionName, | ||
| onValueChange = { collectionName = it }, | ||
| modifier = Modifier.padding( | ||
| start = 20.dp, | ||
| top = 20.dp, | ||
| end = 20.dp, | ||
| ), | ||
| ) | ||
| CollectionDescriptionInput( | ||
| value = collectionDescription, | ||
| onValueChange = { collectionDescription = it }, | ||
| modifier = Modifier.padding( | ||
| start = 20.dp, | ||
| top = 30.dp, | ||
| end = 20.dp, | ||
| ), | ||
| ) | ||
| CollectionNovelSection( | ||
| modifier = Modifier.padding( | ||
| start = 20.dp, | ||
| top = 30.dp, | ||
| end = 20.dp, | ||
| ), | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun CollectionCreateScreenPreview() { | ||
| WebsosoTheme { | ||
| CollectionCreateScreen(onNavigateBack = {}) | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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
65 changes: 65 additions & 0 deletions
65
...ion/src/main/java/com/into/websoso/feature/collection/component/CollectionCreateAppBar.kt
This file contains hidden or 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,65 @@ | ||
| package com.into.websoso.feature.collection.component | ||
|
|
||
| import androidx.compose.foundation.Image | ||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.layout.size | ||
| import androidx.compose.material3.IconButton | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.res.painterResource | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.into.websoso.core.designsystem.theme.Gray100 | ||
| import com.into.websoso.core.designsystem.theme.WebsosoTheme | ||
| import com.into.websoso.core.designsystem.theme.White | ||
| import com.into.websoso.core.resource.R.drawable.ic_navigate_left | ||
|
|
||
| @Composable | ||
| internal fun CollectionCreateAppBar( | ||
| onNavigateBack: () -> Unit, | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
| Box( | ||
| modifier = modifier | ||
| .fillMaxWidth() | ||
| .height(44.dp) | ||
| .background(White), | ||
| contentAlignment = Alignment.Center, | ||
| ) { | ||
| IconButton( | ||
| onClick = onNavigateBack, | ||
| modifier = Modifier | ||
| .align(Alignment.CenterStart) | ||
| .padding(start = 6.dp) | ||
| .size(44.dp), | ||
| ) { | ||
| Image( | ||
| painter = painterResource(id = ic_navigate_left), | ||
| contentDescription = null, | ||
| modifier = Modifier.size(24.dp), | ||
| ) | ||
| } | ||
| Text( | ||
| text = "완료", | ||
| color = Gray100, | ||
| style = WebsosoTheme.typography.title2, | ||
| modifier = Modifier | ||
| .align(Alignment.CenterEnd) | ||
| .padding(horizontal = 20.dp), | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun CollectionCreateAppBarPreview() { | ||
| WebsosoTheme { | ||
| CollectionCreateAppBar(onNavigateBack = {}) | ||
| } | ||
| } |
This file contains hidden or 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
98 changes: 98 additions & 0 deletions
98
...src/main/java/com/into/websoso/feature/collection/component/CollectionDescriptionInput.kt
This file contains hidden or 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,98 @@ | ||
| package com.into.websoso.feature.collection.component | ||
|
|
||
| import androidx.compose.foundation.background | ||
| import androidx.compose.foundation.layout.Arrangement | ||
| import androidx.compose.foundation.layout.Box | ||
| import androidx.compose.foundation.layout.Column | ||
| import androidx.compose.foundation.layout.fillMaxWidth | ||
| import androidx.compose.foundation.layout.height | ||
| import androidx.compose.foundation.layout.padding | ||
| import androidx.compose.foundation.shape.RoundedCornerShape | ||
| import androidx.compose.foundation.text.BasicTextField | ||
| import androidx.compose.material3.Text | ||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.ui.Alignment | ||
| import androidx.compose.ui.Modifier | ||
| import androidx.compose.ui.graphics.SolidColor | ||
| import androidx.compose.ui.tooling.preview.Preview | ||
| import androidx.compose.ui.unit.dp | ||
| import com.into.websoso.core.designsystem.theme.Black | ||
| import com.into.websoso.core.designsystem.theme.Gray100 | ||
| import com.into.websoso.core.designsystem.theme.Gray200 | ||
| import com.into.websoso.core.designsystem.theme.Gray50 | ||
| import com.into.websoso.core.designsystem.theme.Primary100 | ||
| import com.into.websoso.core.designsystem.theme.WebsosoTheme | ||
|
|
||
| private const val COLLECTION_DESCRIPTION_MAX_LENGTH = 60 | ||
|
|
||
| @Composable | ||
| internal fun CollectionDescriptionInput( | ||
| value: String, | ||
| onValueChange: (String) -> Unit, | ||
| modifier: Modifier = Modifier, | ||
| ) { | ||
| Column( | ||
| modifier = modifier.fillMaxWidth(), | ||
| verticalArrangement = Arrangement.spacedBy(10.dp), | ||
| ) { | ||
| Text( | ||
| text = "컬렉션 설명", | ||
| color = Black, | ||
| style = WebsosoTheme.typography.title2, | ||
| ) | ||
| Column( | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .height(112.dp) | ||
| .background( | ||
| color = Gray50, | ||
| shape = RoundedCornerShape(14.dp), | ||
| ).padding( | ||
| horizontal = 16.dp, | ||
| vertical = 18.dp, | ||
| ), | ||
| ) { | ||
| BasicTextField( | ||
| value = value, | ||
| onValueChange = { changedValue -> | ||
| onValueChange(changedValue.take(COLLECTION_DESCRIPTION_MAX_LENGTH)) | ||
| }, | ||
| modifier = Modifier | ||
| .fillMaxWidth() | ||
| .weight(1f), | ||
| textStyle = WebsosoTheme.typography.body2.copy(color = Black), | ||
| cursorBrush = SolidColor(Primary100), | ||
| decorationBox = { innerTextField -> | ||
| Box { | ||
| if (value.isEmpty()) { | ||
| Text( | ||
| text = "컬렉션에 관련한 설명을 간단하게 작성해주세요", | ||
| color = Gray100, | ||
| style = WebsosoTheme.typography.body2, | ||
| ) | ||
| } | ||
| innerTextField() | ||
| } | ||
| }, | ||
| ) | ||
| Text( | ||
| text = "(${value.length}/$COLLECTION_DESCRIPTION_MAX_LENGTH)", | ||
| color = Gray200, | ||
| style = WebsosoTheme.typography.body2, | ||
| modifier = Modifier.align(Alignment.End), | ||
| ) | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @Preview(showBackground = true) | ||
| @Composable | ||
| private fun CollectionDescriptionInputPreview() { | ||
| WebsosoTheme { | ||
| CollectionDescriptionInput( | ||
| value = "", | ||
| onValueChange = {}, | ||
| modifier = Modifier.padding(20.dp), | ||
| ) | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.