chore(ci): Optimize and stabilize Gradle builds and CI workflows (#4390)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2026-02-01 12:03:17 -06:00 committed by GitHub
parent 152099c7e9
commit 3659f468e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 236 additions and 131 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2025 Meshtastic LLC
* Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -14,7 +14,6 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.meshtastic.core.ui.component
import androidx.compose.foundation.layout.fillMaxWidth
@ -92,9 +91,9 @@ fun BitwisePreference(
}
PreferenceFooter(
enabled = enabled,
negativeText = Res.string.clear,
negativeText = org.jetbrains.compose.resources.stringResource(Res.string.clear),
onNegativeClicked = { onItemSelected(0) },
positiveText = Res.string.close,
positiveText = org.jetbrains.compose.resources.stringResource(Res.string.close),
onPositiveClicked = { expanded = false },
)
}

View file

@ -260,7 +260,7 @@ fun userFieldsToString(user: MeshProtos.User): String {
val value = user.getField(fieldDescriptor)
val valueString = valueToString(value, fieldDescriptor) // Using the helper from previous example
fieldLines.add("$fieldName: $valueString")
} else if (fieldDescriptor.isRepeated || fieldDescriptor.hasDefaultValue() || fieldDescriptor.isOptional) {
} else if (fieldDescriptor.isRepeated || fieldDescriptor.hasDefaultValue() || fieldDescriptor.hasPresence()) {
val defaultValue = fieldDescriptor.defaultValue
val valueString =
if (fieldDescriptor.isRepeated) {

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2025 Meshtastic LLC
* Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -14,7 +14,6 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.meshtastic.core.ui.component
import androidx.compose.foundation.layout.Column
@ -78,8 +77,11 @@ fun <T> DropDownPreference(
val descriptor = (selectedItem as ProtocolMessageEnum).descriptorForType
@Suppress("UNCHECKED_CAST")
enum?.filter { entries -> descriptor.values.any { it.name == entries.name && it.options.deprecated } }
as? List<T> ?: emptyList() // Safe cast to List<T> or return emptyList if cast fails
(
enum?.filter { entries -> descriptor.values.any { it.name == entries.name && it.options.deprecated } }
?: emptyList()
)
as List<T>
} else {
emptyList()
}

View file

@ -114,7 +114,7 @@ fun IndoorAirQuality(iaq: Int?, displayMode: IaqDisplayMode = IaqDisplayMode.Pil
return
}
var isLegendOpen by remember { mutableStateOf(false) }
val iaqEnum = if (iaq != null) getIaq(iaq) else null
val iaqEnum = getIaq(iaq)
val gradient = Brush.linearGradient(colors = Iaq.entries.map { it.color })
if (iaqEnum != null) {
@ -164,7 +164,7 @@ fun IndoorAirQuality(iaq: Int?, displayMode: IaqDisplayMode = IaqDisplayMode.Pil
IaqDisplayMode.Gauge -> {
CircularProgressIndicator(
progress = iaq / 500f,
progress = { iaq / 500f },
modifier = Modifier.size(60.dp).clickable { isLegendOpen = true },
strokeWidth = 8.dp,
color = iaqEnum.color,
@ -178,7 +178,7 @@ fun IndoorAirQuality(iaq: Int?, displayMode: IaqDisplayMode = IaqDisplayMode.Pil
modifier = Modifier.clickable { isLegendOpen = true },
) {
LinearProgressIndicator(
progress = iaq / 500f,
progress = { iaq / 500f },
modifier = Modifier.fillMaxWidth().height(20.dp),
color = iaqEnum.color,
)

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2025 Meshtastic LLC
* Copyright (c) 2025-2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -14,7 +14,6 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.meshtastic.core.ui.component
import androidx.compose.animation.AnimatedContent
@ -47,24 +46,22 @@ fun SwitchPreference(
containerColor: Color? = null,
loading: Boolean = false,
) {
val defaultColors = ListItemDefaults.colors()
@Suppress("DEPRECATION")
val currentColors =
if (enabled) {
defaultColors
} else {
defaultColors.copy(
headlineColor = defaultColors.contentColor.copy(alpha = 0.5f),
supportingTextColor = defaultColors.supportingContentColor.copy(alpha = 0.5f),
)
}
.let { if (containerColor != null) it.copy(containerColor = containerColor) else it }
ListItem(
colors =
ListItemDefaults.colors()
.copy(
headlineColor =
if (enabled) {
ListItemDefaults.colors().headlineColor
} else {
ListItemDefaults.colors().headlineColor.copy(alpha = 0.5f)
},
supportingTextColor =
if (enabled) {
ListItemDefaults.colors().supportingTextColor
} else {
ListItemDefaults.colors().supportingTextColor.copy(alpha = 0.5f)
},
containerColor = containerColor ?: ListItemDefaults.colors().containerColor,
),
colors = currentColors,
modifier =
(padding?.let { Modifier.padding(it) } ?: modifier).toggleable(
value = checked,