-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #291 from Scents-Note/refactor/287-filter
3기 첫번째 배포(v1.5.5) - 필터 UI 수정, GA 수정(필터 전체 선택 항목), 루팅 체크 로직 추가
- Loading branch information
Showing
72 changed files
with
754 additions
and
201 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
app/src/main/java/com/scentsnote/android/data/remote/RemoteDataSourceImpl.kt
This file contains 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
This file contains 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
2 changes: 1 addition & 1 deletion
2
app/src/main/java/com/scentsnote/android/ui/detail/DetailImageAdapter.kt
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
49 changes: 49 additions & 0 deletions
49
app/src/main/java/com/scentsnote/android/ui/filter/brand/BrandTabRecyclerViewAdapter.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.scentsnote.android.ui.filter.brand | ||
|
||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.scentsnote.android.data.vo.response.BrandTab | ||
import com.scentsnote.android.databinding.RvItemFilterBrandTabBinding | ||
import com.scentsnote.android.utils.extension.setOnSafeClickListener | ||
import com.scentsnote.android.utils.extension.setSelectedTabTxt | ||
import com.scentsnote.android.viewmodel.filter.FilterBrandViewModel | ||
|
||
class BrandTabRecyclerViewAdapter(private val tabList: MutableList<BrandTab>, private val viewModel: FilterBrandViewModel) : RecyclerView.Adapter<BrandTabRecyclerViewAdapter.BrandTabRecyclerViewHolder>(){ | ||
|
||
interface OnItemClickListener{ | ||
fun onItemClick(position: Int) | ||
} | ||
|
||
var itemClickListener:OnItemClickListener?=null | ||
var currentAdapterPosition = 0 | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): BrandTabRecyclerViewHolder { | ||
val binding = | ||
RvItemFilterBrandTabBinding.inflate(LayoutInflater.from(parent.context), parent, false) | ||
return BrandTabRecyclerViewHolder(binding) | ||
} | ||
|
||
override fun getItemCount(): Int = tabList.size | ||
|
||
override fun onBindViewHolder(holder: BrandTabRecyclerViewHolder, position: Int) { | ||
holder.bind(tabList[position]) | ||
} | ||
|
||
inner class BrandTabRecyclerViewHolder(val binding: RvItemFilterBrandTabBinding) : RecyclerView.ViewHolder(binding.root) { | ||
fun bind(brandTab: BrandTab) { | ||
binding.item = brandTab | ||
binding.tabName.setSelectedTabTxt(brandTab.isSelected) | ||
brandTab.isSelected = false | ||
|
||
binding.root.setOnSafeClickListener { | ||
itemClickListener?.onItemClick(adapterPosition) | ||
brandTab.isSelected = true | ||
|
||
notifyItemChanged(adapterPosition) | ||
notifyItemChanged(currentAdapterPosition) | ||
currentAdapterPosition = adapterPosition | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.