Skip to content

feat: 2주차 미션_제로#17

Open
jeongkyueun wants to merge 6 commits intomainfrom
zero-m2
Open

feat: 2주차 미션_제로#17
jeongkyueun wants to merge 6 commits intomainfrom
zero-m2

Conversation

@jeongkyueun
Copy link
Copy Markdown
Collaborator

@jeongkyueun jeongkyueun commented Mar 31, 2026

📌 2주차 미션_제로

🔗 관련 이슈

Closes #13

✨ 변경 사항

  1. 기본 ui 구축
  • 홈 화면
  • 구매하기
  • 위시리스트
  • 장바구니 (장바구니의 Tab은 구현하지 않아도 괜찮습니다!)
  • 프로필

🔍 테스트

  • 테스트 완료
  • 에러 없음

📸 스크린샷 (선택)

구매하기 위시리스트 장바구니 프로필
image image image image image

🚨 추가 이슈

@jeongkyueun jeongkyueun self-assigned this Mar 31, 2026
@jeongkyueun jeongkyueun added the enhancement New feature or request label Apr 1, 2026
Copy link
Copy Markdown
Collaborator

@kimdoyeon1234 kimdoyeon1234 left a comment

Choose a reason for hiding this comment

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

과제하시느라 정말 수고하셨습니다! 전체적으로 깔끔하게 구현해주셔서 보기가 편했습니다 ! color랑 string도 잘 분리해주셔서 좋았어요! 지금도 제대로 동작하지만 수정하면 좋을 부분 살짝 남겼으니 확인해주세요!

Comment on lines +8 to +36
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:text="@string/purchase_all"
android:textColor="@android:color/black"
android:textSize="18sp"
android:textStyle="bold" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="20dp"
android:text="@string/purchase_tops_tshirts"
android:textColor="@android:color/darker_gray"
android:textSize="18sp" />

<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/purchase_shoes"
android:textColor="@android:color/darker_gray"
android:textSize="18sp" />
</LinearLayout>
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.

구매하기 화면 상단의 탭 메뉴를 TextView와 View를 조합해서 직접 만들어주셨네요! UI 구조를 잘 짜셔서 모양이 아주 예쁘게 잘 나왔어요!
다만, 나중에 탭을 클릭했을 때 검은색 밑줄이 이동하는 애니메이션을 넣거나 다른 화면으로 부드럽게 넘기려면 직접 코딩하기가 꽤 까다로울 수 있어요. 안드로이드에서 기본으로 제공하는 TabLayout 이라는 기능을 사용해 보시면, 이런 탭 UI를 훨씬 쉽고 유연하게 만드실 수 있을 거예요!

Comment on lines +24 to +56
private fun initBottomNavigation() {
// 앱 실행 시 첫 화면 설정 (HomeFragment)
if (supportFragmentManager.findFragmentById(R.id.main_frame) == null) {
replaceFragment(HomeFragment())
}

binding.bottomNav.setOnItemSelectedListener { item ->
when (item.itemId) {
R.id.nav_home -> {
replaceFragment(HomeFragment())
true
}
R.id.nav_purchase -> {
replaceFragment(PurchaseFragment())
true
}
R.id.nav_wishlist -> {
replaceFragment(WishlistFragment())
true
}
R.id.nav_cart -> {
replaceFragment(CartFragment())
true
}
R.id.nav_profile -> {
replaceFragment(ProfileFragment())
true
}
else -> false
}
}
}

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.

지금은 탭을 누를 때마다 replaceFragment(HomeFragment())처럼 매번 프래그먼트 객체를 새로 생성하고 있어서, 탭을 왔다 갔다 하면 스크롤이나 입력해 둔 데이터가 싹 초기화되는 현상이 발생합니다.

지금은 단순 ui구현이니 상관없지만 나중에 이 부분을 고치실 때, Jetpack Navigation Component를 도입하는 방식을 적용해 보시면 기존 데이터가 날아가지 않는 훨씬 부드러운 앱을 만드실 수 있을 거예요!

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 2주차 미션_제로

2 participants