0

I'm trying to familiarize myself with the latest Jetpack-Compose but I'm finding that the Material3 version of BasicTextField doesn't match... pretty much any example anywhere. I'd love to know how it's changed. It doesn't even seem to match the brief appearance of BasicTextField2.

Specifically, when I ask AndroidStudio to show all of the parameters, I get the following:

        BasicTextField(
            state = TODO(),
            modifier = TODO(),
            enabled = TODO(),
            readOnly = TODO(),
            inputTransformation = TODO(),
            textStyle = TODO(),
            keyboardOptions = TODO(),
            onKeyboardAction = TODO(),
            lineLimits = TODO(),
            onTextLayout = TODO(),
            interactionSource = TODO(),
            cursorBrush = TODO(),
            outputTransformation = TODO(),
            decorator = TODO(),
            scrollState = TODO()
        )

Note how there is no "value" parameter anymore (it's embedded in "state"). "onValueChanged" has moved too, so now I'd just like to find what is in this thing and how it works. I apologize for the n00bishness of this, but I cannot find documentation for this particular iteration of BasicTextField.

Where can I find the documentation on the "valueless" BasicTextField, and if I decide that I don't like it, how far back to I need to downgrade my compileSdk to in order to get back the old one?

1 Answer 1

1

I'm finding that the Material3 version of BasicTextField

BasicTextField() is not part of Compose Material3. All standard composables beginning with Basic are part of Compose Foundation and are designed for developers creating their own design systems. Compose Material3 has TextField(), which applies the Material Design 3 design system to text entry.

Where can I find the documentation on the "valueless" BasicTextField

It can be found in the overall Android developer documentation.

how far back to I need to downgrade my compileSdk to in order to get back the old one?

compileSdk has nothing to do with it. Compose is a series of libraries; it is not published as part of the framework that compileSdk is connected to.

Note how there is no "value" parameter anymore (it's embedded in "state")

There is this overload of BasicTextField() that takes a value as a String. There is also this overload that takes a value as a TextFieldValue.

Sign up to request clarification or add additional context in comments.

1 Comment

Ty. I knew I was in the weeds here. Every Google search or Gemini query took me to the wrong (old) place. I was embarrassed even to ask.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.