Open
Conversation
Collaborator
kimdoyeon1234
left a comment
There was a problem hiding this comment.
과제하시느라 정말 수고하셨습니다! 전체적으로 깔끔하게 구현해주셔서 보기가 편했습니다 ! 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> |
Collaborator
There was a problem hiding this comment.
구매하기 화면 상단의 탭 메뉴를 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 | ||
| } | ||
| } | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
지금은 탭을 누를 때마다 replaceFragment(HomeFragment())처럼 매번 프래그먼트 객체를 새로 생성하고 있어서, 탭을 왔다 갔다 하면 스크롤이나 입력해 둔 데이터가 싹 초기화되는 현상이 발생합니다.
지금은 단순 ui구현이니 상관없지만 나중에 이 부분을 고치실 때, Jetpack Navigation Component를 도입하는 방식을 적용해 보시면 기존 데이터가 날아가지 않는 훨씬 부드러운 앱을 만드실 수 있을 거예요!
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.
📌 2주차 미션_제로
🔗 관련 이슈
Closes #13
✨ 변경 사항
🔍 테스트
📸 스크린샷 (선택)
🚨 추가 이슈