432 questions
3
votes
1
answer
113
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?
[...
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
110
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
111
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
1
answer
148
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(), ...
1
vote
1
answer
134
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
1
answer
782
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 ...
0
votes
1
answer
136
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 ...
1
vote
1
answer
407
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 ...
2
votes
1
answer
792
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 ...
0
votes
1
answer
381
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 = ...
0
votes
1
answer
188
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
0
answers
161
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 ...
0
votes
2
answers
347
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
279
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 -...
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.
2
votes
1
answer
621
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 { ...
1
vote
1
answer
264
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
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("")) }
...
-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 = ..., ...
0
votes
1
answer
78
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 ...
3
votes
3
answers
315
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 ...
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....
1
vote
0
answers
538
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
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 ...