Questions tagged [android-jetpack-compose-text]

130 questions
70
votes
12 answers

Jetpack Compose Text hyperlink some section of the text

How can i add hyperlink to some section of the text of Text component? With buildAnnotatedString i can set link section blue and underlined as in image below, but how can i also turn that section into link? val annotatedLinkString =…
Thracian
  • 43,021
  • 16
  • 133
  • 222
66
votes
3 answers

Toggle password field jetpack compose

Hi I am trying to change visualTransformation dynamically when the user click on see password button. I can manage to filter password but couldn't achive to show in plain text. Any idea for that ? Here is what I got so far. fun UserInputText( …
57
votes
2 answers

Jetpack Compose how to remove EditText/TextField underline and keep cursor?

Hi I need to remove the underline in my TextField because it look ugly when the TextField is circular. I have sat the activeColor to transparent, but then the cursor wont show (because it's transparent). How can I remove the underline/activeColor…
28
votes
3 answers

Jetpack Compose How to Align text or content of Text component with specific size to bottom left or right?

How can i align text to bottom section of a Text component with Jetpack Compose? TextAlign only has Start, End, Left, Center, Right and Justify options. Text( text = "First", textAlign = TextAlign.Start, modifier =…
Thracian
  • 43,021
  • 16
  • 133
  • 222
27
votes
4 answers

How to change text field cursor position in jetpack compose

I have list of text suggestions chip view above textfield, when user clicking chip I am appending the text into textfield. after that I want to move the cursor to the end position. I couldn't find solution for this in Jetpack compose. earlier we…
MathankumarK
  • 2,717
  • 1
  • 17
  • 34
23
votes
4 answers

Jetpack Compose - Scroll to focused composable in Column

I have UI like this: val scrollState = rememberScrollState() Column( modifier = Modifier .fillMaxSize(1F) .padding(horizontal = 16.dp) .verticalScroll(scrollState) ) { …
radzio
  • 2,862
  • 4
  • 26
  • 35
22
votes
6 answers

How to override the text color in TextField in Jetpack Compose using MaterialTheme?

I'm trying to use TextField() from Jetpack Compose. I want the text color to be white. I found this to be working: ProvideTextStyle(TextStyle(color = Color.White)) { TextField( ... ) } However, I want to override this in the Theme…
21
votes
6 answers

Compose: Create Text with Circle Background

Coming from SwiftUI, I wanted to create a view of a Text where it has a background of a Circle, where the circle's width/height grow as the text inside Text gets longer. Since there's no Circle() in Compose like there is in SwifUI, I created just a…
21
votes
5 answers

What is the simplest way to set the focus order in Jetpack Compose?

I have a column of TextFields, something like: Column { TextField( value = ..., onValueChange = { ... }, keyboardOptions = KeyboardOptions(imeAction = ImeAction.next), ) TextField( value = ..., …
Sean
  • 2,632
  • 2
  • 27
  • 35
20
votes
8 answers

How to clear TextField focus when closing the keyboard and prevent two back presses needed to exit app in Jetpack Compose?

I'm using BasicTextField. When I start editing, back button becomes hide keyboard button(arrow down). First press on back button hides keyboard, but the focus is still on the text field. Both onFocusChanged and BackPressHandler handlers not getting…
Phil Dukhov
  • 67,741
  • 15
  • 184
  • 220
19
votes
1 answer

Add icon at last word of Text in Jetpack Compose

I want to display a dynamic multiple lines text and an icon at the end of the last line. This icon can be animate. I try some ways but not success yet. How should I do? Example view which had the same idea with my layout
18
votes
10 answers

Expandable Text in Jetpack Compose

so I am using a Text() composable like so: Text( text = "this is some sample text that is long and so it is ellipsized", maxLines = 1, overflow = TextOverflow.Ellipsis ) and it ellipsizes the text properly: The issue is…
17
votes
1 answer

Android Jetpack Compose TextField disable keyboard auto suggestions

I'm looking for a way to disable the keyboard auto suggestions with the TextField Composable. In the olden days of Android from about 4 months ago, using EditText you could do something like this, setting the inputType to…
17
votes
1 answer

How to change Text's contentDescription on JetpackCompose

How can I change the default Text content description to be read on TalkBack on Jetpack Compose to any text that I want ?
16
votes
3 answers

How to set line-space with Android Jetpack Compose Text()?

I want to give more space dp between lines in the Text() content. The only property I find is the letterSpacing of TextStyle, however, it doesn't seem as I want, can we set it with composing somehow?
1
2 3
8 9