Questions tagged [android-compose-textfield]

Material Design implementation in Jetpack compose of a TextField

242 questions
1
vote
1 answer

Why my Jetpack Compose Text does not recomposed while TextField does

In Android Jetpack Compose app, I have tried a clickable update on Text. class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { ColorBox()…
1
vote
1 answer

Get text after visual transformation

Is there any way to get text after applying visualTransformtaion from text field in Compose? onTextChange and onValueChange return the input before visual transformations I checked the docs and found inside CoreTextField that this transformation is…
1
vote
1 answer

How to attain this OneUI like icon shape in Jetpack Compose?

How can I attain this shape in Jetpack Compose? Or How do people at Samsung should have attained this shape? I tried with Squircle shape. But it's not working.
imn
  • 620
  • 1
  • 7
  • 19
1
vote
1 answer

How can I change the size (height) of the cursor of a TextField in jetpack compose irrespective of font size?

How can I change the size of the cursor (height) of a TextField in jetpack compose irrespective of font size ? any tips or tricks ?
1
vote
1 answer

Change alignment of child in column in jetpack compose

I want to change the horizontalAlignment of particular child and remaining will use the same horizontalAlignment. Is this possible in Column? For example, Column parent modifier use horizontalAlignment = Alignment.CenterHorizontally, and I want…
1
vote
1 answer

Jetpack compose visual transformation only number

How to implement a visual transformation that it only digits and only one '.' . This is how I am trying to implement this but getting offset error: class NumberTransformer : VisualTransformation { override fun filter(text: AnnotatedString):…
1
vote
1 answer

Android compose test TextField input type

How would you go about testing what input type TextField uses, for example if I wanted to test if user input has an alphanumeric keyboard type or numeric. I can see that in SemanticProperties there is ImeAction, but I can't see anything I could use…
1
vote
2 answers

How to declare the text size for all Text fields within a row / column

How can I specify a textSize for all text elements within a Column / Row? I have difficulty finding a method, which helps me doing something like the UnspecifiedFontSize (pseudo code): Row { UnspecifiedFontSize(size= 128.dp) { …
1
vote
1 answer

How to disable layout modifier for children using Jetpack Compose

I have a Box with textfield inside. i want to hide keyboard by touching on the Box and use modifier of Box for it: .onFocusEvent { focusState -> if (focusState.isFocused) { keyboardController?.hide() } } But this applies to the text…
1
vote
1 answer

Jetpack Compose - How to use custom height on TextFieldDefaults.OutlinedTextFieldDecorationBox

I'm trying to create a custom TextField using Android Jetpack compose, see below TextFieldDefaults.OutlinedTextFieldDecorationBox( contentPadding = PaddingValues(vertical = 10.dp), value =…
1
vote
1 answer

Normal text with clickable text (not hyper link)

I feel that there is a better way to do this thing, I know that this code works, but I just want to know if there is another (best) way to do this. Row() { Text(text = "By signing up, you agree with the ") Text( text = "Terms of…
1
vote
2 answers

Jetpack Compose how to get changed text, index and length in TextField?

I'm trying to create a mentions feature in Jetpack Compose. I found a library which uses an EditText and I of course could use that, but I really want to create this in Jetpack Compose. The only problem is, in some cases it's hard to keep track of…
1
vote
1 answer

Jetpack Compose - Show trailingIcon in BasicTextField?

TextField has way too much padding by default for the screen I'm building, so I'm forced to use BasicTextField (see: this post on default TextField padding) The problem is, BasicTextField doesn't take in a trailingIcon parameter. Is there a way to…
1
vote
0 answers

Jetpack Compose BasicTextField default and undeletable start characters

I have a BasicTextField that using for phone number with VisualTransformation . I can format phone number with VisualTransformation like # ### ### ## ##. But how can I make a BasicTextField that hold first two characters (because in Turkey all of…
emreturka
  • 846
  • 3
  • 18
  • 44