fix: 메인 홈 - 인기 크리에이터
- 팔로우/팔로잉 배경색 변경
This commit is contained in:
@@ -5,11 +5,13 @@ import android.content.Context
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.graphics.toColorInt
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.bumptech.glide.Glide
|
||||
import com.bumptech.glide.load.resource.bitmap.CircleCrop
|
||||
import com.bumptech.glide.request.RequestOptions
|
||||
import kr.co.vividnext.sodalive.R
|
||||
import kr.co.vividnext.sodalive.common.SharedPreferenceManager
|
||||
import kr.co.vividnext.sodalive.databinding.ItemHomeCreatorBinding
|
||||
import kr.co.vividnext.sodalive.explorer.GetExplorerSectionCreatorResponse
|
||||
|
||||
@@ -60,13 +62,20 @@ class CreatorRankingAdapter(
|
||||
|
||||
if (item.follow) {
|
||||
binding.tvFollow.text = "팔로잉"
|
||||
binding.tvFollow.setBackgroundResource(R.drawable.bg_round_corner_999_455a64)
|
||||
binding.tvFollow.setTextColor(context.getColor(R.color.white))
|
||||
|
||||
} else {
|
||||
binding.tvFollow.text = "팔로우"
|
||||
binding.tvFollow.setBackgroundResource(R.drawable.bg_round_corner_999_white)
|
||||
binding.tvFollow.setTextColor("#263238".toColorInt())
|
||||
}
|
||||
|
||||
binding.tvFollow.setOnClickListener {
|
||||
item.follow = !item.follow
|
||||
notifyItemChanged(index)
|
||||
if (SharedPreferenceManager.token.isNotBlank()) {
|
||||
item.follow = !item.follow
|
||||
notifyItemChanged(index)
|
||||
}
|
||||
onClickFollow(item.id, item.follow)
|
||||
}
|
||||
|
||||
|
||||
@@ -407,7 +407,14 @@ class LiveFragment : BaseFragment<FragmentLiveBinding>(FragmentLiveBinding::infl
|
||||
recyclerView.adapter = adapter
|
||||
|
||||
viewModel.latestFinishedLiveListLiveData.observe(viewLifecycleOwner) {
|
||||
adapter.addItems(it)
|
||||
if (it.isNotEmpty()) {
|
||||
adapter.addItems(it)
|
||||
binding.llLatestFinishedLiveChannel.visibility = View.VISIBLE
|
||||
binding.rvLatestFinishedLiveChannel.visibility = View.VISIBLE
|
||||
} else {
|
||||
binding.llLatestFinishedLiveChannel.visibility = View.GONE
|
||||
binding.rvLatestFinishedLiveChannel.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user