Questions tagged [spannable]

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

302 questions
0
votes
2 answers

textview underline(secondary text)

How to create a secondary line(underline) in TextView? For example line1: |word1 word2 word3 word4| //size17 | word2 description | //size 6 line2: |word4 word5 word6 word7 | //size17 | …
sergii.gudym
  • 163
  • 1
  • 13
0
votes
0 answers

updateDrawState(TextPaint tp) stuck in an infinite loop on certain devices

I am using an alpha interpolation on a custom CharacterStyle by setting an alpha value mAlpha and then updating the color in updateDrawState(TextPaint tp). I'm running into an issue on newer Android devices, specifically devices running API 23 don't…
AndyRoid
  • 5,062
  • 8
  • 38
  • 73
0
votes
1 answer

Building a custom span that occupies the full width of the container

I need to create a custom Span that renders its content like source code. Here's an example of what I am trying to achieve. Let's say we have the following text, where I have annotated the start and end of the custom span using square brackets: Some…
Elias Mårtenson
  • 3,820
  • 23
  • 32
0
votes
0 answers

Android override UnderlineSpan() to overline instead of underline

I am new to Android, I have this piece of code that underlines a SpannableString. I want to modify the object UnderlineSpan() so that it overlines the Spannablestring instead of underlining it. So basically I want it to make the line over the string…
0
votes
4 answers

Create a TextView link in Android

I've the following convenience method: public static void createLink(TextView textView, String linkText, String linkHRef) { String htmlLink = "%s"; Spanned spanned = Html.fromHtml(String.format(htmlLink, linkHRef,…
Androidian
  • 1,035
  • 1
  • 16
  • 40
0
votes
0 answers

How does removeSpan() work?

Pardon me if I'm asking a dumb question but I would like to know how removeSpan() work without parameters start and end? How does it know the range of the text??? setSpan() has parameters start and end but removeSpan() does not.
davick
  • 1
0
votes
3 answers

How to display words of different sizes, such as Office or function of Google Docs in Android

I try to do like the Office or Google Docs can enter a different word sizes this feature Here is my code input =(EditText)findViewById(R.id.Input_EditText); input.addTextChangedListener(new TextWatcher() { public void…
Ban Lin
  • 95
  • 2
  • 10
0
votes
1 answer

Change typeface on the fly spannable editText

I have a button: if (id == R.id.italic) { } Inside that button I have a spannable: int startSelection = noteContent.getSelectionStart() int endSelection = noteContent.getSelectionEnd(); Spannable spannable = noteContent.getText(); When the user…
Jordan
  • 407
  • 5
  • 20
0
votes
0 answers

edit text Typeface android

I want to change the Text style on a button click. When the user clicks the button it makes the selected area italic. When the user clicks it again I want the selected area to become non italic. How is this possible. This is my code: if (id…
Jordan
  • 407
  • 5
  • 20
0
votes
1 answer

Toggle edit text Typeface

Hello Everyone I am making an app where the user can italicize spannable text on a button click. // Captures Contextual Menu Clicks// public void onContextualMenuItemClicked(MenuItem item) { int id = item.getItemId(); if (id == R.id.bold)…
Jordan
  • 407
  • 5
  • 20
0
votes
1 answer

how to add padding,stroke and radius to custom text with spannable

How can I add padding,corner and stroke to spannable text. The code below sets the backgroundcolorspan and custom font.I really appreciate any help. public class CustomTextView extends TextView { public CustomTextView(Context…
jason
  • 3,932
  • 11
  • 52
  • 123
0
votes
0 answers

Is there any way to insert a text with different style in a TextView?

Is there any way to do what is shown in the design? I mean, have some text at the beginning of the TextView with a different style and the rest of text aligned to the left. I have tried with this, but no luck. SpannableString text = new…
David
  • 901
  • 1
  • 13
  • 37
0
votes
1 answer

Making text bold on a listview to a specify word dynamically

I am trying to put color and bold up on a word that matches the word from a sentence in ArrayList items/value. what I have done so far is as below... so I have a String variable called filter "Hello" now I want to iterate through ArrayList itemList…
Jack
  • 151
  • 1
  • 4
  • 21
0
votes
4 answers

Searching in Listview with searched textcolor highlighted in Listview Android

I Have a listview with arrayadapter .. i need to implement this in my music application ... help me out public class Search_Class extends Activity { EditText searchedit; ListView listview3; SongsManager songManager; …
Quick learner
  • 10,632
  • 4
  • 45
  • 55
0
votes
1 answer

How can I ignore the underlines Android adds while I'm editing formatted text?

I'm adding a rich-text editing field to my app. I'm using a standard EditText field, and I've added a toolbar with some editing buttons that apply spans to the selected text. This part works fine. When I change the text selection by tapping…
arlomedia
  • 8,534
  • 5
  • 60
  • 108