fix(home): 모두 팔로우 완료 상태를 반영한다
This commit is contained in:
@@ -3,6 +3,7 @@ package kr.co.vividnext.sodalive.v2.main.home.ui
|
||||
import android.view.View
|
||||
import android.widget.ImageView
|
||||
import android.widget.TextView
|
||||
import androidx.core.content.ContextCompat
|
||||
import kr.co.vividnext.sodalive.R
|
||||
|
||||
object HomeFollowAllButtonBinder {
|
||||
@@ -14,6 +15,13 @@ object HomeFollowAllButtonBinder {
|
||||
) {
|
||||
val icon = view.findViewById<ImageView>(R.id.iv_home_follow_all_icon)
|
||||
val text = view.findViewById<TextView>(R.id.tv_home_follow_all)
|
||||
view.setBackgroundResource(
|
||||
if (isFollowCompleted) {
|
||||
R.drawable.bg_round_corner_999_white
|
||||
} else {
|
||||
R.drawable.bg_home_follow_all_button
|
||||
}
|
||||
)
|
||||
icon.setImageResource(if (isFollowCompleted) R.drawable.ic_new_following else R.drawable.ic_new_follow)
|
||||
text.setText(
|
||||
if (isFollowCompleted) {
|
||||
@@ -22,9 +30,15 @@ object HomeFollowAllButtonBinder {
|
||||
R.string.home_recommendation_follow_all
|
||||
}
|
||||
)
|
||||
view.isEnabled = !isFollowCompleted
|
||||
text.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
view.context,
|
||||
if (isFollowCompleted) R.color.black else R.color.white
|
||||
)
|
||||
)
|
||||
view.isEnabled = true
|
||||
view.setOnClickListener {
|
||||
if (creatorIds.isNotEmpty()) onClick(creatorIds)
|
||||
if (!isFollowCompleted && creatorIds.isNotEmpty()) onClick(creatorIds)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginHorizontal="@dimen/spacing_20"
|
||||
android:layout_marginTop="@dimen/spacing_16"
|
||||
android:background="@drawable/bg_round_corner_999_white"
|
||||
android:background="@drawable/bg_home_follow_all_button"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
@@ -26,6 +26,6 @@
|
||||
android:layout_marginStart="@dimen/spacing_6"
|
||||
android:includeFontPadding="false"
|
||||
android:text="@string/home_recommendation_follow_all"
|
||||
android:textColor="@color/black"
|
||||
android:textColor="@color/white"
|
||||
tools:text="모두 팔로우 하기" />
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user