룰렛 설정 개수에 따라 룰렛 프리셋 버튼 활성화/비활성화
This commit is contained in:
@@ -236,9 +236,6 @@ class RouletteSettingsFragment : BaseFragment<FragmentRouletteSettingsBinding>(
|
||||
binding.ivSelectRoulette3.visibility = View.GONE
|
||||
|
||||
binding.llSelectRoulette1.setBackgroundResource(R.drawable.bg_round_corner_6_7_13181b)
|
||||
binding.llSelectRoulette2.setBackgroundResource(R.drawable.bg_round_corner_6_7_13181b)
|
||||
binding.llSelectRoulette3.setBackgroundResource(R.drawable.bg_round_corner_6_7_13181b)
|
||||
|
||||
binding.tvSelectRoulette1.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
@@ -246,19 +243,41 @@ class RouletteSettingsFragment : BaseFragment<FragmentRouletteSettingsBinding>(
|
||||
)
|
||||
)
|
||||
|
||||
binding.tvSelectRoulette2.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.color_3bb9f1
|
||||
if (viewModel.rouletteList.size > 0) {
|
||||
binding.llSelectRoulette2.setBackgroundResource(R.drawable.bg_round_corner_6_7_13181b)
|
||||
binding.tvSelectRoulette2.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.color_3bb9f1
|
||||
)
|
||||
)
|
||||
)
|
||||
} else {
|
||||
binding.llSelectRoulette2.setBackgroundResource(R.drawable.bg_round_corner_6_7_777777)
|
||||
binding.tvSelectRoulette2.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.color_555555
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
binding.tvSelectRoulette3.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.color_3bb9f1
|
||||
if (viewModel.rouletteList.size > 1) {
|
||||
binding.llSelectRoulette3.setBackgroundResource(R.drawable.bg_round_corner_6_7_13181b)
|
||||
binding.tvSelectRoulette3.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.color_3bb9f1
|
||||
)
|
||||
)
|
||||
)
|
||||
} else {
|
||||
binding.llSelectRoulette3.setBackgroundResource(R.drawable.bg_round_corner_6_7_777777)
|
||||
binding.tvSelectRoulette3.setTextColor(
|
||||
ContextCompat.getColor(
|
||||
requireContext(),
|
||||
R.color.color_555555
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun selectRouletteButton(
|
||||
|
@@ -53,7 +53,7 @@ class RouletteSettingsViewModel(private val repository: RouletteRepository) : Ba
|
||||
private var rouletteId = 0L
|
||||
private val options = mutableListOf<RouletteOption>()
|
||||
|
||||
private val rouletteList = mutableListOf<GetNewRouletteResponse>()
|
||||
val rouletteList = mutableListOf<GetNewRouletteResponse>()
|
||||
|
||||
fun plusWeight(optionIndex: Int) {
|
||||
val currentOption = options[optionIndex]
|
||||
|
8
app/src/main/res/drawable/bg_round_corner_6_7_777777.xml
Normal file
8
app/src/main/res/drawable/bg_round_corner_6_7_777777.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<solid android:color="@color/color_777777" />
|
||||
<corners android:radius="6.7dp" />
|
||||
<stroke
|
||||
android:width="1dp"
|
||||
android:color="@color/color_777777" />
|
||||
</shape>
|
@@ -60,7 +60,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="13.3dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_round_corner_6_7_13181b"
|
||||
android:background="@drawable/bg_round_corner_6_7_777777"
|
||||
android:gravity="center"
|
||||
android:paddingVertical="14.3dp">
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/gmarket_sans_bold"
|
||||
android:text="룰렛 2"
|
||||
android:textColor="@color/color_3bb9f1"
|
||||
android:textColor="@color/color_555555"
|
||||
android:textSize="14.7sp" />
|
||||
</LinearLayout>
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="13.3dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_round_corner_6_7_13181b"
|
||||
android:background="@drawable/bg_round_corner_6_7_777777"
|
||||
android:gravity="center"
|
||||
android:paddingVertical="14.3dp">
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/gmarket_sans_bold"
|
||||
android:text="룰렛 3"
|
||||
android:textColor="@color/color_3bb9f1"
|
||||
android:textColor="@color/color_555555"
|
||||
android:textSize="14.7sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
Reference in New Issue
Block a user