mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-15 02:36:12 -04:00
Clean up strings
This commit is contained in:
+2
-2
@@ -25,8 +25,8 @@ class DualApplePodsCardVH(parent: ViewGroup) :
|
||||
val device = item.device
|
||||
name.apply {
|
||||
val sb = StringBuilder(device.getLabel(context))
|
||||
if (device.deviceColor != DeviceColor.UNKNOWN) {
|
||||
sb.append(" (${device.getDeviceColorLabel(context)})")
|
||||
if (!listOf(DeviceColor.WHITE, DeviceColor.UNKNOWN).contains(device.deviceColor)) {
|
||||
sb.append(" (${device.deviceColor.name})")
|
||||
}
|
||||
text = sb
|
||||
if (item.isMainPod) setTypeface(typeface, Typeface.BOLD)
|
||||
|
||||
@@ -118,27 +118,24 @@ interface DualApplePods : ApplePods, HasDualPods, HasEarDetection, HasCase {
|
||||
val deviceColor: DeviceColor
|
||||
get() = DeviceColor.values().firstOrNull { it.raw == rawDeviceColor } ?: DeviceColor.UNKNOWN
|
||||
|
||||
enum class DeviceColor(val raw: UByte?) {
|
||||
|
||||
fun getDeviceColorLabel(context: Context): String = context.getString(deviceColor.labelRes)
|
||||
WHITE(0x00),
|
||||
BLACK(0x01),
|
||||
RED(0x02),
|
||||
BLUE(0x03),
|
||||
PINK(0x04),
|
||||
GRAY(0x05),
|
||||
SILVER(0x06),
|
||||
GOLD(0x07),
|
||||
ROSE_GOLD(0x08),
|
||||
SPACE_GRAY(0x09),
|
||||
DARK_BLUE(0x0a),
|
||||
LIGHT_BLUE(0x0b),
|
||||
YELLOW(0x0c),
|
||||
UNKNOWN(null);
|
||||
|
||||
enum class DeviceColor(val raw: UByte?, @StringRes val labelRes: Int) {
|
||||
|
||||
WHITE(0x00, R.string.pods_device_color_white_label),
|
||||
BLACK(0x01, R.string.pods_device_color_black_label),
|
||||
RED(0x02, R.string.pods_device_color_red_label),
|
||||
BLUE(0x03, R.string.pods_device_color_blue_label),
|
||||
PINK(0x04, R.string.pods_device_color_pink_label),
|
||||
GRAY(0x05, R.string.pods_device_color_gray_label),
|
||||
SILVER(0x06, R.string.pods_device_color_silver_label),
|
||||
GOLD(0x07, R.string.pods_device_color_gold_label),
|
||||
ROSE_GOLD(0x08, R.string.pods_device_color_rose_gold_label),
|
||||
SPACE_GRAY(0x09, R.string.pods_device_color_space_gray_label),
|
||||
DARK_BLUE(0x0a, R.string.pods_device_color_dark_blue_label),
|
||||
LIGHT_BLUE(0x0b, R.string.pods_device_color_light_blue_label),
|
||||
YELLOW(0x0c, R.string.pods_device_color_yellow_label),
|
||||
UNKNOWN(null, R.string.general_value_unknown_label);
|
||||
|
||||
constructor(raw: Int, @StringRes labelRes: Int) : this(raw.toUByte(), labelRes)
|
||||
constructor(raw: Int) : this(raw.toUByte())
|
||||
}
|
||||
|
||||
val connectionState: ConnectionState
|
||||
|
||||
@@ -35,27 +35,11 @@
|
||||
<string name="permission_ignore_battery_optimizations_label">Disable battery optimizations</string>
|
||||
<string name="permission_ignore_battery_optimizations_description">Battery optimizations prevent this app from reliably receiving Bluetooth data while the app is in the background.</string>
|
||||
|
||||
<string name="pods_single_basic_status_short">Headphones: %1$s</string>
|
||||
<string name="pods_single_headphones_label">Headphones</string>
|
||||
<string name="pods_dual_left_label">Left pod</string>
|
||||
<string name="pods_dual_right_label">Right pod</string>
|
||||
<string name="pods_case_label">Case</string>
|
||||
<string name="pods_case_status_open_label">Open</string>
|
||||
<string name="pods_case_status_closed_label">Closed</string>
|
||||
<string name="pods_reception_x_label">Reception %s</string>
|
||||
<string name="pods_device_color_white_label">White</string>
|
||||
<string name="pods_device_color_yellow_label">Yellow</string>
|
||||
<string name="pods_device_color_light_blue_label">Light blue</string>
|
||||
<string name="pods_device_color_dark_blue_label">Dark blue</string>
|
||||
<string name="pods_device_color_space_gray_label">Space gray</string>
|
||||
<string name="pods_device_color_rose_gold_label">Rose gold</string>
|
||||
<string name="pods_device_color_gold_label">Gold</string>
|
||||
<string name="pods_device_color_silver_label">Silver</string>
|
||||
<string name="pods_device_color_gray_label">Gray</string>
|
||||
<string name="pods_device_color_pink_label">Pink</string>
|
||||
<string name="pods_device_color_blue_label">Blue</string>
|
||||
<string name="pods_device_color_red_label">Red</string>
|
||||
<string name="pods_device_color_black_label">Black</string>
|
||||
<string name="pods_connection_state_disconnected_label">Not connected to a device</string>
|
||||
<string name="pods_connection_state_idle_label">Connected to a device, but idle</string>
|
||||
<string name="pods_connection_state_music_label">In music mode</string>
|
||||
@@ -85,7 +69,6 @@
|
||||
<string name="settings_acknowledgements_label">Acknowledgements</string>
|
||||
|
||||
<string name="changelog_label">Changelog</string>
|
||||
<string name="documentation_label">Documentation</string>
|
||||
<string name="settings_support_email_developer_label">Email developer</string>
|
||||
|
||||
<string name="settings_support_installid_label">Install ID</string>
|
||||
|
||||
Reference in New Issue
Block a user