belongs to Maven artifact com.android.support:support-compat:28.0.0-alpha1
FontsContractCompat.FontRequestCallback
  public
  static
  
  
  class
  FontsContractCompat.FontRequestCallback
  
    extends Object
  
  
  
  
  
  
| java.lang.Object | |
| ↳ | android.support.v4.provider.FontsContractCompat.FontRequestCallback | 
Interface used to receive asynchronously fetched typefaces.
Summary
| Constants | |
|---|---|
| int | FAIL_REASON_FONT_LOAD_ERRORConstant returned by  | 
| int | FAIL_REASON_FONT_NOT_FOUNDConstant returned by  | 
| int | FAIL_REASON_FONT_UNAVAILABLEConstant returned by  | 
| int | FAIL_REASON_MALFORMED_QUERYConstant returned by  | 
| int | FAIL_REASON_PROVIDER_NOT_FOUNDConstant returned by  | 
| int | FAIL_REASON_SECURITY_VIOLATIONConstant that signals that the font was not loaded due to security issues. | 
| int | FAIL_REASON_WRONG_CERTIFICATESConstant returned by  | 
| Public constructors | |
|---|---|
| 
      FontsContractCompat.FontRequestCallback()
       | |
| Public methods | |
|---|---|
| 
        
        
        
        
        
        void | 
      onTypefaceRequestFailed(int reason)
      Called when a Typeface request done via  | 
| 
        
        
        
        
        
        void | 
      onTypefaceRetrieved(Typeface typeface)
      Called then a Typeface request done via  | 
| Inherited methods | |
|---|---|
|  From
class 
  
    java.lang.Object
  
 | |
Constants
FAIL_REASON_FONT_LOAD_ERROR
int FAIL_REASON_FONT_LOAD_ERROR
Constant returned by onTypefaceRequestFailed(int) signaling that the font
 returned by the provider was not loaded properly.
Constant Value: -3 (0xfffffffd)
FAIL_REASON_FONT_NOT_FOUND
int FAIL_REASON_FONT_NOT_FOUND
Constant returned by onTypefaceRequestFailed(int) signaling that the font
 provider did not return any results for the given query.
Constant Value: 1 (0x00000001)
FAIL_REASON_FONT_UNAVAILABLE
int FAIL_REASON_FONT_UNAVAILABLE
Constant returned by onTypefaceRequestFailed(int) signaling that the font
 provider found the queried font, but it is currently unavailable.
Constant Value: 2 (0x00000002)
FAIL_REASON_MALFORMED_QUERY
int FAIL_REASON_MALFORMED_QUERY
Constant returned by onTypefaceRequestFailed(int) signaling that the given
 query was not supported by the provider.
Constant Value: 3 (0x00000003)
FAIL_REASON_PROVIDER_NOT_FOUND
int FAIL_REASON_PROVIDER_NOT_FOUND
Constant returned by onTypefaceRequestFailed(int) signaling that the given
 provider was not found on the device.
Constant Value: -1 (0xffffffff)
FAIL_REASON_SECURITY_VIOLATION
int FAIL_REASON_SECURITY_VIOLATION
Constant that signals that the font was not loaded due to security issues. This usually means the font was attempted to load on a restricted context.
Constant Value: -4 (0xfffffffc)
FAIL_REASON_WRONG_CERTIFICATES
int FAIL_REASON_WRONG_CERTIFICATES
Constant returned by onTypefaceRequestFailed(int) signaling that the given
 provider must be authenticated and the given certificates do not match its signature.
Constant Value: -2 (0xfffffffe)
Public constructors
FontsContractCompat.FontRequestCallback
FontsContractCompat.FontRequestCallback ()
Public methods
onTypefaceRequestFailed
void onTypefaceRequestFailed (int reason)
Called when a Typeface request done via requestFont(Context, FontRequest, FontRequestCallback, Handler) fails.
| Parameters | |
|---|---|
| reason | int: May be one ofFAIL_REASON_PROVIDER_NOT_FOUND,FAIL_REASON_FONT_NOT_FOUND,FAIL_REASON_FONT_LOAD_ERROR,FAIL_REASON_FONT_UNAVAILABLE,FAIL_REASON_MALFORMED_QUERYorFAIL_REASON_WRONG_CERTIFICATES, or a provider defined positive
               code number. | 
onTypefaceRetrieved
void onTypefaceRetrieved (Typeface typeface)
Called then a Typeface request done via requestFont(Context, FontRequest, FontRequestCallback, Handler) is complete. Note that this method will not be called if
 onTypefaceRequestFailed(int) is called instead.
| Parameters | |
|---|---|
| typeface | Typeface: The Typeface object retrieved. | 
