feat/week2#15
Open
ymina25 wants to merge 1 commit intoApptiveDev:인민에이from
Open
Conversation
yeochaeeon
reviewed
May 1, 2026
Collaborator
yeochaeeon
left a comment
There was a problem hiding this comment.
과제한다고 수고하셨어요~
오늘 스터디 때 뵐게요!!
| .fillMaxWidth() | ||
| .padding(vertical = 12.dp, horizontal = 8.dp) | ||
| ) { | ||
| stories.forEach { story -> |
Collaborator
There was a problem hiding this comment.
현재 StoriesBar에서 Row 내부에 forEach를 사용하셨는데, 스토리가 20~30개로 늘어나면 화면 밖의 아이템까지 한꺼번에 그려 성능이 저하될 수 있습니다.
LazyRow를 사용하면 화면에 보이는 부분만 그리기 때문에 훨씬 효율적입니다! LazyRow에 대해 한 번 알아보면 좋을 것 같습니다!
| ) | ||
|
|
||
| @Composable | ||
| fun SnsFeedScreen() { |
Collaborator
There was a problem hiding this comment.
현재 SnsFeedScreen 함수 안에 하나의 피드를 그리는 UI가 직접 포함되어 있습니다.
만약 피드가 10개 이상으로 늘어난다면, 동일한 UI를 반복해서 구성해야 하기 때문에 코드가 길어지고 관리가 어려워질 수 있습니다.
피드 하나를 그리는 부분을 별도의 @composable 함수(예: PostCard)로 분리하고,
그 안에서도 헤더, 이미지, 액션 버튼 등 화면 구성 요소를 작은 단위의 컴포저블로 나누어 구성하고 상위의 SnsFeedScreen에서는 해당 컴포저블 함수들을 호출하는 구조로 사용하면
코드의 가독성과 재사용성이 훨씬 좋아질 것 같습니다.
이런 구조로 변경했을 때 어떤 점이 더 좋아지는지도 함께 고민해보면 좋겠습니다
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
week2 과제 - SNS feed