diff --git a/app/src/main/java/com/sopt/geonppang/data/model/response/ResponseDetailReview.kt b/app/src/main/java/com/sopt/geonppang/data/model/response/ResponseDetailReview.kt index 4ee7940a..8f4daa07 100644 --- a/app/src/main/java/com/sopt/geonppang/data/model/response/ResponseDetailReview.kt +++ b/app/src/main/java/com/sopt/geonppang/data/model/response/ResponseDetailReview.kt @@ -33,7 +33,7 @@ data class ResponseDetailReview( val recommendKeywordName: String ) - fun toRecommentKeyword() = recommendKeywordList.map { recommendKeyword -> + fun toRecommendKeyword() = recommendKeywordList.map { recommendKeyword -> DetailReview.RecommendKeyword( recommendKeywordId = recommendKeyword.recommendKeywordId, recommendKeywordName = recommendKeyword.recommendKeywordName @@ -53,7 +53,7 @@ data class ResponseDetailReview( memberNickname = review.memberNickname, reviewId = review.reviewId, reviewText = review.reviewText, - recommendKeywordList = review.toRecommentKeyword() + recommendKeywordList = review.toRecommendKeyword() ) } ) diff --git a/app/src/main/java/com/sopt/geonppang/presentation/common/BakeryAdapter.kt b/app/src/main/java/com/sopt/geonppang/presentation/common/BakeryAdapter.kt index c0708483..b5135db9 100644 --- a/app/src/main/java/com/sopt/geonppang/presentation/common/BakeryAdapter.kt +++ b/app/src/main/java/com/sopt/geonppang/presentation/common/BakeryAdapter.kt @@ -8,13 +8,14 @@ import com.google.android.material.chip.ChipGroup import com.sopt.geonppang.R import com.sopt.geonppang.databinding.ItemBakeryBinding import com.sopt.geonppang.domain.model.BakeryInformation +import com.sopt.geonppang.presentation.type.BreadFilterType import com.sopt.geonppang.util.ItemDiffCallback import com.sopt.geonppang.util.extension.loadingImage import com.sopt.geonppang.util.extension.setOnSingleClickListener class BakeryAdapter( private val moveToDetail: (Int) -> Unit, - private val initBreadTypeChips: (ChipGroup, Int) -> Unit, + private val initBreadTypeChips: (ChipGroup, List) -> Unit, ) : ListAdapter( ItemDiffCallback( onItemsTheSame = { old, new -> old.bakeryId == new.bakeryId }, @@ -28,8 +29,7 @@ class BakeryAdapter( fun onBind( bakery: BakeryInformation, moveToDetail: (Int) -> Unit, - initBreadTypeChips: (ChipGroup, Int) -> Unit, - position: Int + initBreadTypeChips: (ChipGroup, List) -> Unit ) { binding.bakery = bakery binding.executePendingBindings() @@ -37,7 +37,7 @@ class BakeryAdapter( // TODO: dana 다른 방식이 있는지 고민, 매 바인딩마다 removeAllViews 해야하는가 ? with(binding.cgBakeryBreadTypes) { this.removeAllViews() - initBreadTypeChips(this, position) + initBreadTypeChips(this, bakery.breadTypeList) } binding.root.setOnSingleClickListener { @@ -59,6 +59,6 @@ class BakeryAdapter( } override fun onBindViewHolder(holder: BakeryViewHolder, position: Int) { - holder.onBind(getItem(position), moveToDetail, initBreadTypeChips, position) + holder.onBind(getItem(position), moveToDetail, initBreadTypeChips) } } diff --git a/app/src/main/java/com/sopt/geonppang/presentation/detail/DetailBakeryInfoAdapter.kt b/app/src/main/java/com/sopt/geonppang/presentation/detail/DetailBakeryInfoAdapter.kt index 13dd2786..6385dea6 100644 --- a/app/src/main/java/com/sopt/geonppang/presentation/detail/DetailBakeryInfoAdapter.kt +++ b/app/src/main/java/com/sopt/geonppang/presentation/detail/DetailBakeryInfoAdapter.kt @@ -24,7 +24,10 @@ class DetailBakeryInfoAdapter( with(binding) { binding.bakeryInfo = bakeryInfo - initBreadTypeChips(binding.chipGroupItemDetailBakeryInfoBreadType) + with(binding.chipGroupItemDetailBakeryInfoBreadType) { + this.removeAllViews() + initBreadTypeChips(this) + } tvItemDetailBakeryInfoHomepage.setOnClickListener { AmplitudeUtils.trackEvent(CLICK_WEBSITE) diff --git a/app/src/main/java/com/sopt/geonppang/presentation/filterSetting/MainPurposeTypeFilterFragment.kt b/app/src/main/java/com/sopt/geonppang/presentation/filterSetting/MainPurposeTypeFilterFragment.kt index e4a09ac7..f34e666d 100644 --- a/app/src/main/java/com/sopt/geonppang/presentation/filterSetting/MainPurposeTypeFilterFragment.kt +++ b/app/src/main/java/com/sopt/geonppang/presentation/filterSetting/MainPurposeTypeFilterFragment.kt @@ -25,12 +25,9 @@ class MainPurposeTypeFilterFragment : } private fun addListeners() { - binding.layoutMainPurposeTypeFilterSkip.setOnClickListener { - moveToMain() - } - - binding.tvMainPurposeTypeFilterSkip.setOnSingleClickListener { + binding.layoutMainPurposeTypeFilterSkip.setOnSingleClickListener { AmplitudeUtils.trackEvent(CLICK_SKIP) + moveToMain() } } diff --git a/app/src/main/java/com/sopt/geonppang/presentation/myPage/MyBookMarksActivity.kt b/app/src/main/java/com/sopt/geonppang/presentation/myPage/MyBookMarksActivity.kt index fabc5d13..4e9d6346 100644 --- a/app/src/main/java/com/sopt/geonppang/presentation/myPage/MyBookMarksActivity.kt +++ b/app/src/main/java/com/sopt/geonppang/presentation/myPage/MyBookMarksActivity.kt @@ -13,6 +13,7 @@ import com.sopt.geonppang.presentation.common.BakeryAdapter import com.sopt.geonppang.presentation.detail.DetailActivity import com.sopt.geonppang.presentation.detail.DetailActivity.Companion.SOURCE import com.sopt.geonppang.presentation.detail.DetailActivity.Companion.VIEW_DETAIL_PAGE_AT +import com.sopt.geonppang.presentation.type.BreadFilterType import com.sopt.geonppang.util.AmplitudeUtils import com.sopt.geonppang.util.CustomItemDecoration import com.sopt.geonppang.util.UiState @@ -85,17 +86,16 @@ class MyBookMarksActivity : startActivity(intent) } - private fun initBreadTypeChips(chipGroup: ChipGroup, position: Int) { - if (myBookMarkBakeryList.isNotEmpty()) { - myBookMarkBakeryList.get(position).breadTypeList.let { breadTypeList -> - chipGroup.breadTypeListToChips( - breadTypeList = breadTypeList, - toChip = { - this.toBreadTypePointM2Chip(layoutInflater) - } - ) + private fun initBreadTypeChips( + chipGroup: ChipGroup, + breadTypeList: List + ) { + chipGroup.breadTypeListToChips( + breadTypeList = breadTypeList, + toChip = { + this.toBreadTypePointM2Chip(layoutInflater) } - } + ) } companion object { diff --git a/app/src/main/java/com/sopt/geonppang/presentation/search/SearchActivity.kt b/app/src/main/java/com/sopt/geonppang/presentation/search/SearchActivity.kt index 3d60bc58..c9e9ff77 100644 --- a/app/src/main/java/com/sopt/geonppang/presentation/search/SearchActivity.kt +++ b/app/src/main/java/com/sopt/geonppang/presentation/search/SearchActivity.kt @@ -11,11 +11,11 @@ import androidx.recyclerview.widget.ConcatAdapter import com.google.android.material.chip.ChipGroup import com.sopt.geonppang.R import com.sopt.geonppang.databinding.ActivitySearchBinding -import com.sopt.geonppang.domain.model.BakeryInformation import com.sopt.geonppang.presentation.common.BakeryAdapter import com.sopt.geonppang.presentation.detail.DetailActivity import com.sopt.geonppang.presentation.detail.DetailActivity.Companion.SOURCE import com.sopt.geonppang.presentation.detail.DetailActivity.Companion.VIEW_DETAIL_PAGE_AT +import com.sopt.geonppang.presentation.type.BreadFilterType import com.sopt.geonppang.util.AmplitudeUtils import com.sopt.geonppang.util.CustomItemDecoration import com.sopt.geonppang.util.UiState @@ -34,8 +34,6 @@ class SearchActivity : BindingActivity(R.layout.activity_ private lateinit var bakeryAdapter: BakeryAdapter private lateinit var searchCountAdapter: SearchCountAdapter - private var bakeryInformationList = listOf() - override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) binding.viewModel = viewModel @@ -86,8 +84,6 @@ class SearchActivity : BindingActivity(R.layout.activity_ completeFilteringInParticularView() viewModel.searchBakeryList() searchCountAdapter.setSearchData(it.data) - - bakeryInformationList = it.data.bakeryList bakeryAdapter.submitList(it.data.bakeryList) } @@ -129,17 +125,16 @@ class SearchActivity : BindingActivity(R.layout.activity_ return super.dispatchTouchEvent(ev) } - private fun initBreadTypeChips(chipGroup: ChipGroup, position: Int) { - if (bakeryInformationList.isNotEmpty()) { - bakeryInformationList.get(position).breadTypeList.let { breadTypeIdList -> - chipGroup.breadTypeListToChips( - breadTypeList = breadTypeIdList, - toChip = { - this.toBreadTypePointM2Chip(layoutInflater) - } - ) + private fun initBreadTypeChips( + chipGroup: ChipGroup, + breadTypeList: List + ) { + chipGroup.breadTypeListToChips( + breadTypeList = breadTypeList, + toChip = { + this.toBreadTypePointM2Chip(layoutInflater) } - } + ) } companion object { diff --git a/app/src/main/res/layout/fragment_main_purpose_type_filter.xml b/app/src/main/res/layout/fragment_main_purpose_type_filter.xml index f0986c1b..1e406125 100644 --- a/app/src/main/res/layout/fragment_main_purpose_type_filter.xml +++ b/app/src/main/res/layout/fragment_main_purpose_type_filter.xml @@ -123,6 +123,7 @@ android:textColor="@color/gray_500" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/iv_main_purpose_type_filter_skip" + app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintTop_toBottomOf="@id/tv_item_detail_bakery_info_bakery_name" /> - + app:layout_constraintTop_toBottomOf="@+id/tv_item_detail_bakery_info_time" /> - - - - - + + app:layout_constraintTop_toBottomOf="@id/iv_item_detail_bakery_info_call" />