Skip to content

feat : 2주차 미션 _우가#12

Open
sua710 wants to merge 1 commit intomainfrom
wooga-m2
Open

feat : 2주차 미션 _우가#12
sua710 wants to merge 1 commit intomainfrom
wooga-m2

Conversation

@sua710
Copy link
Copy Markdown
Collaborator

@sua710 sua710 commented Mar 30, 2026

📌 PR 제목

[feat] nike 앱 기본 화면 구현

🔗 관련 이슈

Closes #이슈번호

✨ 변경 사항

  • 메인 Activity에 BottomNavigationView를 추가하여 하단 탭 내비게이션 구현하기
  • 각 탭에 해당하는 Fragment를 BottomNavigationView와 연결하기
  • '장바구니' 화면의 '주문하기' 버튼을 클릭하면, '구매하기' 탭으로 전환되도록 구현하기

🔍 테스트

  • 테스트 완료
  • 에러 없음

📸 스크린샷 (선택)

홈 화면 구매하기
Screenshot_20260331_022552 Screenshot_20260331_022624
위시리스트 장바구니
Screenshot_20260331_022707 Screenshot_20260331_022728
프로필
Screenshot_20260331_022740

🚨 추가 이슈

@sua710 sua710 changed the title FEAT : 2주차 미션 - 기본 화면 구 FEAT : 2주차 미션 - 기본 화면 구현 Mar 30, 2026
@sua710 sua710 changed the title FEAT : 2주차 미션 - 기본 화면 구현 FEAT : 2주차 미션 _우가 Mar 31, 2026
@kimdoyeon1234 kimdoyeon1234 changed the title FEAT : 2주차 미션 _우가 feat : 2주차 미션 _우가 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.

화면들을 XML과 ViewBinding으로 아주 깔끔하게 잘 구현해 주셨네요! 특히 하단바 메뉴bottom_nav_menu.xml 에 들어갈 아이콘들과 구조를 직관적으로 잘 짜주신 것 같아요. 전체적인 틀 잡고 기능 구현하시느라 정말 수고 많으셨습니다!

코드를 꼼꼼히 보면서 당장 간단하게 수정해 적용해 보면 좋을 것들을 몇 가지 정리해 봤어요. 편하게 확인해 보시고 반영해 주시면 감사하겠습니다!

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.

2주차 res와 2주차_res(1)/2주차 res파일은 필요가 없을거 같으니 삭제해주셔도 됩니다!

requireActivity().findViewById<com.google.android.material.bottomnavigation.BottomNavigationView>(
com.example.nike.R.id.bottomNavigation
).selectedItemId = com.example.nike.R.id.menu_shop
}
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.

현재 requireActivity().findViewById(...)를 사용해 부모 액티비티의 뷰를 프래그먼트가 직접 찾아 조작하고 있는데, 이렇게 하면 액티비티와 프래그먼트 간의 결합도가 너무 높아져서 나중에 UI 구조가 바뀐다면 에러가 나기 쉽습니다..

MainActivity 쪽에 탭을 이동시키는 함수를 만들고, 프래그먼트에서는
(activity as MainActivity)? .navigateToTab(...) 처럼 함수 호출을 하는 방식으로 하는것도 좋을거 같습니다

Comment on lines +32 to +34
android:text="장바구니가 비어 있습니다.\n제품을 추가하면 여기에 표시됩니다."
android:textSize="16sp"
android:textColor="#333333"
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.

1주차에 말씀드렸던 텍스트와 컬러가 하드코딩 되어있습니다! 1주차 코멘트를 달기 전에 2주차가 올라온거라 그런것 같지만 혹시 몰라서 한번더 언급만 하겠습니다!

Comment on lines +25 to +36
// 하단 네비게이션 클릭 이벤트
binding.bottomNavigation.setOnItemSelectedListener { item ->
when (item.itemId) {
R.id.menu_home -> replaceFragment(HomeFragment())
R.id.menu_shop -> replaceFragment(ShopFragment())
R.id.menu_wishlist -> replaceFragment(WishListFragment())
R.id.menu_cart -> replaceFragment(CartFragment())
R.id.menu_profile -> replaceFragment(ProfileFragment())
}
true
}
}
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.

지금 탭을 누를 때마다 화면 객체를 매번 새로 생성하고 있어서 스크롤이 초기화되는 아쉬운 점이 있습니다! 나중에 Jetpack Navigation Component 를 도입해서 바텀 네비게이션과 연결해 보시면, 코드를 일일이 짜지 않아도 스크롤 유지랑 화면 전환이 알아서 척척 돼서 훨씬 구조가 깔끔해질 거예요!

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