mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-15 10:46:12 -04:00
Refactor: Use plurals for unmatched devices count.
This commit is contained in:
@@ -21,19 +21,15 @@ class UnmatchedDevicesCardVH(parent: ViewGroup) :
|
||||
item: Item,
|
||||
payloads: List<Any>
|
||||
) -> 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() }
|
||||
}
|
||||
|
||||
|
||||
@@ -161,8 +161,10 @@
|
||||
<string name="overview_monitoring_active_label">Monitoring for devices</string>
|
||||
<string name="overview_monitoring_active_description">Make sure your device is nearby and active.</string>
|
||||
<string name="overview_unmatched_devices_label">Unmatched devices</string>
|
||||
<string name="overview_unmatched_devices_count_single">1 device without matching profile</string>
|
||||
<string name="overview_unmatched_devices_count_plural">%d devices without matching profile</string>
|
||||
<plurals name="overview_unmatched_devices_count">
|
||||
<item quantity="one">%d device without matching profile</item>
|
||||
<item quantity="other">%d devices without matching profile</item>
|
||||
</plurals>
|
||||
|
||||
<string name="permission_bluetooth_connect_label">Bluetooth connect</string>
|
||||
<string name="permission_bluetooth_connect_description">This app requires the \"Bluetooth connect\" permission to interact with paired devices and initiate connections.</string>
|
||||
|
||||
Reference in New Issue
Block a user