mirror of
https://github.com/Myzel394/NumberHub.git
synced 2025-06-19 00:35:26 +02:00
Fix OutlinedDecimalTextField colors
This commit is contained in:
parent
13bb808455
commit
b90aa99004
@ -27,6 +27,8 @@ import androidx.compose.material.icons.outlined.Clear
|
|||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.IconButton
|
import androidx.compose.material3.IconButton
|
||||||
import androidx.compose.material3.OutlinedTextField
|
import androidx.compose.material3.OutlinedTextField
|
||||||
|
import androidx.compose.material3.OutlinedTextFieldDefaults
|
||||||
|
import androidx.compose.material3.TextFieldColors
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.text.input.ImeAction
|
import androidx.compose.ui.text.input.ImeAction
|
||||||
@ -40,8 +42,9 @@ fun OutlinedDecimalTextField(
|
|||||||
value: TextFieldValue,
|
value: TextFieldValue,
|
||||||
onValueChange: (TextFieldValue) -> Unit,
|
onValueChange: (TextFieldValue) -> Unit,
|
||||||
label: @Composable () -> Unit,
|
label: @Composable () -> Unit,
|
||||||
|
colors: TextFieldColors = OutlinedTextFieldDefaults.colors(),
|
||||||
expressionFormatter: VisualTransformation,
|
expressionFormatter: VisualTransformation,
|
||||||
imeAction: ImeAction = ImeAction.Next
|
imeAction: ImeAction = ImeAction.Next,
|
||||||
) {
|
) {
|
||||||
OutlinedTextField(
|
OutlinedTextField(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
@ -61,5 +64,6 @@ fun OutlinedDecimalTextField(
|
|||||||
keyboardType = KeyboardType.Decimal,
|
keyboardType = KeyboardType.Decimal,
|
||||||
imeAction = imeAction
|
imeAction = imeAction
|
||||||
),
|
),
|
||||||
|
colors = colors
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
package com.sadellie.unitto.feature.bodymass.components
|
package com.sadellie.unitto.feature.bodymass.components
|
||||||
|
|
||||||
import androidx.compose.animation.AnimatedContent
|
import androidx.compose.animation.AnimatedContent
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.OutlinedTextFieldDefaults
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
@ -49,6 +51,11 @@ internal fun BodyMassTextField(
|
|||||||
onValueChange(it.copy(cleanText))
|
onValueChange(it.copy(cleanText))
|
||||||
},
|
},
|
||||||
label = { AnimatedContent(label) { Text(it) } },
|
label = { AnimatedContent(label) { Text(it) } },
|
||||||
|
colors = OutlinedTextFieldDefaults
|
||||||
|
.colors(
|
||||||
|
focusedTextColor = MaterialTheme.colorScheme.onSecondaryContainer,
|
||||||
|
unfocusedTextColor = MaterialTheme.colorScheme.onSecondaryContainer,
|
||||||
|
),
|
||||||
expressionFormatter = expressionFormatter,
|
expressionFormatter = expressionFormatter,
|
||||||
imeAction = imeAction
|
imeAction = imeAction
|
||||||
)
|
)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* Unitto is a unit converter for Android
|
* Unitto is a unit converter for Android
|
||||||
* Copyright (c) 2023 Elshan Agaev
|
* Copyright (c) 2023-2024 Elshan Agaev
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -19,6 +19,8 @@
|
|||||||
package com.sadellie.unitto.feature.datecalculator.components
|
package com.sadellie.unitto.feature.datecalculator.components
|
||||||
|
|
||||||
import androidx.compose.animation.AnimatedContent
|
import androidx.compose.animation.AnimatedContent
|
||||||
|
import androidx.compose.material3.MaterialTheme
|
||||||
|
import androidx.compose.material3.OutlinedTextFieldDefaults
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
@ -43,6 +45,11 @@ internal fun TimeUnitTextField(
|
|||||||
onValueChange(newValue.copy(newValue.text.filter { it.isDigit() }))
|
onValueChange(newValue.copy(newValue.text.filter { it.isDigit() }))
|
||||||
},
|
},
|
||||||
label = { AnimatedContent(label) { Text(it) } },
|
label = { AnimatedContent(label) { Text(it) } },
|
||||||
|
colors = OutlinedTextFieldDefaults
|
||||||
|
.colors(
|
||||||
|
focusedTextColor = MaterialTheme.colorScheme.onSecondaryContainer,
|
||||||
|
unfocusedTextColor = MaterialTheme.colorScheme.onSecondaryContainer,
|
||||||
|
),
|
||||||
expressionFormatter = expressionFormatter,
|
expressionFormatter = expressionFormatter,
|
||||||
imeAction = imeAction
|
imeAction = imeAction
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user