From 0f74cb9b394147d6632fb8dfacd90e8d58bae5aa Mon Sep 17 00:00:00 2001 From: darken Date: Tue, 7 Oct 2025 11:48:49 +0200 Subject: [PATCH] Refactor: Use plurals for unmatched devices count. --- .../main/ui/overview/cards/UnmatchedDevicesCardVH.kt | 10 +++------- app/src/main/res/values/strings.xml | 6 ++++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/eu/darken/capod/main/ui/overview/cards/UnmatchedDevicesCardVH.kt b/app/src/main/java/eu/darken/capod/main/ui/overview/cards/UnmatchedDevicesCardVH.kt index 4defee06..dbeafed5 100644 --- a/app/src/main/java/eu/darken/capod/main/ui/overview/cards/UnmatchedDevicesCardVH.kt +++ b/app/src/main/java/eu/darken/capod/main/ui/overview/cards/UnmatchedDevicesCardVH.kt @@ -21,19 +21,15 @@ class UnmatchedDevicesCardVH(parent: ViewGroup) : item: Item, payloads: List ) -> Unit = binding(payload = true) { item -> - val countText = when (item.count) { - 1 -> context.getString(R.string.overview_unmatched_devices_count_single) - else -> context.getString(R.string.overview_unmatched_devices_count_plural, item.count) - } - unmatchedCount.text = countText - + unmatchedCount.text = getQuantityString(R.plurals.overview_unmatched_devices_count, item.count, item.count) + val toggleText = if (item.isExpanded) { context.getString(R.string.general_hide_action) } else { context.getString(R.string.general_show_action) } toggleAction.text = toggleText - + toggleAction.setOnClickListener { item.onToggle() } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index b5c38bba..88a25338 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -161,8 +161,10 @@ Monitoring for devices Make sure your device is nearby and active. Unmatched devices - 1 device without matching profile - %d devices without matching profile + + %d device without matching profile + %d devices without matching profile + Bluetooth connect This app requires the \"Bluetooth connect\" permission to interact with paired devices and initiate connections.