Spannable.Factory

  • Spannable.Factory is used by TextView to create new Spannables, offering the ability to create custom Spannable implementations.

  • It provides a method newSpannable to generate a new SpannableString from a given CharSequence, which can be overridden for custom Spannable types.

  • Developers can get the standard Spannable.Factory instance using the static getInstance method.

public static class Spannable.Factory extends Object

Factory used by TextView to create new Spannables. You can subclass it to provide something other than SpannableString.

Public Constructor Summary

Public Method Summary

static Spannable.Factory
getInstance()
Returns the standard Spannable Factory.
Spannable
newSpannable(CharSequence source)
Returns a new SpannableString from the specified CharSequence.

Inherited Method Summary

Public Constructors

public Factory ()

Public Methods

public static Spannable.Factory getInstance ()

Returns the standard Spannable Factory.

public Spannable newSpannable (CharSequence source)

Returns a new SpannableString from the specified CharSequence. You can override this to provide a different kind of Spannable.

Parameters
source