diff --git a/app/src/main/java/org/openobservatory/ooniprobe/activity/runtests/RunTestsActivity.kt b/app/src/main/java/org/openobservatory/ooniprobe/activity/runtests/RunTestsActivity.kt index 3582a2248..38e1e88d1 100644 --- a/app/src/main/java/org/openobservatory/ooniprobe/activity/runtests/RunTestsActivity.kt +++ b/app/src/main/java/org/openobservatory/ooniprobe/activity/runtests/RunTestsActivity.kt @@ -146,8 +146,8 @@ class RunTestsActivity : AbstractActivity() { } else -> group.nettests.forEach { nettest -> when(nettest.selected) { - true -> preferenceManager.enableTest(nettest.name) - false -> preferenceManager.disableTest(nettest.name) + true -> preferenceManager.enableTest(nettest.name, group.preferencePrefix()) + false -> preferenceManager.disableTest(nettest.name, group.preferencePrefix()) } } } diff --git a/app/src/main/java/org/openobservatory/ooniprobe/adapters/DashboardAdapter.kt b/app/src/main/java/org/openobservatory/ooniprobe/adapters/DashboardAdapter.kt index c01ce9a16..24bdaa671 100644 --- a/app/src/main/java/org/openobservatory/ooniprobe/adapters/DashboardAdapter.kt +++ b/app/src/main/java/org/openobservatory/ooniprobe/adapters/DashboardAdapter.kt @@ -12,6 +12,7 @@ import org.openobservatory.ooniprobe.common.AbstractDescriptor import org.openobservatory.ooniprobe.common.PreferenceManager import org.openobservatory.ooniprobe.databinding.ItemSeperatorBinding import org.openobservatory.ooniprobe.databinding.ItemTestsuiteBinding +import org.openobservatory.ooniprobe.model.database.InstalledDescriptor class DashboardAdapter( private val items: List, @@ -58,7 +59,11 @@ class DashboardAdapter( cardHolder.binding.apply { title.setText(item.title) desc.setText(item.shortDescription) - icon.setImageResource(item.getDisplayIcon(holder.itemView.context)) + icon.setImageResource(item.getDisplayIcon(holder.itemView.context)).also { + if (item is InstalledDescriptor){ + icon.setColorFilter(item.color) + } + } } holder.itemView.tag = item if (!item.isEnabled(preferenceManager)) { diff --git a/app/src/main/java/org/openobservatory/ooniprobe/item/RunItem.kt b/app/src/main/java/org/openobservatory/ooniprobe/item/RunItem.kt index 67090104b..864644702 100644 --- a/app/src/main/java/org/openobservatory/ooniprobe/item/RunItem.kt +++ b/app/src/main/java/org/openobservatory/ooniprobe/item/RunItem.kt @@ -14,8 +14,10 @@ class RunItem( viewHolder?.itemView?.context?.let { context -> extra.getDescriptor(context).get().let { descriptor -> viewHolder.binding?.icon?.setImageResource(descriptor.getDisplayIcon(context)) + viewHolder.binding?.icon?.setColorFilter(descriptor.color) viewHolder.binding?.name?.text = descriptor.title + viewHolder.binding?.name?.setTextColor(descriptor.color) } } } -} \ No newline at end of file +}