Class UnderlineSpan

java.lang.Object
icyllis.modernui.text.style.CharacterStyle
icyllis.modernui.text.style.UnderlineSpan
All Implemented Interfaces:
ParcelableSpan, UpdateAppearance, Parcelable

public class UnderlineSpan extends CharacterStyle implements UpdateAppearance, ParcelableSpan
A span that underlines the text it's attached to.

The span can be used like this:


 SpannableString string = new SpannableString("Text with underline span");
 string.setSpan(new UnderlineSpan(), 10, 19, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
  • Constructor Details

  • Method Details

    • getSpanTypeId

      public int getSpanTypeId()
      Description copied from interface: ParcelableSpan
      Return a special type identifier for this span class.
      Specified by:
      getSpanTypeId in interface ParcelableSpan
    • writeToParcel

      public void writeToParcel(@NonNull Parcel dest, int flags)
      Description copied from interface: Parcelable
      The subclass implements the method to flatten its contents by calling the methods of Parcel for its primitive values.
      Specified by:
      writeToParcel in interface Parcelable
      Parameters:
      dest - the parcel to write the object's data to
      flags - the flags about how the object should be written
    • updateDrawState

      public void updateDrawState(@NonNull TextPaint paint)
      Specified by:
      updateDrawState in class CharacterStyle