Vsevolod Kaganovych

    Vsevolod Kaganovych

    1 year ago
    Hi. I have a
    TextField
    with label. I want to change the
    fontSize
    of label but leave the behaviour that it becomes smaller when it floats to the top. If I change font size, the animation of decreasing size is gone and label has the same size in focused and unfocused mode. But if I don't set manually
    fontSize
    , everything works as expected. Any suggestions? Code in thread.
    TextField(
                    value = emailText,
                    onValueChange = onEmailChange,
                    label = {
                        Text(
                            text = stringResource(id = R.string.email),
                            color = colorResource(id = R.color.login_text_color),
                            fontSize = 32.sp
                        )
                    }
                )
    Anastasia Rozovskaya

    Anastasia Rozovskaya

    1 year ago
    may be your should manually animate the fontSize now by using
    .animateFloatAsState
    (I do not see .animateSpAsState yet, so that’s why the Float)