Skip to content

Feat/week2#16

Open
jeongwy04 wants to merge 2 commits into
ApptiveDev:정우영from
jeongwy04:feat/week2
Open

Feat/week2#16
jeongwy04 wants to merge 2 commits into
ApptiveDev:정우영from
jeongwy04:feat/week2

Conversation

@jeongwy04
Copy link
Copy Markdown

week2 SNS feed 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.

과제 수고 많았수다
나중에 스터디에서 봐요이~

)

@Composable
fun FeedUI(){
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.

현재 FeedUI 함수 하나가 조금 길어서,
아래와 같이 쪼개어 컴포저블 함수로 구성하고 feedUI에서 호출하는 방식으로 개선하면 전체 구조를 한눈에 파악하기 쉬워지고, 재사용성이 좋아질 것 같습니다!
(아래 예시는 참고용으로 보시고, 현재 코드 구조에 맞게 적절히 분리해보면 좋을 것 같습니다!)

  • StoryItem(...): 개별 스토리 동그라미
  • CategorySelector(...): Recent, Following, Trendy 버튼 바
  • PostCard(...): 개별 게시물 카드

.padding(innerPadding),
.offset(x=4.dp,y=(-2).dp)
.size(16.dp)
.background(Color(0xFFFF5722), CircleShape),
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.

(이런 작은 과제에서는 상관없지만!)
Color(0xFFFF5722) 같은 포인트 컬러가 코드 곳곳에 색상코드로 적혀있는데, 이렇게 색상 코드 값을 직접 여러 곳에 작성하면, 매번 색상코드를 작성하기 번거롭기도 하고 나중에 컬러를 변경해야 할 때 모든 코드를 찾아 수정해야 할 수 있습니다!

ui.theme/Color.kt에 공통 색상으로 PointOrange와 같은 이름으로 정의해두고, 필요한 곳에서 해당 값을 가져와 사용하면 색상 관리가 쉬워질 것 같습니다!

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