From a396171472b0cd59455dcd13134ba2250b7c165c Mon Sep 17 00:00:00 2001 From: jacquarg Date: Mon, 15 Nov 2021 16:12:41 +0100 Subject: Fix call all whitelisted tracker on enter apptrackers screen --- .../features/trackers/apptrackers/AppTrackersFragment.kt | 4 ++-- .../features/trackers/apptrackers/ToggleTrackersAdapter.kt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app/src/main/java/foundation/e/privacycentralapp') diff --git a/app/src/main/java/foundation/e/privacycentralapp/features/trackers/apptrackers/AppTrackersFragment.kt b/app/src/main/java/foundation/e/privacycentralapp/features/trackers/apptrackers/AppTrackersFragment.kt index 2fab8cf..4ccdc59 100644 --- a/app/src/main/java/foundation/e/privacycentralapp/features/trackers/apptrackers/AppTrackersFragment.kt +++ b/app/src/main/java/foundation/e/privacycentralapp/features/trackers/apptrackers/AppTrackersFragment.kt @@ -93,8 +93,8 @@ class AppTrackersFragment : binding = ApptrackersFragmentBinding.bind(view) // TODO: crash sqlite ? - // binding.blockAllToggle.setOnCheckedChangeListener { _, isChecked -> - // viewModel.submitAction(Action.BlockAllToggleAction(isChecked)) + // binding.blockAllToggle.setOnClickListener { + // viewModel.submitAction(Action.BlockAllToggleAction(binding.blockAllToggle.isChecked)) // } binding.trackers.apply { diff --git a/app/src/main/java/foundation/e/privacycentralapp/features/trackers/apptrackers/ToggleTrackersAdapter.kt b/app/src/main/java/foundation/e/privacycentralapp/features/trackers/apptrackers/ToggleTrackersAdapter.kt index b1b3ed6..95ea094 100644 --- a/app/src/main/java/foundation/e/privacycentralapp/features/trackers/apptrackers/ToggleTrackersAdapter.kt +++ b/app/src/main/java/foundation/e/privacycentralapp/features/trackers/apptrackers/ToggleTrackersAdapter.kt @@ -58,8 +58,8 @@ class ToggleTrackersAdapter( val view = LayoutInflater.from(parent.context) .inflate(itemsLayout, parent, false) val holder = ViewHolder(view) - holder.toggle.setOnCheckedChangeListener { _, isChecked -> - listener(dataSet[holder.adapterPosition].first, isChecked) + holder.toggle.setOnClickListener { + listener(dataSet[holder.adapterPosition].first, holder.toggle.isChecked) } return holder } -- cgit v1.2.1