34 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
38
views
Android SDK: Set dashed underline for a word
I've already implemented some spanning using existing ForegroundColorSpan and BackgroundColorSpan. Now, I need to select a word via dashed underline. I googled it up and found an example: How do I ...
0
votes
2
answers
100
views
Checkbox Issue on Android Kotlin
I have a checkbox with link in its text .
When ever I checked the checkbox with touch , it automatically clicks the link also which is present in its text .
I have used spannable text for making part ...
0
votes
1
answer
35
views
How to highlight searched text in result that may contains diacritics chatacter?
I want to show the searched text in the result by highlighting sections that match the searched text. but how to do it if the result text contains diacritics?
for example, I search "رب" in ...
3
votes
0
answers
179
views
How can I draw a zigzag underline on a specific text of an EditText, similar to a spell-check underline?
Description: I want to be able to draw a zigzag line span on a text with a given start and end position of an EditText in Android. I have tried using a custom ReplacementSpan class to draw the zigzag ...
0
votes
1
answer
186
views
Android. How to get substring from Spannable which was clicked?
I have html string:
htmlString = "This is a <a href=\"https://translate.google.com/\">link</a> and another link <a href=\"https://google.com/\">link2</a&...
0
votes
1
answer
264
views
Android. How to make clickable html string?
I have html string. I need to show my it in my TextView. Here is my code:
tvText.setText(Html.fromHtml(htmlString));
Html string contains some text, but may also contains links. I need to detect if a ...
0
votes
1
answer
47
views
How can I block EditText layout reflow when adding spans?
I am trying to batch-add several thousand spans to a SpannableStringBuilder in an EditText (obtained via getText()).
This is slower than I would like. Profiling has shown that the vast majority of the ...
0
votes
1
answer
338
views
Android BackgroundColorSpan breaking with lineSpacing less than 1
I have got a textView to which I do this:
textView.setLineSpacing(1f, .70f);
and then I would like to set a background color only to specific words in that textView so I've tried this:
...
1
vote
1
answer
105
views
How to Save ImageSpan with text into SQL Lite Database?
I have implemented image in EditEtxt. Its working fine. I want to save the whole editText entities(Text & image) in sql lite database. When i save it to sql only text are showing not images. I ...
1
vote
1
answer
95
views
not able to apply span to first letter in a word
I am working on an animation that involves setting OutlineSpan to individual letter in a word .
However when i apply the OutlineSpan to first letter its not reflecting
val string = "f"
val ...
0
votes
0
answers
846
views
Android. Unit testing for SpannableString
For testing my business logic I'm using mockk library. But I also have a few helper classes that contain methods that use SpannableString, ForegroundColorSpan etc. I need to write tests for these ...
3
votes
1
answer
1k
views
ReplacementSpan - "chips" across lines
I'm using a custom replacement span to draw a background around particular words (adds padding around the words, words are identified by surrounding symbols, much like an HTML tag), and to even change ...
2
votes
0
answers
207
views
Disable darkmode for textColor edittext
disabled the dark mode for the application with
<item name="android:forceDarkAllowed">false</item>
But in the input in the case, when you need to remove Span, the textСolor is ...
0
votes
1
answer
50
views
How to add horizontal spacing between two Spannables?
I have a custom TextView that combines two pieces of text and have a spacing variable.
class MyCustomTextView() {
var label: String
var value: String
var spacingBetweenLabelAndValue: Int = 0
...
1
vote
5
answers
10k
views
Kotlin set two different text styles to dynamically changing text in a text view using SpannableString
I have a text view with a value that can change. For example, it's Pressure. It can have different length - i.e. 999.1 or 1010.2 hPa.
The text looks like this:
I need to set different text styles for ...