-
Notifications
You must be signed in to change notification settings - Fork 3
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, FEAT] 메뉴 선택하기 / 검색 기본 화면 구성, CustomTextField, 공통 하단부 버튼 제작 #14 #15
Conversation
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.
좋씁니다
/** | ||
* @param modifier modifier를 통해 전체 컴포넌트의 크기, border 등을 설정한다. | ||
* modifier에서 정의한 border는 배경이 아닌 외부 테두리 선에만 영향을 준다 | ||
* | ||
* @param visualTransformation 입력된 텍스트의 값은 유지하면서, 화면에 보여지는 방식을 변경시킬 때 사용하는 파라미터이다. | ||
* 예를 들어서 비밀번호 입력 필드로 사용한다면, | ||
* PasswordVisualTransformation()을 인자로 주어 실제 값 대신 마스킹 된 값을 보여주도록 설정할 수 있다. | ||
* VisualTransformation을 직접 정의하여 커스텀할 수도 있다. (숫자에서 3자리 단위로 , 를 찍는 것과 같은 포맷팅 등) | ||
* | ||
* @param enabled 텍스트 필드의 활성화 여부를 나타내는 파라미터이고, true인 경우에는 입력이 가능하다 | ||
* | ||
* @param singleLine 입력된 텍스트를 한 줄로만 표시할지의 여부를 나타낸다. 기본값은 true | ||
* | ||
* @param shape 배경, 내부영역을 포함한 컴포넌트의 전체적인 모양 처리 | ||
* ex) RoundedCornerShape(8.dp) 등 | ||
* | ||
* @param trailingIcon 컴포넌트의 우측 끝에 위치하게 할 Icon 객체를 lambda를 통해 넘겨준다 | ||
* | ||
* @param leadingIcon 컴포넌트의 왼쪽 끝에 위치하게 할 Icon 객체를 lambda를 통해 넘겨준다 | ||
* | ||
* @param placeHolder placeholder로 사용할 Text 객체를 lambda를 통해 넘겨준다 | ||
* | ||
* @param textStyle 입력한 텍스트를 보여줄 스타일에 대한 TextStyle 객체를 통해 정의한다 | ||
* | ||
* @param paddingValues 컴포넌트의 텍스트 부분에 대한 padding 값을 PaddingValues 객체를 통해 정의한다 | ||
* | ||
* @param containerColor 컴포넌트의 색상을 Color 객체를 통해 지정한다 | ||
* 기본 값으로는 focused, unfocused에 대한 값을 동일하게 Color.White로 지정 | ||
* | ||
* @param cursorColor 커서에 대한 색상을 Color 객체를 통해 지정한다 | ||
* 기본 값으로는 Color.Black으로 지정 | ||
* | ||
* @param keyboardOptions 키보드에 대한 설정을 KeyboardOptions를 통해 지정한다 | ||
* | ||
* @param keyboardActions 키보드에서 특정 버튼을 눌렀을 때의 작업을 keyboardActions를 통해 지정한다 | ||
*/ |
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.
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.
대뮛 ~ 작성하느라 고생했습니다 🫡
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.
간략한 설명 추가해서 이후 pr에 반영해두겠습니다
fun BottomHalfWidthButton( | ||
onClick: () -> Unit, | ||
containerColor: Color, | ||
contentColor: Color, | ||
text: String | ||
) { |
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.
파라미터에 람다식이 하나만 존재하고, Slot Api 로 콘텐트를 넘겨주지 않는 컴포저블이면은 람다식을 가장 마지막 파라미터로 넘겨서 BottomHalfWidthButton(Color(0xFFC2C2C4). Color.White, "취소") { }
이런식으로 람다 표현식의 특징을 살려서 사용할 수 있게 하면 좋을 것 같아요.
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.
아래의 코드까지 파라미터 수정 사항 반영해두겠습니다
fun BottomFullWidthButton(onClick: () -> Unit, containerColor: Color, contentColor: Color, text: String) { | ||
Button( | ||
onClick = onClick, | ||
modifier = Modifier | ||
.fillMaxWidth() | ||
.size(320.dp, 52.dp) | ||
.shadow(elevation = 4.dp, shape = RoundedCornerShape(12.dp)), | ||
shape = RoundedCornerShape(12.dp), | ||
colors = ButtonDefaults.buttonColors( | ||
containerColor = containerColor, | ||
contentColor = contentColor | ||
), |
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.
마찬가지로 onClick 을 마지막 파라미터로 설정
AddMenuBottomSheetContent() | ||
}, | ||
//조건 만족하면 bottom sheet 보여주고, 아니면 화면에 안보이도록 처리 | ||
sheetPeekHeight = if (showBottomSheet) 100.dp else 0.dp, |
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.
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.
초반에 작성해두고 확인을 못한 것 같네요. 수정사항 반영해두겠습니다!
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.
올려준 화면 이미지 보니까 AddMenuScreen에서 검색바의 그림자가 잘못된거같은데 확인 부탁드립니당 ~ 💪
fun AddMenuTopAppBar(topAppbarText : @Composable (() -> Unit)) { | ||
TopAppBar( | ||
title = { | ||
topAppbarText() | ||
}, | ||
navigationIcon = { | ||
IconButton(onClick = { TODO("뒤로가기 구현") }) { | ||
Icon( | ||
painter = painterResource(R.drawable.ic_top_bar_back), | ||
contentDescription = "Back" | ||
) | ||
} | ||
}, | ||
modifier = Modifier | ||
.drawBehind { | ||
drawRect( | ||
color = Color.Black | ||
) | ||
} | ||
.shadow(elevation = 4.dp) | ||
) | ||
} |
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.
탑바 공통으로 안빼고 이렇게 각 파일에서 만들기로했었나요? (진짜 기억 안나서 물어보는것 ..)
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.
따로 정하지는 않았던 것 같은데 우선 작업한 화면에서는 공통으로 묶어둔거라 공통으로 뺄지 정해서 수정하면 될 것 같습니다
Text(text = "아워떡볶이", fontSize = 16.sp, fontWeight = FontWeight.Bold) | ||
Text(text = "서울 광진구 능동로 112", fontSize = 14.sp, color = Color.Gray) |
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.
더미데이터라도 이렇게 자주 쓰일만한 text값은 리소스로 빼면 좋을거같아욧 ~
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.
그리고 늦어져서 죄송 .... 하지만 제가 곧 폰트랑 컬러 올릴거라 설정 다 바꿔야할수도 .... 늦어서 고멘 ...
|
||
@Composable | ||
fun SelectMenuItem(isSelected: Boolean = false) { | ||
HorizontalDivider( |
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.
호옹 그동안 그냥 divider만 사용했었는데 HorizontalDivider로 따로 쓸수있는건 몰랐네요 꿀팁 알아갑니다 ~
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.
Divider가 deprecated 되고 HorizontalDivider로 바뀐 것 같아요
Text(text = "메뉴 이름", fontSize = 16.sp, fontWeight = FontWeight.Bold) | ||
Text(text = "14,000원", fontSize = 14.sp, color = Color.Gray) | ||
} | ||
if(isSelected){ |
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.
이런거 신경써서 자동정렬되게 해주면 좋을거같아요 ~ 아래 else문도 마찬가지 ~
/** | ||
* @param modifier modifier를 통해 전체 컴포넌트의 크기, border 등을 설정한다. | ||
* modifier에서 정의한 border는 배경이 아닌 외부 테두리 선에만 영향을 준다 | ||
* | ||
* @param visualTransformation 입력된 텍스트의 값은 유지하면서, 화면에 보여지는 방식을 변경시킬 때 사용하는 파라미터이다. | ||
* 예를 들어서 비밀번호 입력 필드로 사용한다면, | ||
* PasswordVisualTransformation()을 인자로 주어 실제 값 대신 마스킹 된 값을 보여주도록 설정할 수 있다. | ||
* VisualTransformation을 직접 정의하여 커스텀할 수도 있다. (숫자에서 3자리 단위로 , 를 찍는 것과 같은 포맷팅 등) | ||
* | ||
* @param enabled 텍스트 필드의 활성화 여부를 나타내는 파라미터이고, true인 경우에는 입력이 가능하다 | ||
* | ||
* @param singleLine 입력된 텍스트를 한 줄로만 표시할지의 여부를 나타낸다. 기본값은 true | ||
* | ||
* @param shape 배경, 내부영역을 포함한 컴포넌트의 전체적인 모양 처리 | ||
* ex) RoundedCornerShape(8.dp) 등 | ||
* | ||
* @param trailingIcon 컴포넌트의 우측 끝에 위치하게 할 Icon 객체를 lambda를 통해 넘겨준다 | ||
* | ||
* @param leadingIcon 컴포넌트의 왼쪽 끝에 위치하게 할 Icon 객체를 lambda를 통해 넘겨준다 | ||
* | ||
* @param placeHolder placeholder로 사용할 Text 객체를 lambda를 통해 넘겨준다 | ||
* | ||
* @param textStyle 입력한 텍스트를 보여줄 스타일에 대한 TextStyle 객체를 통해 정의한다 | ||
* | ||
* @param paddingValues 컴포넌트의 텍스트 부분에 대한 padding 값을 PaddingValues 객체를 통해 정의한다 | ||
* | ||
* @param containerColor 컴포넌트의 색상을 Color 객체를 통해 지정한다 | ||
* 기본 값으로는 focused, unfocused에 대한 값을 동일하게 Color.White로 지정 | ||
* | ||
* @param cursorColor 커서에 대한 색상을 Color 객체를 통해 지정한다 | ||
* 기본 값으로는 Color.Black으로 지정 | ||
* | ||
* @param keyboardOptions 키보드에 대한 설정을 KeyboardOptions를 통해 지정한다 | ||
* | ||
* @param keyboardActions 키보드에서 특정 버튼을 눌렀을 때의 작업을 keyboardActions를 통해 지정한다 | ||
*/ |
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.
대뮛 ~ 작성하느라 고생했습니다 🫡
[ui, feat] 메뉴 선택하기 / 검색 기본 화면 구성, CustomTextField, 공통 하단부 버튼 제작
🚀 이슈번호
✏️ 변경사항
📷 스크린샷
AddMenuSearchScreen
![image](https://private-user-images.githubusercontent.com/93777192/402195776-db5f512f-86c9-43ee-8e89-16aa39b2e216.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MzIzMDgsIm5iZiI6MTczOTYzMjAwOCwicGF0aCI6Ii85Mzc3NzE5Mi80MDIxOTU3NzYtZGI1ZjUxMmYtODZjOS00M2VlLThlODktMTZhYTM5YjJlMjE2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDE1MDY0OFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTViNjI0MTYyNDM0YzQ2YjU0NTk4NjU2YTRlZWFkN2I1NTdiNDE3OTNhMWYwZjQ0YTdjNmY3Yzk1MjgxMWVhOGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.42KzYNToNC7D85pIV2gewCXaU7jCEbaNwdU15xoTHnk)
BottomFullWidthButton
![image](https://private-user-images.githubusercontent.com/93777192/402195797-49124b5d-d326-472c-b405-1586db37ef4b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2MzIzMDgsIm5iZiI6MTczOTYzMjAwOCwicGF0aCI6Ii85Mzc3NzE5Mi80MDIxOTU3OTctNDkxMjRiNWQtZDMyNi00NzJjLWI0MDUtMTU4NmRiMzdlZjRiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1Dcm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aljtWS6gXINtdZeI4EcwmDGaVQ3pkQ)
✍️ 사용법
CustomTextField (공통 컴포넌트)
BottomFullWidthButton, BottomHalfWidthButton (공통 컴포넌트)
🎸 기타