-
Notifications
You must be signed in to change notification settings - Fork 0
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
[TNT-185] 트레이니 마이페이지 UI 구현 #58
Conversation
- 연결하기 화면 연결 - 각 클릭 이벤트 설정
- Dialog에 띄울 문구 return
- handleSecondPopupConfirm 통해서 팝업에 맞는 API 호출 - 로그아웃, 계정 탈퇴 시 로그인 화면으로 이동
- API 연동 하면서 수정할 예정
- 외부 앱이 아닌 웹뷰로 띄우도록 수정 - state로 웹뷰 보여지기 여부와 url 관리
- height 제한을 없애고 minHeight를 설정
- 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.
고생하셨습니다 :->
코멘트 한 번 확인해주세요 _
// Small, XSmall 버튼을 위해 Button minWidth 설정 | ||
.defaultMinSize(minWidth = Dp.Hairline), | ||
// Small, XSmall 버튼을 위해 Button minWidth, minHeight 설정 | ||
modifier = modifier.defaultMinSize(minWidth = Dp.Hairline, minHeight = size.height), |
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.
modifier = modifier.defaultMinSize(minWidth = Dp.Hairline, minHeight = size.height), | |
modifier = modifier.defaultMinSize( | |
minWidth = Dp.Hairline, | |
minHeight = size.height | |
), |
2줄 이상이면 줄바꿈 해주는게 좋을 것 같습니다!
type = ButtonType.Primary, | ||
text = "텍스트", | ||
text = "텍스트ddddddddddddd", |
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.
넵.. 고민 해보겠습니다ㅋㅋㅋ큐ㅜㅜ
modifier: Modifier = Modifier, | ||
onClick: () -> Unit, | ||
) { | ||
CompositionLocalProvider(LocalMinimumInteractiveComponentSize provides 39.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.
Material 3의 버튼과 같은 터치 가능한 컴포넌트는 최소 터치 영역(48.dp) 을 가지도록 설계되어 있습니다. 이로 인해 버튼 높이가 48.dp보다 작을 경우 자동으로 여백이 추가되는 문제가 발생했습니다!
이를 해결하기 위해 LocalMinimumInteractiveComponentSize
를 사용하여 디자인에서 정의된 버튼의 최소 높이(39.dp) 로 최소 터치 가능 영역을 설정했습니다
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.
오호 넵넵 ㅎㅎ 좋습니다!!
WebViewScreen( | ||
url = state.url, | ||
onBackPress = onDismissWebView, | ||
) |
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.
음 이건 별도 스크린 분리해서 navigate
시키는게 맞는 것 같아요!
스크린 전체를 감싸는 컴포저블이 두 개가 생기니, 불필요한 BackHandler
와 같은 로직이 생기는 것 같아요!
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.
넵 분리해보겠습니다!
|
||
private fun loadUserData() { | ||
viewModelScope.launch { | ||
try { |
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.
runCatching
대신 try-catch
를 사용하신 이유가 있으실까요?
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.
엇 바꿔두겠습니다
val showFirstPopup: Boolean = false, | ||
val showSecondPopup: Boolean = false, |
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.
First
, Second
라는 표현은 처음 읽었을 때 조금 갸웃하게 만드는 감이 있는 것 같아요!
Warning
, Complete
라는 표현은 어떨까요?
그리고 출력해야 할 다이얼로그가 많은 경우 이런 방식도 생각해볼 수 있을 것 같아요!
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.
PopupType
enum class를 state로 관리중이긴 합니다!
val popupType: PopupType = PopupType.LOGOUT,
Warning과 Complete가 더 괜찮네요! 수정해두겠습니다
@Composable | ||
fun TnTSwitch( | ||
checked: Boolean, | ||
onCheckedChange: () -> Unit, |
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.
음.. 뭔가 네이밍이 버튼을 누르면 내부에서 checked
를 변화시킬 것 같은 느낌이에요!
단순하게 onClick
도 괜찮아 보입니다!
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.
좋습니다아! 수정해두겠습니다
val isConnected: Boolean = false, | ||
val isPushEnabled: Boolean = true, | ||
val appVersion: String = "0.0.0", | ||
val popupType: PopupType = PopupType.LOGOUT, |
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.
안드로이드 진영에서는 일반적으로 popup
보다는 dialog
라는 표현을 더 많이 사용하는 것 같습니돠!
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.
그렇담 dialog로 통일해오겠습니닥!
- 화면 연결은 아직 안 됨
- TraineeMyPageMainPage로 코드 이동
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.
WebViewScreen
으로 분리하고 바로 머지해주세요!
고생 많으셨습니다 👍👍👍👍👍 🏅🏅🏅🏅🏅
📝 작업 내용
Closes [TNT-185] 트레이니 마이페이지 UI 구현 #48
디자인 시스템 컴포넌트인
TnTSwitch
구현이전 PR의 Diet -> Meal 변경 안 된 부분 수정
트레이니 마이페이지 UI 구현
화면 설명
트레이너와 연결된 경우
트레이너와 연결 끊기
가 보여지고 연결되지 않은 경우트레이너와 연결하기
가 보여집니다Dialog가 보여지는 버튼이 3개(
로그아웃
,탈퇴
,연결 끊기
)이기 때문에PopupType
을 통해 보여져야 하는 스트링 리소스를 관리하고 있습니다.연달아 2개의 dialog가 보여져야 하고, 보여지기 여부는 state로 관리중입니다 (
showFirstPopup
,showSecondPopup
)트레이너와 연결하기
서비스 이용약관
,개인정보 처리방침
오픈소스 라이선스
로그아웃
,계정 탈퇴
트레이너와 연결 끊기
추가사항
📸 실행 화면
트레이니 마이페이지
trainee_mypage_final.mp4
텍스트 사이즈 최대로 키운 화면
trainee_mypage_fontSize.mp4
🙆🏻 리뷰 요청 사항
API 나오면 수정할 부분이 꽤 있을 것 같습니다..!
최대한 API 연동하기 편하게 구현해봤습니다🥺
👀 레퍼런스