Code example for TextAppearanceSpan

0
  } 
 
  private Spannable getCrewAppearanceString(List<CrewAppearance> appearances) {
    String source = TextUtils.join("\n", appearances);
    SpannableString spanned = new SpannableString(source);
    spanned.setSpan(new TextAppearanceSpan(getActivity(), R.style.TextAppearance_Credits_Gold), 0,
        source.length(), 0);
    return spanned;
  } 
 
  private Spannable getCastAppearanceString(List<CastAppearance> appearances) {
    SpannableStringBuilder sb = new SpannableStringBuilder();
    for (CastAppearance castAppearance : appearances) {
      String actor = castAppearance.getName();
      SpannableString actorSpanned = new SpannableString(actor);
      actorSpanned.setSpan(new TextAppearanceSpan(getActivity(),
          R.style.TextAppearance_Credits_Gold), 0, actor.length(), 0);
      sb.append(actorSpanned);
 
      sb.append("\n");