create

fun create(context: Context, appearance: Int, colorList: Int, executor: Executor, onComplete: Runnable): TextAppearanceSpanCompat

Creates a TextAppearanceSpanCompat.

The android:fontFamily may need to fetched asynchronously. The returned TextAppearanceSpanCompat may not immediately reflect the custom font, but it will be updated once the font is fetched. The provided callback will not be executed if the asynchronous fetch is not needed.

Return

A TextAppearanceSpanCompat.

Parameters

context

The context to use.

appearance

The resource ID of a TextAppearance style.

colorList

The resource ID of a ColorStateList.

executor

The executor to use for fetching the font.

onComplete

A runnable to be executed when the font fetching is complete. This runnable will be executed on the executor's thread. The client is responsible for invalidating the text layout if necessary.