From 13e8b70cce3705f585f721a358df88f72ca1106b Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 30 Nov 2024 16:31:19 -0600 Subject: [PATCH] feat: add 'disabled' state to rule list (#223) * Add 'disabled' state to rule list * Add translations for 'disabled' * Compare enabled as int instead of bool --- .../ui/screen/filterrules/FilterRulesScreen.kt | 12 +++++++++++- app/src/main/res/values-de/strings.xml | 1 + app/src/main/res/values-pl/strings.xml | 1 + app/src/main/res/values-ro/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/tien/piholeconnect/ui/screen/filterrules/FilterRulesScreen.kt b/app/src/main/java/com/tien/piholeconnect/ui/screen/filterrules/FilterRulesScreen.kt index eefaf79..31861a8 100644 --- a/app/src/main/java/com/tien/piholeconnect/ui/screen/filterrules/FilterRulesScreen.kt +++ b/app/src/main/java/com/tien/piholeconnect/ui/screen/filterrules/FilterRulesScreen.kt @@ -211,7 +211,17 @@ fun FilterRulesScreen(viewModel: FilterRulesViewModel = hiltViewModel()) { else -> null }, headlineContent = { Text(rule.domain) }, - supportingContent = rule.comment?.let { { Text(it) } }, + supportingContent = { + Text(buildString { + rule.comment?.let { append(it) } + if (rule.enabled == 0) { + if (rule.comment != null) append(" ") + append("(") + append(Text(stringResource(R.string.filter_rules_disabled))) + append(")") + } + }) + }, trailingContent = { Text( text = dateTimeInstance.format(rule.dateAdded * 1000L) diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 8bb228a..d35eddd 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -28,6 +28,7 @@ Netzwerkfilter löschen RegExp Whitelist + deaktiviert Blockiert Domains in Adlist Prozentual blockiert diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index b494e39..418c2ec 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -28,6 +28,7 @@ Usuń filtr RegEx Biała lista + wyłączony Zablokowany Lista zablokowanych Procent zablokowania diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 21347ad..0cee99a 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -28,6 +28,7 @@ Șterge filtru RegEx Listă permise + dezactivat blocate Listă blocate Procent Blocate diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1ff78ed..1389fb5 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -30,6 +30,7 @@ Delete filter RegEx Whitelist + disabled blocked Blocklist Percent Blocked