Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

상점 세부 페이지 기능 업데이트 #256

Merged
merged 66 commits into from
May 9, 2024

Conversation

skdud0629
Copy link
Member

@skdud0629 skdud0629 commented May 8, 2024

개요

상점 세부 페이지 이벤트/공지 페이지 추가
메뉴 카테고리 별로 나누기

상세 작업 내용

메뉴 페이지

  • 기존에 메뉴 리스트만 받아오는 방식에 카테고리를 추가적으로 받아오는 방식으로 변경
  • 리사이클러뷰 어댑터에서 아이템 타입을 카테고리와 메뉴 두 가지로 구분하여 Hearder에 카테고리를 넣는 방식으로 구현

이벤트/공지 페이지

  • 이벤트 api 호출하여 해당 상점의 이벤트를 받아옴
  • 이벤트 아이템 클릭 시 전체 내용을 볼 수 있도록 접고 피는 기능 구현

@skdud0629 skdud0629 requested a review from a team as a code owner May 8, 2024 02:35
@KimNahun
Copy link

KimNahun commented May 8, 2024

엇..왜 제 상점이 ㅋㅋㅋ

Capture 3

기타정보는 왜 표시가 안될까용..?

skdud0629 added 2 commits May 8, 2024 12:35
…igin/fix/store-detail

# Conflicts:
#	koin/src/main/java/in/koreatech/koin/ui/store/fragment/StoreDetailEventFragment.kt
@skdud0629
Copy link
Member Author

엇..왜 제 상점이 ㅋㅋㅋ

Capture 3 기타정보는 왜 표시가 안될까용..?

헉..코드 잘못날려서 다시 수정했습니다..!

Copy link
Collaborator

@Jokwanhee Jokwanhee left a comment

Choose a reason for hiding this comment

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

고생했습니다~ 👻

import `in`.koreatech.koin.util.ext.observeLiveData

class StoreDetailEventFragment : Fragment() {
private var _binding: FragmentStoreDetailEventBinding? = null
Copy link
Collaborator

Choose a reason for hiding this comment

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

Fragment Destroy 될 때, binding 할당 객체 해제해주어야 할 것 같아요~

Copy link
Member Author

Choose a reason for hiding this comment

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

수정하겠습니당

import `in`.koreatech.koin.util.ext.observeLiveData

class StoreDetailMenuFragment : Fragment() {
private var _binding: FragmentStoreDetailMenuBinding? = null
Copy link
Collaborator

Choose a reason for hiding this comment

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

위와 동일해요!

Comment on lines 110 to 125
if(binding.storeDetailMainMenuTextView.text == category.name){
binding.storeDetailMainMenuButton.setCardBackgroundColor(ContextCompat.getColor(requireContext(), R.color.colorPrimary))
binding.storeDetailMainMenuTextView.setTextColor(Color.WHITE)
}
else if(binding.storeDetailSetMenuTextView.text == category.name){
binding.storeDetailSetMenuButton.setCardBackgroundColor(ContextCompat.getColor(requireContext(), R.color.colorPrimary))
binding.storeDetailSetMenuTextView.setTextColor(Color.WHITE)
}
else if (binding.storeDetailSideMenuTextView.text == category.name){
binding.storeDetailSideMenuButton.setCardBackgroundColor(ContextCompat.getColor(requireContext(), R.color.colorPrimary))
binding.storeDetailSideMenuTextView.setTextColor(Color.WHITE)
}
else{
binding.storeDetailRecommendMenuButton.setCardBackgroundColor(ContextCompat.getColor(requireContext(), R.color.colorPrimary))
binding.storeDetailRecommendMenuTextView.setTextColor(Color.WHITE)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

when 절로 바꿔보는게 어떨까요??

<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
Copy link
Collaborator

Choose a reason for hiding this comment

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

빼도 될듯합니다~

@skdud0629 skdud0629 closed this May 8, 2024
@skdud0629 skdud0629 deleted the origin/fix/store-detail branch May 8, 2024 05:31
@skdud0629 skdud0629 restored the origin/fix/store-detail branch May 8, 2024 05:36
@skdud0629 skdud0629 reopened this May 8, 2024
skdud0629 added 6 commits May 8, 2024 15:46
# Conflicts:
#	data/src/main/java/in/koreatech/koin/data/api/StoreApi.kt
#	data/src/main/java/in/koreatech/koin/data/mapper/StoreMapper.kt
#	data/src/main/java/in/koreatech/koin/data/repository/StoreRepositoryImpl.kt
#	data/src/main/java/in/koreatech/koin/data/source/remote/StoreRemoteDataSource.kt
#	koin/build.gradle
…-detail

# Conflicts:
#	koin/src/main/java/in/koreatech/koin/ui/store/fragment/StoreDetailEventFragment.kt
storeDetailIsCardTextview.isVisible = false
}

setEtcInfo(storeDetailIsCardTextview, it.isCardOk)
Copy link
Contributor

Choose a reason for hiding this comment

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

setEtcInfo(storeDetailIsCardTextview, it.isCardOk)가 두 번 쓰이고 있는데 수정이 필요할 거 같습니당
그리고 isAvailable을 매개변수로 넘기는 것 보다 isAvailable의 조건이 참일때만 setEtcInfo 함수를 호출하도록 하는 게 구조적으로 더 좋을거 같다는 의견입니당

storeDetailEvent.visibility = View.VISIBLE
storeDetailEventExpand.visibility = View.GONE
}
storeDetailEventTitleTextview.text = shopEvent.title
Copy link
Contributor

Choose a reason for hiding this comment

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

함수로 구조화하는 게 유지보수에 더 용이할 거 같습니다..!

viewModel.storeMenu.value?.let {
category.menus?.forEachIndexed { menuIndex, shopMenus ->
if (shopMenus.isSingle && shopMenus.singlePrice != null) {
shopMenus.singlePrice
Copy link
Contributor

Choose a reason for hiding this comment

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

요건 잘못 쓰인걸까요?

) : BaseViewModel() {
val store: LiveData<StoreWithMenu> get() = _store
private val _store = MutableLiveData<StoreWithMenu>()
val categories: LiveData<StoreMenu> get() = _categories
private var _categories = MutableLiveData<StoreMenu>()
Copy link
Contributor

Choose a reason for hiding this comment

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

var는 잘못쓰인건가요??

Copy link
Contributor

@nodobi nodobi left a comment

Choose a reason for hiding this comment

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

고생하셨습니다! 👍

Copy link
Collaborator

@Jokwanhee Jokwanhee left a comment

Choose a reason for hiding this comment

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

👻

@Jokwanhee Jokwanhee merged commit 396e021 into develop May 9, 2024
@skdud0629 skdud0629 self-assigned this May 12, 2024
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.

6 participants