feat(home): 인기 크리에이터 섹션 아이템 팔로우 버튼 표시 조건 추가

- 크리에이터 != 나 인 경우에만 팔로우/팔로잉 버튼 표시
This commit is contained in:
2025-10-16 23:58:03 +09:00
parent cb67787925
commit 83fa3b870c
2 changed files with 21 additions and 15 deletions

View File

@@ -60,23 +60,28 @@ 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))
if (SharedPreferenceManager.userId != item.id) {
binding.tvFollow.visibility = View.VISIBLE
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 {
if (SharedPreferenceManager.token.isNotBlank()) {
item.follow = !item.follow
notifyItemChanged(index)
} else {
binding.tvFollow.text = "팔로우"
binding.tvFollow.setBackgroundResource(R.drawable.bg_round_corner_999_white)
binding.tvFollow.setTextColor("#263238".toColorInt())
}
onClickFollow(item.id, item.follow)
binding.tvFollow.setOnClickListener {
if (SharedPreferenceManager.token.isNotBlank()) {
item.follow = !item.follow
notifyItemChanged(index)
}
onClickFollow(item.id, item.follow)
}
} else {
binding.tvFollow.visibility = View.GONE
}
binding.root.setOnClickListener { onClickItem(item.id) }

View File

@@ -133,6 +133,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/bg_round_corner_4_263238_3bb9f1"
android:fontFamily="@font/pretendard_medium"
android:paddingHorizontal="7dp"
android:paddingVertical="4dp"
android:text="최신 콘텐츠"