0

enter image description here I think it's the default padding I tried all the methods related to adding padding and removing the default padding but none of them worked, and I use OutlinedTextField because I can easily use LocalFocusManager with it

OutlinedTextField(
            modifier = Modifier
                .size(widthInDp, heightInDp)
                .focusRequester(item1)
                .onKeyEvent {
                    if (it.key.nativeKeyCode == 67) {
                        otp1 = ""
                        item1.freeFocus()
                        true
                    } else {
                        false
                    }
                },
            value = otp1,
            maxLines = 1,
            singleLine = true,
            shape = RoundedCornerShape(cornerRadius),
            visualTransformation = if (passwordToggle) PasswordVisualTransformation() else VisualTransformation.None,
            keyboardOptions = KeyboardOptions(
                keyboardType = KeyboardType.NumberPassword,
                imeAction = ImeAction.Next
            ),
            textStyle = LocalTextStyle.current.copy(textAlign = TextAlign.Center, color = Color.Black, fontWeight = FontWeight.Bold, fontSize =if(conf.screenWidthDp<350){8.sp}else{14.sp}),
            colors = TextFieldDefaults.outlinedTextFieldColors(
                focusedBorderColor = focusColor,
                unfocusedBorderColor =if (otp1.length == 1) {focusColor}else{unfocusColor}
            ),
            onValueChange = {
                if (it.length <= 1) {
                    otp1 = it
                    item1.freeFocus()
                    item2.requestFocus()
                }
            },
        )

0 Answers0