Skip to content

Commit

Permalink
feat: add 'disabled' state to rule list (#223)
Browse files Browse the repository at this point in the history
* Add 'disabled' state to rule list

* Add translations for 'disabled'

* Compare enabled as int instead of bool
  • Loading branch information
bnichs authored Nov 30, 2024
1 parent 053ae93 commit 13e8b70
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-de/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<string name="filter_rules_desc_delete_filter">Netzwerkfilter löschen</string>
<string name="filter_rules_reg_exr">RegExp</string>
<string name="filter_rules_whitelist">Whitelist</string>
<string name="filter_rules_disabled">deaktiviert</string>
<string name="home_ads_over_time">Blockiert</string>
<string name="home_blocklist">Domains in Adlist</string>
<string name="home_percent_blocked">Prozentual blockiert</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<string name="filter_rules_desc_delete_filter">Usuń filtr</string>
<string name="filter_rules_reg_exr">RegEx</string>
<string name="filter_rules_whitelist">Biała lista</string>
<string name="filter_rules_disabled">wyłączony</string>
<string name="home_ads_over_time">Zablokowany</string>
<string name="home_blocklist">Lista zablokowanych</string>
<string name="home_percent_blocked">Procent zablokowania</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values-ro/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<string name="filter_rules_desc_delete_filter">Șterge filtru</string>
<string name="filter_rules_reg_exr">RegEx</string>
<string name="filter_rules_whitelist">Listă permise</string>
<string name="filter_rules_disabled">dezactivat</string>
<string name="home_ads_over_time">blocate</string>
<string name="home_blocklist">Listă blocate</string>
<string name="home_percent_blocked">Procent Blocate</string>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<string name="filter_rules_desc_delete_filter">Delete filter</string>
<string name="filter_rules_reg_exr">RegEx</string>
<string name="filter_rules_whitelist">Whitelist</string>
<string name="filter_rules_disabled">disabled</string>
<string name="home_ads_over_time">blocked</string>
<string name="home_blocklist">Blocklist</string>
<string name="home_percent_blocked">Percent Blocked</string>
Expand Down

0 comments on commit 13e8b70

Please sign in to comment.