1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-22 16:23:09 +02:00

Adjust default icon and color for custom measurement types

This commit is contained in:
oliexdev
2025-08-16 14:52:06 +02:00
parent 4eed5ce2f7
commit 4da84c8778
3 changed files with 7 additions and 7 deletions

View File

@@ -52,6 +52,7 @@ import androidx.compose.material.icons.filled.NightsStay
import androidx.compose.material.icons.filled.OilBarrel
import androidx.compose.material.icons.filled.Person
import androidx.compose.material.icons.filled.PieChart
import androidx.compose.material.icons.filled.QuestionMark
import androidx.compose.material.icons.filled.RadioButtonUnchecked
import androidx.compose.material.icons.filled.RemoveCircleOutline
import androidx.compose.material.icons.filled.Schedule
@@ -191,7 +192,7 @@ enum class MeasureUnit {
}
enum class MeasurementTypeIcon(val resource: IconResource) {
IC_DEFAULT(IconResource.VectorResource(Icons.Filled.RadioButtonUnchecked)),
IC_DEFAULT(IconResource.VectorResource(Icons.Filled.QuestionMark)),
IC_WEIGHT(IconResource.PainterResource(R.drawable.ic_weight)),
IC_BMI(IconResource.PainterResource(R.drawable.ic_bmi)),
IC_BODY_FAT(IconResource.PainterResource(R.drawable.ic_fat)),

View File

@@ -79,8 +79,7 @@ fun ColorPickerDialog(
LazyVerticalGrid(
columns = GridCells.Fixed(4),
modifier = Modifier
.fillMaxWidth()
.height(240.dp),
.fillMaxWidth(),
horizontalArrangement = Arrangement.Center,
verticalArrangement = Arrangement.spacedBy(12.dp)
) {
@@ -92,8 +91,8 @@ fun ColorPickerDialog(
.clip(CircleShape)
.background(color)
.border(
width = if (color == currentColor) 3.dp else 1.dp,
color = if (color == currentColor) MaterialTheme.colorScheme.onSurface else MaterialTheme.colorScheme.outlineVariant,
width = if (color == currentColor) 3.dp else 0.dp,
color = if (color == currentColor) MaterialTheme.colorScheme.onSurface else Color.Transparent,
shape = CircleShape
)
.clickable {

View File

@@ -141,8 +141,8 @@ fun MeasurementTypeDetailScreen(
mutableStateOf(allowedInputTypesForKey.firstOrNull() ?: InputFieldType.FLOAT)
}
}
var selectedColor by remember { mutableStateOf(originalExistingType?.color ?: 0xFF6200EE.toInt()) }
var selectedIcon by remember { mutableStateOf(originalExistingType?.icon ?: MeasurementTypeIcon.IC_WEIGHT) }
var selectedColor by remember { mutableStateOf(originalExistingType?.color ?: 0xFFFFA726.toInt()) }
var selectedIcon by remember { mutableStateOf(originalExistingType?.icon ?: MeasurementTypeIcon.IC_DEFAULT) }
var isEnabled by remember { mutableStateOf(originalExistingType?.isEnabled ?: true) }
var isPinned by remember { mutableStateOf(originalExistingType?.isPinned ?: false) }
var isOnRightYAxis by remember { mutableStateOf(originalExistingType?.isOnRightYAxis ?: false) }