I want to make some works typed inside BasicTextField highlighted to appear like a mention.
But I don't have any glue to make, especially with this bug that is still not fixed
https://issuetracker.google.com/issues/199768107?pli=1
Any ideas, please ?
I am trying to create a single line text input in Jetpack Compose.
Since this input should have a fix width of 200.dp and is only one line, longer text is going to be cut off. Sometimes it looks like the cut off text does not even exist because the cut is made between two letters. In order to show the user that there is "more" text already typed I would prefer an ellipsis (e.g. This is a sample inpu...) effect.
I tried to use the default TextField and BasicTextField composables but there seems to be no easy solution.
Is there a way to create this ellipsis effect in Jetpack Compose?
What is the best approach in Jetpack Compose when I want text to be completely editable but also want some parts of it to be clickable?
I could use TextField. But is there a way to make some parts of it clickable? And furthermore I would also like to style the text by using AnnotatedString.
I could use ClickableText and make it somewhat editable. But I would also like to select some text while editing. This seems to be harder, on the first glance.
Or should I use none of them?
Currently, when the SeekBar is selected it says "%d percent, <content description>, Seek Control" and then "Use volume keys to adjust...", which is the default TalkBack for this SeekBar, but in my case, this is useless information, since the SeekBar moves in steps, for example, it can slide to option A, or option B or option C.
What I want is when the SeekBar is selected, TalkBar should read the content description only, or even better, just remove the "%d percent".
I'm trying to modify the default TalkBack in a custom SeekBar Inheriting from androidx.appcompat.widget.AppCompatSeekBar but nothing that I've tried worked.
I've tried:
reading the accessibility documentation for custom views but changing the event text did nothing: Make custom views more accessible.
I tried to change the event.text.add("custom text") in all possible API methods. Also tried to use event.clear() before adding new text and to change the event.beforeText. Nothing worked
this solution, but when I select the SeekBar it reads nothing. I'm guessing is because we are ignoring the TYPE_VIEW_ACCESSIBILITY_FOCUSED event: https://stackoverflow.com/a/64703579/10173087.
This was a close one but didn't work because when the SeekBar is selected I need it to read something.
this solution, but I don't think there is an action to modify the SeekBar label, as we have here on the button: https://stackoverflow.com/a/41496367
Might not be 100% relevant because this is the solution for a compose component, but you can remove the percent readout by changing the stateDescription
modifier = Modifier
.semantics {
stateDescription = [your state]
}
I'm new to android development.Basically my question is how do I change the padding within a spinner so that the text is more compact and can therefore fit more values on the screen.
I have thought about using a slider, however I because there is such a wide range the value could be (1-20000) I wanted to enforce some restriction so selected lower numbers is easier.
Any tips would be great.
You can write s custom Spinner Adapter and override getView to write your own view. I had written some sample code for another similar question which might help.