룰렛 설정 개수에 따라 룰렛 프리셋 버튼 활성화/비활성화
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]
|
||||
|
Reference in New Issue
Block a user