public abstract class

ResourcesCompat.FontCallback

extends java.lang.Object

 java.lang.Object

↳androidx.core.content.res.ResourcesCompat.FontCallback

Overview

Interface used to receive asynchronous font fetching events.

Summary

Constructors
publicFontCallback()

Methods
public final voidcallbackFailAsync(int reason, Handler handler)

Call ResourcesCompat.FontCallback.onFontRetrievalFailed(int) on the handler given, or the Ui Thread if it is null.

public final voidcallbackSuccessAsync(Typeface typeface, Handler handler)

Call ResourcesCompat.FontCallback.onFontRetrieved(Typeface) on the handler given, or the Ui Thread if it is null.

public static HandlergetHandler(Handler handler)

public abstract voidonFontRetrievalFailed(int reason)

Called when an asynchronous font failed to load.

public abstract voidonFontRetrieved(Typeface typeface)

Called when an asynchronous font was finished loading.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public FontCallback()

Methods

public abstract void onFontRetrieved(Typeface typeface)

Called when an asynchronous font was finished loading.

Parameters:

typeface: The font that was loaded.

public abstract void onFontRetrievalFailed(int reason)

Called when an asynchronous font failed to load.

Parameters:

reason: The reason the font failed to load. One of FontsContractCompat.FontRequestCallback.FAIL_REASON_PROVIDER_NOT_FOUND, FontsContractCompat.FontRequestCallback.FAIL_REASON_WRONG_CERTIFICATES, FontsContractCompat.FontRequestCallback.FAIL_REASON_FONT_LOAD_ERROR, FontsContractCompat.FontRequestCallback.FAIL_REASON_SECURITY_VIOLATION, FontsContractCompat.FontRequestCallback.FAIL_REASON_FONT_NOT_FOUND, FontsContractCompat.FontRequestCallback.FAIL_REASON_FONT_UNAVAILABLE or FontsContractCompat.FontRequestCallback.FAIL_REASON_MALFORMED_QUERY.

public final void callbackSuccessAsync(Typeface typeface, Handler handler)

Call ResourcesCompat.FontCallback.onFontRetrieved(Typeface) on the handler given, or the Ui Thread if it is null.

public final void callbackFailAsync(int reason, Handler handler)

Call ResourcesCompat.FontCallback.onFontRetrievalFailed(int) on the handler given, or the Ui Thread if it is null.

public static Handler getHandler(Handler handler)