android-jetpack-compose-text Questions

3

Solved

I need a text field in jetpack compose that works with a mask like this: NNNNN-NNN where N is an integer from 0 to 9. I need my composable function to have this mask in the OutlinedTextField : @Com...

5

Solved

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 transpa...

2

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, ...

3

Solved

Currently, I am migrating one of my apps to Material Design 3 which is entirely written in Kotlin using Jetpack Compose. While using Material Design 2, I was able to change the emphasis of the text...

9

Solved

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 onFoc...
Fairyfairyland asked 15/7, 2021 at 7:43

13

Solved

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 i...

6

Solved

I have a column of TextFields, something like: Column { TextField( value = ..., onValueChange = { ... }, keyboardOptions = KeyboardOptions(imeAction = ImeAction.next), ) TextField( value = ....

12

Solved

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 elli...

5

I have UI like this: val scrollState = rememberScrollState() Column( modifier = Modifier .fillMaxSize(1F) .padding(horizontal = 16.dp) .verticalScroll(scrollState) ) { TextField(...) // mu...
Special asked 17/2, 2021 at 20:56

4

Solved

I have a string in my strings.xml which is localized for different languages. The strings are styled with Html tags for each localization. Using Android TextView, I was able to show the styled text...

6

Solved

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() i...

3

In Jetpack Compose for android you can do this: val fontFamily = FontFamily( Font( resId = R.font.my_font_400_regular, weight = FontWeight.W400, style = FontStyle.Normal ), Font( resId = R....
Northeast asked 9/3, 2021 at 12:15

3

My code: OutlinedTextField( value = state.value, onValueChange = { state.value = it }, modifier = Modifier.fillMaxWidth().padding(start = 30.dp, end = 30.dp), label = { Text(text = "Someth...

4

Solved

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 ...
Cakewalk asked 29/1, 2022 at 18:31

2

In the View world we could use the @tools:sample/* resources to get sample texts, like full_names, first_names, cities, dates and so on. These annotations were used, afaik, by Android Studio layout...

2

Solved

I'm looking for an equivalent method of EditText's InputFilter in Jetpack Compose TextField. Because I'm trying to prevent users input unwanted values like %@*()- characters for example.

4

Solved

I wanted to know how to highlight the specific part of the text in jetpack compose. I tried Html.fromHtml() like this Text(text = Html.fromHtml(" <font color='red'> Hello </font> W...

4

Solved

I'm using a custom font within my Jetpack Compose app and would like to monospace the numbers within a specific Text component. With standard Android TextView, this can be done using the fontFeatur...

3

I have this code setContent { val items = mutableListOf<Int>().apply { (1..100).forEach { add(it) } } LazyColumn { items(items) { item -> TextField("$item", {}) } } } Wi...
Bilingual asked 21/8, 2022 at 23:27

3

Solved

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...

5

Solved

I have a string that contains html, how can I display this in a Jetpack compose Text? In a TextView I would use a Spanned and do something like: TextView.setText(Html.fromHtml("<p>someth...

1

I used this (not so nice anymore) example to enable linkification on my Android Jetpack Compose Text composable (see section with "The ClickableText handles link on text"). That works so ...

6

Solved

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,...

4

Solved

I know how to align text in Jetpack Compose to the baseline. But now I would need to align two differently sized texts that follow each other in a Row by the ascent of the larger of these two fonts...

2

Solved

Say I have a fixed size rectangle with some text inside. Since the user can change the font size from the System - Accessibility settings on the device, the font might not fit inside the fixed size...

© 2022 - 2024 — McMap. All rights reserved.