-
Notifications
You must be signed in to change notification settings - Fork 1
[Koin Project][Refactor] 동아리 상세 화면 스크롤 logic 변경 #1130
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
base: develop
Are you sure you want to change the base?
Conversation
Add club scroll test
Change scroll event
Feat ktlint
Fix scroll event to handle new scroll logic
Feat ktlint
kongwoojin
left a comment
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.
Recomposition이 너무 많아요
스크롤 할때마다 10씩 올라가는데, 무조건 성능 문제 생깁니다
|
Recomposition 이 많이 발생하는 이유는 개인적으로는 자연스러운 scroll 을 위한 필수 불가결한 문제라고 생각합니다. 그래서 주의깊게 볼 부분은 recompostition 횟수보단 |
Recomposition이 일어나더라도, recomposition이 필요한 컴포넌트를 제외하고는 skip이 되어야하는데, 지금은 그렇지 않은 것 같습니다. |
그럼 우선 적용은 보류로 하고 |
…o refactor/club-detail-scroll
Delete unremember variable to skip recomposition
Change listof variable to remember persistentlist
| import androidx.compose.ui.input.nestedscroll.NestedScrollConnection | ||
| import androidx.compose.ui.input.nestedscroll.NestedScrollSource | ||
|
|
||
| fun clubDetailScrollConnection( |
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.
공통으로 사용 가능한 컴포넌트는 core 모듈쪽으로 빼는거는 어떨까요?



PR 개요
이슈 번호: 1129
PR 체크리스트
작업사항
작업사항의 상세한 설명
동아리 화면에 딱딱하던 스크롤을 부드럽게 바꾸었습니다.
알림 클릭 시 발생하는 scroll 이벤트도 새로운 logic 에 맞도록 모두 수정했습니다.
(toolbar 를 전부 스크롤 한 후 메인 화면을 스크롤로 넘어가는 단계에서 한번 스크롤이 막히는 현상이 존재)
논의 사항
식단 화면의 스크롤과는 logic 이 비슷하지만 다릅니다.
식단
동아리
이에 다음과 같은 변화가 필요했습니다.
[전체 toolBar 크기를 측정하는 단계] 부분
Layout 을 사용해 measurable 로 측정할까 했지만
toolbar 의 내부 요소가 너무 방대, 최소 1회성 단발 측정만 필요, recomposition 마다 측정이 다수 발생할 수 있음
등의 문제 상황이 있어
onSizeChanged와Modifier.then으로 단발성 측정만 시도했습니다.[Box 와 offset 을 통한 scroll효과 대신 LazyColumn 과 height 를 통한 scroll효과] 부분
scroll 관련 로직은 nestedScroll 에 모두 정의되어 있어 nestedScroll 을 통하는 scroll 만 사용해야 합니다.
근데 nestedScroll 에 스크롤 정보를 넘겨주기 위해서는 LazyColumn 이나 Column(스크롤가능) 의 컴포넌트만 가능합니다.
(Box 불가능)
그렇기에 scrollState 를 만들지 않아도 작동하는 LazyColumn 으로 구성하였고
offset 이 아닌
reverseLayout = true옵션(역순 구조화)을 통해 화면을 바닥 고정으로 하여 스크롤 시 상단 부분이 사라지도록 했습니다.(옵션을 빼면 하단 부분부터 사라집니다.)
이후 tab 목록을 같이 넣으려 했으나 해당 옵션으로 역순 구조화 덕분에 그리는 순서(item)를 역순으로 구조화 해야하니 코드 가독성이 떨어질 것 같다 그냥 LazyColumn 을 하나 더 만들어 처리했습니다.
그 밖에도 알림을 누를 시 해당 페이지로 이동(스크롤)하는 기능 을 위해 스크롤 부분도 수정이 되었습니다.
다시 생각해도 코드가 너무 개판이라
압축 혹은 가독성을 높일 수 있을 거 같은 요인은 언제나 말씀해주세요.
스크린샷
KakaoTalk_20251029_173657853.mp4
기왕이면 직접 pull 해서 사용해보세요
추가내용