432 questions
3
votes
1
answer
116
views
How to Change Jetpack Compose Bom Version to Alpha in libs.versions.toml?
I want to use state based TextField. I've learned that to use a state-based TextField, I must change the bom version to alpha. How can I change the bom version to alpha in libs.versions.toml?
[...
1
vote
1
answer
290
views
OutlinedTextField keyboard has weird behaviour
Here is my code:
Components.kt
package com.example.jettipapp.components
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx....
0
votes
1
answer
96
views
Android Compose SearchBar content alignment vertically?
I want to use SearchBar from Compose, but I need to set another height. However, the problem is that if I do this, then the EditText inside & all the content would remain fixed at the top. I need ...
1
vote
1
answer
384
views
Error with TextField Kotlin Jetpack Compose
With the code provided in Kotlin documentation, I'm getting the following error when implementing a TextField:
val state = rememberTextFieldState("Initial text", TextRange(0, 12))
TextField(...
1
vote
1
answer
113
views
New BasicTextField (BasicTextField2) limit maxLength
How can I set a character limit in a BasicTextField (or BasicTextField2) in Jetpack Compose?
With the new BasicTextField function, which uses a state: TextFieldState as a parameter, it is no longer ...
0
votes
1
answer
131
views
Android Compose OutlinedTextField disable capitalization
I want to disable capitalization on my OutlinedTextField that i want to be of an email type. Obviously this email type should have capitalization disabled. So here is what I tried and with no effect (...
0
votes
1
answer
112
views
How to align Jetpack Compose OutlinedTextField label without affecting border when field is populated?
I have an OutlinedTextField with label text. When the field is empty, I want the label hint aligned to the end of the field, like this:
.
However, the only way I've found to do this is by expanding ...
0
votes
0
answers
36
views
Android System clipboard dialogue not reliable in Compose Textfield
I am using Jetpack Compose and a simple text field
Here is my code
@Composable
fun SimpleFilledTextFieldSample() {
var text by remember { mutableStateOf("") }
val focusRequester = ...
0
votes
1
answer
156
views
Why does using a TextFieldValue in Jetpack Compose TextField cause infinite loop?
When I create a TextField using a TextFieldValue as it's value, as soon as I type a character it runs in an infinite loop, logging both my debug message before the condition check and 'show(ime(), ...
0
votes
1
answer
73
views
OutlinedTextField with onFocusChanged() and focusable(): no keyboard
I want to set focus to an OutlinedTextField, programmatically, and I want the software keyboard to appear.
But what I get is that when I set the focus to the OutlinedTextField, the software keyboard ...
1
vote
1
answer
136
views
Compose BasicTextField, drag cursor text doesn't scroll
I'm using Compose's BasicTextField, and when I drag the cursor, the text doesn't scroll.
var text by remember { mutableStateOf("123456789123456") }
Box(contentAlignment = Alignment.Center) {...
0
votes
0
answers
36
views
BasicTextField cursor randomly moves after placing it
This is my code. When I place the cursor with my finger, it will randomly move to another location than where I placed it.
var textFieldValueState by remember {
mutableStateOf(
...
0
votes
1
answer
800
views
How can I restrict font size scaling with Jetpack compose?
Trying to understand how to limit font scaling, from this example here:
Text(
text = "This is resizing text with font scale ${LocalDensity.current.fontScale}",
fontSize = 20.sp
)
On ...
2
votes
1
answer
159
views
Cursor doesn't move after filtering text Jetpack Compose
I'm using InputTransformation in Jetpack Compose to filter user input in a BasicTextField. The transformation works correctly, but the cursor remains in the same position after entering text instead ...
0
votes
1
answer
143
views
Auto-Focus BasicTextField Without Cursor Jetpack compose
I'm building a screen in Jetpack Compose where I want a BasicTextField to be "active" as soon as the screen loads. By "active," I mean that the label should animate upward (just ...
0
votes
0
answers
77
views
How to display masked characters in keyboard clipboard for SecureTextField
I am building an Android app using Jetpack Compose. My UI has two text fields:
BasicTextField (with KeyboardType.Email).
SecureTextField (with KeyboardType.Password).
When I copy some text from the ...
1
vote
1
answer
412
views
Label positioning issue in BasicTextField on focus jetpack compose
I'm encountering an issue with the label in BasicTextField in Jetpack Compose. When the text field gains focus (either by clicking or tapping), the label's height behaves strangely and does not ...
1
vote
2
answers
240
views
Jetpack Compose - TextField colors parameter not working
In a new Android Compose project using material3, I'm trying to set focusedLabelColor of OutlinedTextField as follows but it didn't work unless setting color on Text.
OutlinedTextField(
...
2
votes
1
answer
808
views
How to Implement a Custom Masked Input with Fixed Prefix in Jetpack Compose BasicTextField?
I want to apply a visual transformation to a BasicTextField in Jetpack Compose. I've tried some code, but I'm facing several issues. For example, the cursor doesn't stay in the correct position, and ...
1
vote
1
answer
65
views
Compose TextField from Material 3 inside an xml RecycleView item - Cursor is not showing
I tried implementing a jetpack compose text field (e.g. a composable function CustomTextField that makes use of JetpackCompose TextField component from Material 3), and tried to use my composable ...
0
votes
1
answer
385
views
How is TextField 's "onValueChange" parameter updated in Jetpack Compose
Having this simple example:
@Composable
fun SimpleFilledTextFieldSample() {
var text by remember { mutableStateOf("Hello") }
TextField(
value = text,
onValueChange = ...
2
votes
0
answers
82
views
Shadow applied on Text is clipped in Android Compose when there is an ellipsis
The shadow effect on a Text Composable, applied using Shadow(), looks great as it aligns with the shape of the text content. This works perfectly when there’s no ellipsis, allowing the shadow to ...
0
votes
1
answer
193
views
Do not dismiss keyboard when DropdownMenu is opened
In my Jetpack Compose app, it seems that any time I open a popup such as DropdownMenu while I'm typing something, the keyboard will disappear. Perhaps this happens because the TextField loses focus? I ...
0
votes
1
answer
288
views
Changes to the API on TextField/BasicTextField in JetpackCompose
I'm trying to familiarize myself with the latest Jetpack-Compose but I'm finding that the Material3 version of BasicTextField doesn't match... pretty much any example anywhere. I'd love to know how it'...
0
votes
0
answers
162
views
How to Keep TextField Cursor Visible Above Keyboard When Typing Long Text?
I'm working on a Jetpack Compose project where I need a full-screen TextField. However, I'm running into an issue where the cursor hides behind the keyboard when the user types long text. I've already ...
1
vote
2
answers
861
views
Set Composable TextField's background color to white. Android Jetpack compose
I have an OutlinedTextField and I want it to have a white background but only the TextField. The thing is, when I add modifier = Modifier.background(color = AppWhite), not only the TextField is white, ...
0
votes
2
answers
350
views
Textfield Visualtransformation crashing iwth offsetmapping originaltotransformed returned invalid mapping
I have a textfield and trying to achieve something like
When I set a value to textfield programmatically. Its a username field on login form. If it is saved previously by user then we mask first 4 ...
1
vote
1
answer
163
views
FocusRequester() and LocalFocusManager not working properly in jetpack compose
I have two TextFields, to provide good UX, I tried to use keyboardOptions and keyboardActions properties of TextFields. I have tried as:
val focusRequester = remember {
FocusRequester()
}
val ...
1
vote
1
answer
285
views
How to solve FocusRequester is not initialized?
I'm working on three pages: StartPage, LoginPage, and SignupPage, and I'm integrating them into a HorizontalPager.
In the SignupPage, i'm using requestFocus on textField.
The navigation flow is Start -...
3
votes
1
answer
134
views
How to make sure the phone keyboard is always hidden when pressing on BasicTextField?
I need my calculator BasicTextField to show the cursor but not the keyboard. Currently, when I tap the BasicTextField for the first time, the cursor appears, but the keyboard does not. When I tap it a ...
2
votes
1
answer
114
views
SWIFT or IFSC code formatter in android jetpack compose TextField editable
Ex: 23456-232
while typing above card number. we want to auto populate immediately - after 5th digit typed, then, user can enter last 3 digits.
how to achieve this in Jetpack compose in android.
1
vote
2
answers
62
views
How to get rid of mystery view on top of label in TextField compose
How do I hide view which is in light blue? .
I want to show border for a full TextField. I am trying to create a view like below. purple color will get updated to red or grey depending on state of ...
2
votes
1
answer
623
views
Jetpack Compose Text Styles(Strikethrough, Underline) issue
I am facing some unexpected TextStyle behaviour while applying different styles in Jetpack Compose.
This is my code:
@Composable
fun TextDecorationExample() {
var isUnderlined by remember { ...
2
votes
0
answers
209
views
In Jetpack Compose TextField, how can I remove text with a specific annotation once and for all if it has changed?
For certain words I'm emphasizing, and for that I'm putting an arbitrary annotation on the TextFieldValue.
val text = buildAnnotatedString {
append("TEST!! ")
...
1
vote
1
answer
268
views
How to make the first text item in the row grow in width up to 50%
It needs to make a row in the column, the row should have two text items, the second should right align the first text item.
And when the first text has longer text content, it should grow up to a max ...
1
vote
1
answer
53
views
TextField passed in lambda loses focus when in both branches of "if" block
I have some content with textfields passed as a lambda to another composable. Lambda is always a part of layout as it's in both branches of if statement, however when condition of 'if' changes - text ...
1
vote
0
answers
41
views
Compose TextField lose focus when newline on Samsung Note 10 Lite
Surface {
Box(contentAlignment = Alignment.Center,
modifier = Modifier
.fillMaxSize()
.padding(32.dp)) {
var state by remember { mutableStateOf(TextFieldValue("")) }
...
0
votes
1
answer
35
views
ClickableText composables as a list's elements and use them in lazy column, to list all customers, and when clicked, navigate to other screen
I want to show the list of customer's names in lazy column, so i created a list variable and used clicableText composables inside it, so that each item can be clicked, then i want to use it inside a ...
-1
votes
1
answer
129
views
How do I fix the Text error in Android Studio without creating a function for this? [closed]
When ever I use the Text() function, it shows this error:
None of the following functions can be called with the arguments supplied.
Text(AnnotatedString, Modifier = ..., Color = ..., TextUnit = ..., ...
1
vote
0
answers
89
views
android compose soft keyboard
I am trying to create a fully custom TextField in Android using Jetpack compose
everything is ok with the hardware keyboard but the soft keyboard is not opening
this is how I start:
(with simple code)
...
0
votes
1
answer
79
views
Text composable not updating only in RELEASE build
I've a composable that contains a text composable which displays the a duration string provided in the params of the composable function.
The problem is that the duration string is getting updated ...
0
votes
0
answers
339
views
How to Dynamically Resize the Item Width or the Font Size in the Item in a LazyColumn in Jetpack Compose
I am using a LazyColumn to display the name of a person in a vertical style so that it could be seen amongst the crowd easily.
But I want the font size of the characters in the list to dynamically ...
3
votes
3
answers
317
views
Optional to pass leadingIcon, trailingIcon parameters to own OutlinedTextField
I'm trying to create default parameters via leadingIcon: @Composable () -> Unit= {} or trailingIcon: @Composable (() -> Unit)? = null, but ran into a problem. An empty form is created on the ...
3
votes
1
answer
205
views
wrong keyboard is shown for compose TextField when app comes from background
I am migrating my application from Android to Jetpack Compose and for now i am using ComposeView inside fragments. Inside Login Fragment there is a OutlinedTextField which must accept Phone number ...
0
votes
1
answer
1k
views
I get this error for a Text Composable: "None of the following functions can be called with the arguments supplied"
I get this compile error:
None of the following functions can be called with the arguments supplied
This is my code:
import androidx.compose.foundation.layout.padding
import androidx.compose....
0
votes
3
answers
475
views
password visibility toggle in jetpack compose
I'm trying to implement a visibility toggle in Jetpack Compose, however, the password is visible right after I click the button, even before the authentication.
var isAuthenticated by remember {
...
1
vote
0
answers
542
views
BasicTextField2: Placeholder with Floating Label Behavior jetpack compose
I'm trying to achieve a floating label effect with BasicTextField2 in Jetpack Compose. My goal is to have a placeholder that:
Is initially displayed inside the text field when empty.
Transitions to a ...
0
votes
1
answer
133
views
How to wrap word with previous word if only last word does not fit
I have a text of different sizes it might fit 1-3 lines usually. I am building the text with annotated string and the last two words is always "search everywhere". However, I got a problem I ...
0
votes
1
answer
254
views
Why does my text change color in Jetpack Compose Android App?
I'm developing an app with Jetpack Compose, in the Theme.kt i have imported and overriden the primaryColor as it shows
private val LightColorScheme = lightColorScheme(
primary = Primary
)
Below ...
0
votes
1
answer
68
views
Change background color of clicked sentence in Text
I want to implement a feature where when I click on a specific sentence within this paragraph, the background color of that sentence changes.
I've tried looking into gesture detection and text ...