Skip to content

Feat/week2 과제 완성#17

Open
shinyena00 wants to merge 2 commits intoApptiveDev:신예나from
shinyena00:feat/week2
Open

Feat/week2 과제 완성#17
shinyena00 wants to merge 2 commits intoApptiveDev:신예나from
shinyena00:feat/week2

Conversation

@shinyena00
Copy link
Copy Markdown

변경점 👍

sns 피드 ui 구현했습니다!


사용하지 않은 항목은 모두 지워주세요.

Copy link
Copy Markdown
Collaborator

@yeochaeeon yeochaeeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UI 디자인에 신경을 꽤나 써주신 것 같습니다 !!
과제 엄청 열심히 해주셨네요 ㅎㅎㅎ
오늘 스터디 때 뵐게요~~

Column(
modifier = Modifier.weight(1f),
){
dummy.filterIndexed { index, _ -> index % 2 == 1}.forEach {post ->
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

피드를 두 줄로 보여주기 위해 filterIndexedforEach를 사용해 직접 Column을 나누신 것 같은데요,
만약 실제 서비스에서 데이터가 100개, 1000개처럼 크게 늘어난다면 어떻게 될지도 한 번 고민해보면 좋겠습니다!

Column 기반으로 직접 나누는 방식은 모든 아이템을 한 번에 그리기 때문에 데이터가 많아질수록 성능 이슈가 생길 수 있습니다.

반면 Compose에서 제공하는 LazyVerticalGrid는 화면에 보이는 아이템만 렌더링하는 구조라 대량 데이터에서도 메모리와 성능 면에서 좀 더 좋습니다!

두 방식의 장단점을 비교해보면서, 어떤 상황에서 어떤 구조를 선택하는 게 더 적절할지 한 번 정리해보시면 좋을 것 같습니다!

}
}
//계정 상세
else{
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재는 if-else로 화면 상태를 나누고, 각 분기 안에서 바로 UI를 그리고 있는 것 같습니다.
화면별 UI를 별도의 @composable 함수로 추출하고 분기 안에서는 함수를 호출만 하는 구조로 바꾸면 코드의 가독성과 재사용성이 더 좋아질 것 같습니다.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants