Questions tagged [android-compose-textfield]

Material Design implementation in Jetpack compose of a TextField

242 questions
0
votes
0 answers

Jetpack Compose Use FlowRow with Text Justify

I have the below 4 strings to be aligned side by side in a FlowRow. This is the code I have. I am not sure why even though there is some space in each line, text justification is not happening. I do not want any space after any of the lines. I want…
0
votes
1 answer

How to mix selectable text and clickable text at once?

I'm trying to build a panel that contains a lot of information. Those informations must be selectable, in order to able the user to copy it. But, beyond this, this information panel contains some parts that, when clicked, must to perform something…
0
votes
1 answer

How to prevent dragging event of BasicTextField in Compose

How can I prevent the dragging functionality of BasicTextField. I dont want the user to be able to drag the text and make it invisible. Below a video with the functionality that I want to disable. This my code: @Composable fun MyScreen() { var…
0
votes
1 answer

How to check if TextField has overflown? And how to apply autoresize?

I'm building a DropDownMenu and the composable showing the current selected item is a TextField. I would like for the text to be resized if the selected element is too long, but I can't seem to find a way do so. I've searched how to autoresize in…
0
votes
1 answer

How to make a always on placeholder/hint for Jetpack Compose TextField?

M3 TextField has a placeholder parameter where it shows a text when it's focused and empty. But I want to show a placeholder or a hint always as the user is typing. Something similar to search suggestions but more like Github Copilot suggestions…
0
votes
0 answers

How to give horizontal align two text in jetpack compose?

I have 2 Text, first one is a normal text, so I wrote it in Text, but the second one is a user-changeable text, and I wrote it as OutLineTextField and customized it according to myself, but Row( modifier = modifier …
0
votes
0 answers

Focus to TextField but without showing the keyboard

When a user taps on the submit button the app focuses on that TextField if there is an error with input data, it works fine but it automatically opens the keyboard which is shown below TextField and covers Text error which is placed below TextField…
user924
  • 8,146
  • 7
  • 57
  • 139
0
votes
1 answer

Restrict OutlinedTextField to two digits

I'm using an OutlinedTextField for the user to input a number, I want that number to be restricted to two digits. The issue is that instead of using the built in soft keyboard I'm using my own custom keyboard. It ignores my regex pattern and allows…
0
votes
1 answer

Compose Text - width in chars

Is there a way to tell a Text composable to be as wide as e.g. 2 characters no matter what the provided text is? I want to have a row with weights and some fixed size cells but I do want the fixed size cells to have a width that's exactly as large…
prom85
  • 16,896
  • 17
  • 122
  • 242
0
votes
2 answers

jetpack compose - OutlinedTextField errorBorderColor not working

I'm trying to set errorBorderColor of OutlinedTextField to Red but it's not working. Here I give the colors; @Composable private fun dateTimePickerColors() = TextFieldDefaults.outlinedTextFieldColors( errorBorderColor = Color.Red, …
0
votes
1 answer

Jetpack compose material3 TextField minimum height

so I have a OutlinedTextField with supportingText which is available with conditions. var usernameValue by remember { mutableStateOf(TextFieldValue("")) } androidx.compose.material3.OutlinedTextField( modifier = Modifier .fillMaxWidth() …
0
votes
1 answer

How to align centre text in other item of canvas in jetpack compose

I want to align my drawText centre of view in my canvas. I draw my Image view with the help of this answer. Now I want to drawText at above, but my Text is in centre of my view. It's little bit complicated but I'll show you in…
0
votes
1 answer

Text not showing outside of Row scope in jetpack compose

What's Happening? So I have this column which has two mutable objects of type LocalTime. I am updated both in the TwoLineButton() method. Then I have this method ShowTimeRangeText() which displays a Text if both LocalTime objects are anything other…
0
votes
1 answer

Can the VisualTransformations work with a composable OutlinedTextField

Material 3 I have the following code snippet of a simple password entry. However, its not building because of the following errors @Composable invocations can only happen from the context of a @Composable function However, if I remove the…
ant2009
  • 27,094
  • 154
  • 411
  • 609
0
votes
1 answer

Unable to align a text and a Switch in a Row lambda in jetpack compose

ISSUE I am trying to align the text Enable Notifications and the switch on the same line. If I were to use XML layouts, then I would have gone with constraint layout, but I am trying to figure out how to do this with Compose. SET UP @Composable fun…
Kartik
  • 2,541
  • 2
  • 37
  • 59