@@ -3,32 +3,36 @@ package remix.myplayer.ui.widget.common
33import androidx.compose.foundation.text.KeyboardActions
44import androidx.compose.foundation.text.KeyboardOptions
55import androidx.compose.material3.OutlinedTextField
6+ import androidx.compose.material3.OutlinedTextFieldDefaults
67import androidx.compose.runtime.Composable
78import androidx.compose.ui.ExperimentalComposeUiApi
89import androidx.compose.ui.Modifier
910import androidx.compose.ui.autofill.ContentType
11+ import androidx.compose.ui.graphics.Color
1012import androidx.compose.ui.res.stringResource
1113import androidx.compose.ui.semantics.contentType
1214import androidx.compose.ui.semantics.semantics
1315import androidx.compose.ui.text.input.ImeAction
1416import androidx.compose.ui.text.input.KeyboardType
1517import androidx.compose.ui.text.input.VisualTransformation
18+ import remix.myplayer.ui.theme.LocalTheme
1619
1720@OptIn(ExperimentalComposeUiApi ::class )
1821@Composable
1922fun EditField (
2023 value : String ,
2124 labelRes : Int ,
25+ modifier : Modifier = Modifier ,
2226 isError : Boolean = false,
2327 isLast : Boolean = false,
2428 maxLine : Int = 1,
25- modifier : Modifier = Modifier ,
2629 contentType : ContentType ? = null,
2730 keyboardType : KeyboardType = KeyboardType .Text ,
2831 visualTransformation : VisualTransformation = VisualTransformation .None ,
2932 onDone : () -> Unit = {},
3033 onValueChange : (String ) -> Unit ,
3134) {
35+ val theme = LocalTheme .current
3236 OutlinedTextField (
3337 value = value,
3438 maxLines = maxLine,
@@ -48,6 +52,16 @@ fun EditField(
4852 label = {
4953 TextPrimary (stringResource(labelRes))
5054 },
55+ colors = OutlinedTextFieldDefaults .colors(
56+ focusedTextColor = theme.textPrimary,
57+ unfocusedTextColor = theme.textPrimary,
58+ errorTextColor = theme.textPrimary,
59+ cursorColor = theme.primary,
60+ errorCursorColor = theme.primary,
61+ focusedContainerColor = Color .Transparent ,
62+ unfocusedContainerColor = Color .Transparent ,
63+ errorContainerColor = Color .Transparent
64+ ),
5165 modifier = Modifier
5266 .semantics {
5367 if (contentType != null ) {
@@ -56,4 +70,4 @@ fun EditField(
5670 }
5771 .then(modifier)
5872 )
59- }
73+ }
0 commit comments