cloudroam
2 天以前 88cf855268a05a68bb4570c6d45841bbe23fe5ec
app/src/main/java/com/example/firstapp/activity/ReminderSettingsActivity.kt
@@ -33,14 +33,15 @@
    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
        }
        // 全选提醒方式按钮逻辑
@@ -74,16 +75,16 @@
    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
        }
    }
@@ -94,8 +95,8 @@
                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" }
@@ -117,8 +118,8 @@
        binding.checkBoxExpress.setOnCheckedChangeListener { _, _ -> }
        binding.checkBoxFinance.setOnCheckedChangeListener { _, _ -> }
        binding.checkBoxIncome.setOnCheckedChangeListener { _, _ -> }
        binding.checkBoxFlight.setOnCheckedChangeListener { _, _ -> }
        binding.checkBoxTrain.setOnCheckedChangeListener { _, _ -> }
//        binding.checkBoxFlight.setOnCheckedChangeListener { _, _ -> }
//        binding.checkBoxTrain.setOnCheckedChangeListener { _, _ -> }
    }
    private fun saveSettings() {
@@ -130,8 +131,8 @@
            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()) {