Conversation
sua710
left a comment
There was a problem hiding this comment.
미션에서 요구하는 대로 잘 구현하신 것 같아요! 대단해요!!
| <?xml version="1.0" encoding="utf-8"?> | ||
| <selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| <item android:color="@android:color/holo_red_dark" android:state_selected="true" /> | ||
| <item android:color="@android:color/black" /> | ||
| </selector> No newline at end of file |
There was a problem hiding this comment.
tint로 하트 색 채운 것 좋은 방법 같습니다!
| <?xml version="1.0" encoding="utf-8"?> | ||
| <selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| <item android:color="@android:color/holo_red_dark" android:state_selected="true" /> | ||
| <item android:color="@android:color/black" /> |
| android:id="@+id/txtDesc" | ||
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:text="상품 설명" |
There was a problem hiding this comment.
android:text 항목들 strings에 옮기면 유지보수에 좋을 거 같아요 ! 과제 수행하시느라 수고 많으셨습니다~!!
kimdoyeon1234
left a comment
There was a problem hiding this comment.
이번 주차 과제 수행하시느라 정말 고생 많으셨습니다!
Navigation Component와 DataStore를 활용해 데이터의 영속성과 화면 흐름을 현대적인 방식으로 구현하신 점이 매우 인상적입니다!
다만, include 레이아웃 구조의 단순화나 WindowInsets를 통한 시스템 바 대응, 그리고 Flow 수집 시 리소스 최적화(repeatOnLifecycle) 등을 조금 더 보완하신다면 더욱 견고하고 완성도 높은 앱이 될 것 같습니다
짧은 시간 안에 많은 기능을 안정적으로 녹여내시느라 수고 많으셨습니다!
| private fun loadProducts() { | ||
| viewLifecycleOwner.lifecycleScope.launch { | ||
| val allProducts = ProductRepository.getProductsOnce(requireContext()) | ||
|
|
||
| (binding.recyclerGrid.adapter as ProductAdapter).submitList(allProducts) | ||
| } | ||
| } | ||
|
|
There was a problem hiding this comment.
현재 getProductsOnce를 사용하여 데이터를 일회성으로 로드하고 있습니다. ProductRepository에 구현된 getProductsFlow()를 사용하고, collect를 통해 데이터를 관찰하도록 수정하면, 위시리스트 상태가 변경될 때마다 수동으로 리스트를 다시 불러올 필요 없이 화면이 실시간으로 업데이트되어 사용자 경험이 훨씬 좋아질 것 같아요!
| btnWish.setImageResource( | ||
| if (item.isWished) R.drawable.ic_wish_heart else R.drawable.ic_wish_heart | ||
| ) |
There was a problem hiding this comment.
btnWish 이미지 설정 로직에서 if (item.isWished) 조건문 결과가 모두 동일한 리소스로 설정되어 있습니다. 찜 상태에 따라 빈 하트와 채워진 하트가 구분되도록 리소스를 수정해야 의도한 대로 작동할 것 같습니다!
| <include | ||
| android:id="@+id/bottomBarInclude" | ||
| layout="@layout/bottom_navigation_view" | ||
| android:layout_width="match_parent" | ||
| android:layout_height="wrap_content" | ||
| android:background="@android:color/white" | ||
| app:itemIconTint="@android:color/black" | ||
| app:itemTextColor="@android:color/black" | ||
| app:labelVisibilityMode="labeled" | ||
| app:layout_constraintBottom_toBottomOf="parent" | ||
| app:layout_constraintEnd_toEndOf="parent" | ||
| app:layout_constraintStart_toStartOf="parent" | ||
| app:menu="@menu/bottom_nav_menu" /> | ||
| app:layout_constraintEnd_toEndOf="parent" /> | ||
|
|
There was a problem hiding this comment.
현재 하단 바를 include로 분리하셨는데, 사실 BottomNavigationView는 MainActivity 외에 재사용되는 경우가 드물어 실전에서는 MainActivity.xml에 직접 선언하는 경우가 더 많습니다. 지금 구조는 파일을 두 번 확인해야 하는 번거로움이 있고, ConstraintLayout 환경에서 불필요한 속성->alignParentBottom까지 섞여 있어 구조가 다소 복잡해 보입니다. 코드 응집도를 높이기 위해 include를 제거하고 메인 레이아웃에 통합하는 방향으로 리팩토링해보는 건 어떨까요!
|
|
||
| override fun onCreate(savedInstanceState: Bundle?) { | ||
| super.onCreate(savedInstanceState) | ||
| enableEdgeToEdge() | ||
|
|
There was a problem hiding this comment.
상단에 enableEdgeToEdge()를 선언하셨는데, 이는 전체 화면을 시스템 바 영역까지 확장하겠다는 의미입니다. 하지만 바로 아래에서 다시 수동으로 패딩을 계산하고 있어 로직이 중복되거나 의도치 않은 여백이 생길 수 있습니다. 하나로 통일하는 것이 구조적으로 깔끔합니다
📌 PR 제목
🔗 관련 이슈
Closes #33
✨ 변경 사항
🔍 테스트
📸 스크린샷 (선택)
🚨 추가 이슈