| | |
| | | private fun setupCheckBoxes() { |
| | | // 全选分类按钮逻辑 |
| | | binding.tvSelectAll.setOnClickListener { |
| | | val shouldCheck = !(binding.checkBoxExpress.isChecked && binding.checkBoxFinance.isChecked && |
| | | binding.checkBoxIncome.isChecked && binding.checkBoxFlight.isChecked && binding.checkBoxTrain.isChecked) |
| | | |
| | | val shouldCheck = !(binding.checkBoxExpress.isChecked && binding.checkBoxFinance.isChecked && binding.checkBoxIncome.isChecked ) |
| | | // binding.checkBoxFlight.isChecked && binding.checkBoxTrain.isChecked) |
| | | |
| | | |
| | | binding.checkBoxExpress.isChecked = shouldCheck |
| | | binding.checkBoxFinance.isChecked = shouldCheck |
| | | binding.checkBoxIncome.isChecked = shouldCheck |
| | | binding.checkBoxFlight.isChecked = shouldCheck |
| | | binding.checkBoxTrain.isChecked = shouldCheck |
| | | // binding.checkBoxFlight.isChecked = shouldCheck |
| | | // binding.checkBoxTrain.isChecked = shouldCheck |
| | | } |
| | | |
| | | // 全选提醒方式按钮逻辑 |
| | |
| | | private fun disableVipCategories() { |
| | | binding.apply { |
| | | checkBoxIncome.isEnabled = false |
| | | checkBoxFlight.isEnabled = false |
| | | checkBoxTrain.isEnabled = false |
| | | // checkBoxFlight.isEnabled = false |
| | | // checkBoxTrain.isEnabled = false |
| | | } |
| | | } |
| | | |
| | | private fun enableAllCategories() { |
| | | binding.apply { |
| | | checkBoxIncome.isEnabled = true |
| | | checkBoxFlight.isEnabled = true |
| | | checkBoxTrain.isEnabled = true |
| | | // checkBoxFlight.isEnabled = true |
| | | // checkBoxTrain.isEnabled = true |
| | | } |
| | | } |
| | | |
| | |
| | | checkBoxExpress.isChecked = reminders.any { it.categoryName == "快递" } |
| | | checkBoxFinance.isChecked = reminders.any { it.categoryName == "还款" } |
| | | checkBoxIncome.isChecked = reminders.any { it.categoryName == "收入" } |
| | | checkBoxFlight.isChecked = reminders.any { it.categoryName == "航班" } |
| | | checkBoxTrain.isChecked = reminders.any { it.categoryName == "火车票" } |
| | | // checkBoxFlight.isChecked = reminders.any { it.categoryName == "航班" } |
| | | // checkBoxTrain.isChecked = reminders.any { it.categoryName == "火车票" } |
| | | |
| | | // 检查是否有通知方法设置 |
| | | checkBoxPhone.isChecked = reminders.any { it.notificationMethod == "PHONE" } |
| | |
| | | binding.checkBoxExpress.setOnCheckedChangeListener { _, _ -> } |
| | | binding.checkBoxFinance.setOnCheckedChangeListener { _, _ -> } |
| | | binding.checkBoxIncome.setOnCheckedChangeListener { _, _ -> } |
| | | binding.checkBoxFlight.setOnCheckedChangeListener { _, _ -> } |
| | | binding.checkBoxTrain.setOnCheckedChangeListener { _, _ -> } |
| | | // binding.checkBoxFlight.setOnCheckedChangeListener { _, _ -> } |
| | | // binding.checkBoxTrain.setOnCheckedChangeListener { _, _ -> } |
| | | } |
| | | |
| | | private fun saveSettings() { |
| | |
| | | if (checkBoxExpress.isChecked) selectedCategories.add(CategoryConfig(1, "快递", 1, true)) |
| | | if (checkBoxFinance.isChecked) selectedCategories.add(CategoryConfig(2, "还款", 2, true)) |
| | | if (checkBoxIncome.isChecked) selectedCategories.add(CategoryConfig(3, "收入", 3, true)) |
| | | if (checkBoxFlight.isChecked) selectedCategories.add(CategoryConfig(4, "航班", 4, true)) |
| | | if (checkBoxTrain.isChecked) selectedCategories.add(CategoryConfig(5, "火车票", 5, true)) |
| | | // if (checkBoxFlight.isChecked) selectedCategories.add(CategoryConfig(4, "航班", 4, true)) |
| | | // if (checkBoxTrain.isChecked) selectedCategories.add(CategoryConfig(5, "火车票", 5, true)) |
| | | } |
| | | |
| | | if (selectedCategories.isEmpty()) { |