Questions tagged [spannable]

An Android Spannable is an interface for text to which markup objects can be applied.

302 questions
0
votes
1 answer

Using MultiAutoCompleteTextview which stores ids

In my app, I want to use a MultiAutoCompleteTextview to get an effect like Facebook mentioning. After I type '@', I want to get a dropdown list from which to select a person. This will show the person's name in the MACTextView. "Went to the cinema…
Jesse Bakker
  • 2,403
  • 13
  • 25
0
votes
1 answer

Android scrollview jumps back on top instead of bottom

I have a little problem with my first android app: I made a ScrollView which contains a TextView. The ScrollView should scroll to the end of the TextView (so to the bottom of the ScrollView) everytime I press a button, so the actual added text is in…
dabo248
  • 3,367
  • 4
  • 27
  • 37
0
votes
1 answer

Multiple spans in same String

I've got problems to set StyleSpan and ForegroundColorSpan in the same string. Here's my code: SpannableStringBuilder text_1_2 = new SpannableStringBuilder(getString(R.string.why_text_1_2)); StyleSpan bss = new…
Tofasio
  • 425
  • 3
  • 14
0
votes
1 answer

Android: Compare words based on position and using spannable

I have a code here that changes the color of a word from a sentence. Violet if the word found is of the same position. Yellow if the answer contains a word but of a different position and red if the word is not found. My problem right now is that…
Mark
  • 45
  • 6
0
votes
0 answers

How can i add numbered list in edit-text

How can i add numbered list for particular line when i press button. I want to try Bullet and Numbered list both, somehow i have completed with Bullet span but i am not getting how to implement Numbered listing in android. Can any one suggest me how…
InnocentKiller
  • 5,234
  • 7
  • 36
  • 84
0
votes
1 answer

Android - Store Spans in SQLiteDatabase

I'm making an app in which I'm using Spannble class to create a highlighter mechanism in an EditText, which works fine. Now, I want to store the span position(s) in a SQLiteDatabase, so that I can reload them and have the Spanned Text to show it in…
Swap
  • 480
  • 2
  • 7
  • 21
0
votes
1 answer

Spannable array from string resource

Is there a way to extract a Spannable[] stuff from string resource? Basically something similar to Welcome to Mercury
Katedral Pillon
  • 14,534
  • 25
  • 99
  • 199
0
votes
1 answer

Alternate coloring of each character of a string with setSpan() not coloring correctly Android?

I'm trying to do an alternate coloring of each character of an input string using SpannableString's setSpan(), but somehow the outputted string is not colored properly. //ColorLogic.java: public SpannableString colorString(String myStr) { …
jerryh91
  • 1,777
  • 10
  • 46
  • 77
0
votes
1 answer

Inconsistent SpannableString setSpan() coloring?

I'm trying to color only vowels in my String 1 color (ex red), and non-vowels another (ex: blue). But the SpannableString setSpan() method is being inconsistent when iterating thru each char. The function is detecting the vows and non-vows…
jerryh91
  • 1,777
  • 10
  • 46
  • 77
0
votes
1 answer

How to set bulletspan to a string in edittext at a leading margin?

I have a edittext and some buttons like bold italics underline bullets. Now when i select some text and press any button then using spannable string i am applying that particular span to that portion of the edittext like bold italics underline…
Rahul Gupta
  • 5,275
  • 8
  • 35
  • 66
0
votes
1 answer

Android - How to parse Textview and add Spannables on certain characters?

I am developing a Calculator app and I want to display symbols like + - / * etc on a different color. Im using a TextView as my display. I was able to do it when the buttons are being pressed with a code like this coloredOperator = "
Cruclax
  • 394
  • 3
  • 13
0
votes
0 answers

How to get spans from a text file on sd card on Android?

i have written a code where i get the number of spans in an Edittext like bold italics or underline. Now i am getting a text file with something written in it in bold characters and using BufferedReader i am getting the contents of that file. Is it…
Rahul Gupta
  • 5,275
  • 8
  • 35
  • 66
0
votes
2 answers

Html.toHtml() doesn't convert RelativeSizeSpan 'ed Text

Here is what i am trying to do, SpannableString s = new SpannableString("Shiva"); s.setSpan(new RelativeSizeSpan(2f), 0, 5, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); editText.setText(s, TextView.BufferType.SPANNABLE); And on a Click event, i…
Sivakumar S
  • 681
  • 5
  • 19
0
votes
3 answers

Change color font only in part of textview

i want to change only a part of textview color.. I've tried in this way but nothing change TextView textView = (TextView)findViewById(R.id.Temperature); textView.setText("Temperature: "+ " " + temperature +…
David_D
  • 1,404
  • 4
  • 31
  • 65
0
votes
0 answers

Android -Convert large paragraph links to spanURL

Tried online search already. Here is an example of what i am trying to do: text within a textview is: "hey how are you doing check this link: http://www.google.com and if you dont like that link try this link http://yahoo.com or finally try…
j2emanue
  • 60,549
  • 65
  • 286
  • 456