Repository: Automattic/pocket-casts-android
File: modules/services/compose/src/main/java/au/com/shiftyjelly/pocketcasts/compose/components/EmailAndPasswordFields.kt (Kotlin)

Code before:
    @StringRes textRes: Int,
) {
    TextP40(
        text = stringResource(textRes),
        color = MaterialTheme.theme.colors.support05,
        modifier = Modifier.padding(top = 8.dp),
    )
}

@Composable
fun EmailField(
    email: String,
    enabled: Boolean,
    isError: Boolean,
    modifier: Modifier = Modifier,
    placeholder: String = stringResource(LR.string.profile_email_address),
    onUpdateEmail: (String) -> Unit,
    imeAction: ImeAction = ImeAction.Next,
    onImeAction: () -> Unit,
    focusRequester: FocusRequester = remember { FocusRequester() },
    isCreatingAccount: Boolean,
) {
    val formModifier = modifier.focusRequester(focusRequester)
        .semantics {
            contentType = if (isCreatingAccount) ContentType.NewUsername else ContentType.Username
        }

    FormField(
        value = email,
        placeholder = placeholder,
        onValueChange = onUpdateEmail,
        enabled = enabled,
        isError = isError,
        leadingIcon = {
            Icon(
                imageVector = Icons.Outlined.Email,
                contentDescription = null,
            )
        },
        keyboardOptions = FormFieldDefaults.keyboardOptions.copy(
            capitalization = KeyboardCapitalization.None,
            imeAction = imeAction,
            keyboardType = KeyboardType.Email,
        ),
        onImeAction = onImeAction,
        modifier = formModifier,
    )
}

@Composable
fun PasswordField(

Review comment (suggestion):
This fixed the error:
```
'enum class AutofillType : Enum<AutofillType>' is deprecated.
```

Code after:
    @StringRes textRes: Int,
) {
    TextP40(
        text = stringResource(textRes),
        color = MaterialTheme.theme.colors.support05,
        modifier = Modifier.padding(top = 8.dp),
    )
}

@Composable
fun EmailField(
    email: String,
    enabled: Boolean,
    isError: Boolean,
    modifier: Modifier = Modifier,
    placeholder: String = stringResource(LR.string.profile_email_address),
    onUpdateEmail: (String) -> Unit,
    imeAction: ImeAction = ImeAction.Next,
    onImeAction: () -> Unit,
    focusRequester: FocusRequester = remember { FocusRequester() },
    isCreatingAccount: Boolean,
) {
    val formModifier = modifier.focusRequester(focusRequester)
        .semantics {
            contentType = (if (isCreatingAccount) ContentType.NewUsername else ContentType.Username) + ContentType.EmailAddress
        }

    FormField(
        value = email,
        placeholder = placeholder,
        onValueChange = onUpdateEmail,
        enabled = enabled,
        isError = isError,
        leadingIcon = {
            Icon(
                imageVector = Icons.Outlined.Email,
                contentDescription = null,
            )
        },
        keyboardOptions = FormFieldDefaults.keyboardOptions.copy(
            capitalization = KeyboardCapitalization.None,
            imeAction = imeAction,
            keyboardType = KeyboardType.Email,
        ),
        onImeAction = onImeAction,
        modifier = formModifier,
    )
}

@Composable
fun PasswordField(