-
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
시간대 검색 #239
시간대 검색 #239
Conversation
.github/workflows/cd-staging.yml
Outdated
@@ -0,0 +1,60 @@ | |||
name: CD-STAGING |
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.
이거 넣어두면 나도 커스텀테마 릴리즈를 뽑을 수 있겠군
tagTypePlaceable.height + 40.dp.toPx().roundToInt() + confirmButtonPlaceable.height | ||
maxSheetHeightPx = dragSheetPlaceable.height | ||
layout( | ||
tagTypePlaceable.width, |
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.
tagTypePlaceable.width + tagListPlaceable.width면 https://wafflestudio.slack.com/archives/C0PAVPS5T/p1705298677425979?thread_ts=1705249885.346309&cid=C0PAVPS5T 이거 해결된다
바텀시트에 기본으로 하얀색이 깔려있어서 잘 안보였네
baseAnimatedFloat = baseAnimatedFloat, | ||
// tag column의 높이를 tagType column의 높이로 설정 | ||
height = tagTypePlaceable.height.toDp(), | ||
width = constraints.maxWidth.toDp() - tagTypePlaceable.width.toDp(), |
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를 인자로 넘기지 않고 baseAnimatedFloat을 넘긴건 TagsColumn 내에서 alpha, offset 관리하려고 인거야?
height width도 modifier로 안하고 직접 넘긴 것도 궁금
근데 커밋에 초안이라고 되어있었넹
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.
TagsColumn만의 애니메이션 값인 alphaAnimatedFloat, offsetXAnimatedDp를 외부에서 받으면 바깥이 너무 지저분해서 읽기가 힘들더라구 그래서 저렇게 했는데 고민되네
뭔가....리뷰라기보단 SubcomposeLayout 공부를 했네....ㅋㅋㅋ SubcomposeLayout 신기하다 |
modifier = Modifier | ||
.alpha(alphaAnimatedFloat) | ||
.padding(bottom = 20.dp) | ||
.heightIn(max = LocalConfiguration.current.screenHeightDp.dp * 0.8f), |
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.
fillMaxHeight(0.8f)로 해도 되나? 표면상 똑같긴한데
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.
그래도 맥락을 더 표현할 수 있는 건 LocalConfiguration.current.screenHeightDp.dp * 0.8f 같다
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.
그렇군 heightIn 말고 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.
아 맞네 어차피
1.val dragSheetPlaceable = subcompose(slotId = 3)
에서 TimeSelectSheet의 높이 measure
2. sheetHeightAnimatedPx는, measure된 TimeSelectSheet의 높이를 최대값으로 animate
3. SubcomposeLayout의 layout() 에서 height를 sheetHeightAnimatedPx로 설정
이런 플로우니까 heightIn을 할 필요가 없네
나는 TimeSelectSheet가 내부의 fillMaxSize때문에 항상 화면 전체를 채우고자 할 거라고 생각해서 저렇게 한 거였는데, 사실 TimeSelectSheet 자신의 높이가 자신의 constraint가 되는 구조였음ㅋㅋㅋ
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.
tag column의 높이를 tagType column의 높이로 설정하려고 SubcomposeLayout 굳이 썼던 거였는데 그냥 형태 유지하면서 짜다보니까 slotId 4까지 있는 SubcomposeLayout이 되긴 했네 |
val unitWidth by remember { | ||
derivedStateOf { | ||
(canvasSize.width - hourLabelWidth) / (fittedTrimParam.dayOfWeekTo - fittedTrimParam.dayOfWeekFrom + 1) | ||
} | ||
} | ||
val unitHeight by remember { | ||
derivedStateOf { | ||
(canvasSize.height - dayLabelHeight) / ((fittedTrimParam.hourTo - fittedTrimParam.hourFrom + 1) * 2) // 30분 칸의 높이 | ||
} | ||
} |
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.pointerInput 람다에 캔버스 크기랑 똑같은 size가 주어져서 그거 쓰면 캔버스의 content에서 canvasSize 저장하는 거 필요없을 것 같아
별도의 패딩이 없는 한 같은 size가 들어온대 컬러피커도 이렇게 했어
Canvas(
modifier = Modifier
.fillMaxSize()
.pointerInput(Unit) {
val unitWidth = (size.width - hourLabelWidth) / (fittedTrimParam.dayOfWeekTo - fittedTrimParam.dayOfWeekFrom + 1)
val unitHeight = (size.height - dayLabelHeight) / ((fittedTrimParam.hourTo - fittedTrimParam.hourFrom + 1) * 2)
detectDragGestures(
onDragStart = { offset ->
...
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.
아 근데 저렇게하면 수많은 pointerInput마다 unitWidth, unitHeight 계산하게돼서 그거 한번만 계산할려고 이렇게 했어
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.
아하 근데 로그 찍어보니까 onDrag안에 있는게 아니라서 한 번만 계산하는듯? 최초 드래그랑 탭에서만 계산하고 이후로는 안하네
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.
이러면 canvas 쓸필요없지 개꿀~
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.
아 근데 드래그 살짝 반응 느린 문제있어서 (dragStart 콜백이 좀 늦어서, 한 칸의 구석에서 드래그를 시작하면 그 칸이 dragStart나 drag 콜백을 못 받음)
pointerInput(Key) 이거 못 쓰고 pointerInteropFilter 써야될듯 ㄲㅂ
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.
pointerInteropFilter에만 MotionEvent.ACTION_DOWN가 있어서..
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.
대신 TimeTablePage에서 터치 이벤트 받는 부분을 고쳤다
} | ||
} | ||
|
||
DrawDragEventCanvas( |
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.
DrawDragEventCanvas랑 DrawTimeBlock이 분리되어 있는 건 draggedTimeBlock이 바뀌어도 드래그 입력 받는 부분은 recompose되지 않도록 하기 위한거야?
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.
응 저거 나름 DrawTimeBlock 재구성 최소화할려고 신경쓴부분임 ㅋㅋㅋ
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.
개별 블록은 자기가 그려질때나 지워질 때 빼고 recompose 안되게 해놨음
BackHandler { | ||
resetToInitialBlocks() | ||
onCancel() | ||
} |
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.
뒤로가기나 취소를 누르지 않고 바텀시트 바깥 영역을 눌러서 dismiss하면 바텀시트 다시 올렸을 때 태그선택이 아니라 시간 선택 화면이 뜨는데 의도된 동작인가요
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.
지금 모달바텀시트가 바깥 영역(scrim) 눌러서 dismiss하는 것의 콜백을 못 받을걸?
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.
그거 받을려고 옛날 바텀시트에서 이상한 짓을 좀 했는데 너무 버그 많아서 포기했고, 모달바텀시트 코드 복붙해와서 콜백 달았었던게 지금 주석으로 남아있는 onDissmissScrim
인가 그건데 관리하기 귀찮아서 그냥 지웠던거같다
scrim눌러서 닫으면 잠시 닫아놓는 느낌이라고 생각하면 크게 어색하진 않더라구 그래서 냅둠
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.
@@ -80,6 +83,7 @@ fun SearchPage( | |||
val selectedLecture by searchViewModel.selectedLecture.collectAsState() | |||
val pageMode by searchViewModel.pageMode.collectAsState() | |||
val firstBookmarkAlert by userViewModel.firstBookmarkAlert.collectAsState() | |||
val draggedTimeBlock = searchViewModel.draggedTimeBlock.collectAsState() |
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.
여기 by 없어도 돼? 자식 컴포저블들이 다 state로 받아서 .value 쓰고있길래
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.
아 맞네 근데 뭐 있으나없으나 차이 없을듯
draggedTimeBlock을 자식의자식까지 내려보낼 때 만약 자식에서는 그 State를 안 쓰면 value상태가 아니라 State째로 전달시켜야 recompose 줄이는 도넛홀 머시기 생각해보면, 그 컴포저블에서 state.value 안 쓰면 습관적으로 State로 선언하는것도 나쁘지않은듯
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.
아 맞지
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.
도넛홀 스킵이랑은 다른거긴한데
...
setContent {
val text = remember {
mutableStateOf("hi")
}
Parent(num = text)
}
...
@Composable
fun Parent(num: State<String>) {
SideEffect {
Log.d("aaaa", "parent")
}
Child(num = num)
}
@Composable
fun Child(num: State<String>) {
SideEffect {
Log.d("aaaa", "child")
}
Text(text = num.value)
}
이렇게 있을 때 text.value 바꾸면 Child만 recompose 되는데
...
setContent {
var text by remember {
mutableStateOf("hi")
}
Parent(num = text)
}
...
@Composable
fun Parent(num: String) {
SideEffect {
Log.d("aaaa", "parent")
}
Child(num = num)
}
@Composable
fun Child(num: String) {
SideEffect {
Log.d("aaaa", "child")
}
Text(text = num)
}
이렇게 상단에서부터 by로 value 까버리면 text 값 바뀔 때 parent도 recompose되니까
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.
항상 by를 쓸 필요는 없구나
val alphaAnimatedFloat by remember { | ||
derivedStateOf { 1f - baseAnimatedFloat.value } | ||
} | ||
val offsetXAnimatedDp by remember { | ||
derivedStateOf { | ||
baseAnimatedFloat.value.dp * -SearchOptionSheetConstants.TagColumnWidthDp | ||
} | ||
} |
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.
얘네 derivedState여야 해? 그냥 변수로 해도 잘 되네 TagsColumn에서도 마찬가지
val alphaAnimatedFloat = 1f - baseAnimatedFloat.value
val offsetXAnimatedDp = baseAnimatedFloat.value.dp * -SearchOptionSheetConstants.TagColumnWidthDp
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.
아 그렇네 어차피 baseAnimatedFloat바뀌면 무조건 바뀌는 값이니까 굳이 derivedState 할 필요가 없구나
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 timeSlotsToFormattedString(context: Context, booleanArray: List<List<Boolean>>): 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.
SearchViewModel에서 _searchTimeList를 public으로 만들고 얘를 List를 String으로 변환하는 함수로 하면 겹치는 로직 없앨 수 있지 않을까? SearchOptionSheet에 파라미터로 draggedTimeBlock이랑 searchTimeList가 둘 다 들어가는 게 좀 별론가
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.
그냥 저거 짤때 스트레스 너무받아서 다시 쳐다보기 싫었어
var normalSheetHeightPx = remember { 0 } // 태그 선택 sheet의 높이 | ||
var maxSheetHeightPx = remember { 0 } // 시간대 선택 sheet의 높이 | ||
val sheetHeightAnimatedPx = remember { | ||
derivedStateOf { | ||
// 태그 선택 sheet의 높이 ~ 시간대 선택 sheet의 높이까지 baseAnimatedFloat에 따라 변하는 값 | ||
(normalSheetHeightPx + baseAnimatedFloat.value * (maxSheetHeightPx - normalSheetHeightPx)).roundToInt() | ||
} | ||
} |
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.
SearchOptionSheet 클 때 작을 때 사이즈 정해져있으니까 캔버스에서 측정해서 넣어줄 필요 없지 않아?
작을 때 높이는 SearchOptionSheetContants.TagColumnWidthDp, 클 때 높이는 스크린 높이 * 0.8f
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.
작을 때 높이가 SearchOptionSheetContants.TagColumnWidthDp 가 아니지 않나?
tagTypeColumn 높이 + 적용 버튼 높이 + 상단 마진 40dp 라서 계산이 SubcomposeLayout 안에서 됨
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.
아 나 레전드네 width보고 height 생각하고있었네
stiffness = 200f, | ||
) | ||
|
||
@ColorInt val BackgroundLectureBlockColor = Color.argb(153, 27, 208, 200) |
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.
@ColorInt란 게 있구나 커템에도 넣어야겠다
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.
가독성 원툴이긴 하지만 있으면 확실히 보기 좋은듯
detectTapGestures( | ||
// drag가 아닌 단순 tap도 따로 콜백을 달아야 한다. | ||
onTap = { offset -> | ||
// 여기서는 drag 콜백에서 썼던 touchedTimeIndex, erase 등등을 사용하지 않는다. (충돌 방지) |
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.
erase는 여기서도 쓰는 거 아냐? touchedDayIndex 오타?
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.
어그러네 erase는 쓰지
touchedDayIndex와 touchedTimeIndex의 값을 읽기만 하고 쓰지 않는다
가 정확할듯
drag랑 tap이랑 둘 다 저 변수에 값 write하면, 한 칸 내에서 손가락 탭&드래그 아주 살짝 할 때 깜빡! 하고 칠해졌다 지워졌다 반복되고 그러는 문제가 있었어
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 TimeBlockColor = ColorDto( | ||
fgRaw = "#FFFFFF", | ||
bgRaw = "#B3DADADA", | ||
) |
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.
흠 유진이한테 색깔 뭐쓸지 물어볼까
tagTypePlaceable.placeRelative( | ||
0, | ||
SearchOptionSheetConstants.TopMargin.toPx().roundToInt(), | ||
) | ||
tagListPlaceable.placeRelative( | ||
tagTypePlaceable.width, | ||
SearchOptionSheetConstants.TopMargin.toPx().roundToInt(), | ||
) | ||
confirmButtonPlaceable.placeRelative( | ||
0, | ||
tagTypePlaceable.height + SearchOptionSheetConstants.TopMargin.toPx() | ||
.roundToInt(), | ||
) |
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.
코멘트 자꾸 하나씩 빼먹네...
얘네도 dragSheetPlaceable처럼 if (baseAnimatedFloat.value != 1f)로 감쌀 필요는 없어?
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.
어차피 화면에 안보이고 터치도 안돼서 상관없지 않을까 했음
@eastshine2741 3142256에서 드래그 격자 시트 로직 좀 바꿨음 근데 변경사항 읽기는 불편할거라 그냥 DrawDragEventDetector 함수 통째로 다시 함 보기 ㄱㄱ (기본 로직은 거의 같음) |
...rc/main/java/com/wafflestudio/snutt2/views/logged_in/home/search/search_option/TagsColumn.kt
Outdated
Show resolved
Hide resolved
@eastshine2741 다크모드 색깔 대충 #666666 으로 함 어푸루브 ㄱㄱ |
끄악 컨플릭트 |
No description provided.