Material Design implementation in Jetpack compose of a TextField
Questions tagged [android-compose-textfield]
242 questions
3
votes
1 answer
Hide soft Keyboard on Drawer open - Jetpack Compose
I have a TextField and a ModalDrawer in a compose screen. I would like to close the soft keyboard when the user opens the drawer, but I haven't been able to figure out how. There is no onOpened lifecycle event that gets triggered in ModalDrawer…

kc_dev
- 578
- 1
- 6
- 21
3
votes
2 answers
Customise Focussed Indicator Line Android Compose TextField
Is there a way to customise, (I would like to shorten the length) of the focussed indicator line on a TextField in Android Compose UI?
I know it's possible to hide it by setting the focusedIndicatorColor to Transparent as per example…

Calvin
- 423
- 3
- 12
3
votes
2 answers
How to create Textfield in Compose
I want to create such Textfield:
how to do it, the textfield background?

Nurseyit Tursunkulov
- 8,012
- 12
- 44
- 78
3
votes
1 answer
Migrate androidTest to Compose
We are in the process of migrating our Android app to Jetpack Compose.
In our legacy Views-based app, we have a lot of androidTest tests, running on the emulator, using Espresso.
Most of our tests heavily use the Espresso withId() matcher. But of…

gpo
- 3,388
- 3
- 31
- 53
3
votes
2 answers
How to pass android compose material icons to textField
I want to use material icons as argument passing it to the textField.
@Composable
fun NormalTextField(
icon: () -> Unit, // how to pass material icon to textField
label: String
) {
val (text, setText) = mutableStateOf("")
…

ccd
- 5,788
- 10
- 46
- 96
2
votes
1 answer
is there a way to increase TextField password dot icon much bigger in jetpack compose?
I am doing Password Textfield and I want to do password dot when user typing but default password dot icon is small I want to bigger Textfield password dot. How can I do that ?
hear is my TextFiedl code ->
var text by remember { mutableStateOf("")…

NewPartizal
- 604
- 4
- 18
2
votes
2 answers
How to detect TextField cursor lies on which line in Android Jetpack compose
How to detect TextField cursor lies on which line in Android Jetpack compose.

Tippu Fisal Sheriff
- 2,177
- 11
- 19
2
votes
0 answers
How to increase the text area of a TextField in Jetpack Compose?
I have a requirement to only allow single-digit input, but the text appears partially cut off and I'd like to increase the size of the text area to display the entire digit.
I encountered this problem when I increased the fontSize value. However, I…

Mustafa İnan
- 41
- 4
2
votes
2 answers
Compose TextField: placing cursor on text removes LineThrough TextDecoration
I'm using a TextField or BasicTextField in compose and setting strikethrough span on the text using:
SpanStyle(textDecoration = TextDecoration.LineThrough)
It renders strikethrough on the text as expected. However, when I place the cursor on it, the…

Vikram Gupta
- 6,496
- 5
- 34
- 47
2
votes
1 answer
Jetpack Compose OutlinedTextField adds extra padding to the leadingIcon. Is there a way to remove it?
I can't figure out where this extra padding comes from. I even added a green background to the Icon to make sure the icon wasn't taking up any space. I read that singleLine can affect inner padding, but setting it to true/false didn't make a…

Marty Miller
- 913
- 2
- 11
- 27
2
votes
1 answer
Jetpack Compose lacks letter spacing for Persian/Arabic text
Jetpack Compose Text Composable features a letterSpacing parameter, which according to the documentation is described as:
the amount of space to add between each letter
However, in English scripts like many Latin/Roman scripts letters are not…

YaMiN
- 3,194
- 2
- 12
- 36
2
votes
2 answers
Text is not centered vertically with textAlign = TextAlign.Center when using minLines, only horizontally
Text(
modifier = Modifier
.fillMaxWidth()
.background(Color.Black),
minLines = 3,
textAlign = TextAlign.Center,
text = "Not centered vertically"
)
How can I center text by vertically and horizontally of its…

user924
- 8,146
- 7
- 57
- 139
2
votes
1 answer
How to reduce the height of androidx.compose.material3.OutlinedTextField
I have trouble with reducing the height of the OutlinedTextField in compose. I am trying to do a SearchBar inside the TopAppBar like it is done in many google apps(Gmail,Play Store). I am unable to achieve this in material3.
I tried copying the…

kacsagit
- 45
- 1
- 7
2
votes
1 answer
Search with DropDownItem in OutlineTextField not overlaying over content
I am trying to achieve search functionality in compose using DropDownItem but it is displaying below OutlineTextField. All the available option is not displaying over the content like DropDown menu.
Effort 1: Tried using DropDownMenu but in that…

Arpit Patel
- 7,212
- 5
- 56
- 67
2
votes
1 answer
How to change the TextDecoration.Underline with a custom style?
I wanted to apply custom underline style to the underlined text. Can we change within TextDecoration.underline ??
textStyle = MaterialTheme.typography.titleMedium.copy(
textAlign = TextAlign.Start,
fontWeight = FontWeight.W600,
color =…

Jeevan Rupacha
- 3,055
- 1
- 15
- 29