DisplayHashResultCallback
interface DisplayHashResultCallback
android.view.displayhash.DisplayHashResultCallback |
Use when calling View#generateDisplayHash(String, Rect, Executor,
. The callback will only invoke either onDisplayHashResult
when the system successfully generated the DisplayHash
or onDisplayHashError(int)
when it failed.
Summary
Constants | |
---|---|
static Int |
The bounds used when requesting the hash hash were invalid or empty. |
static Int |
The hash algorithm sent to generate the hash was invalid. |
static Int |
The window for the view that requested the hash is no longer around. |
static Int |
The view that requested the hash is not visible on screen. |
static Int |
The caller requested to generate the hash too frequently. |
static Int |
An unknown error occurred. |
Public methods | |
---|---|
abstract Unit |
onDisplayHashError(errorCode: Int) Callback invoked when |
abstract Unit |
onDisplayHashResult(displayHash: DisplayHash) Callback invoked when calling |
Constants
DISPLAY_HASH_ERROR_INVALID_BOUNDS
static val DISPLAY_HASH_ERROR_INVALID_BOUNDS: Int
The bounds used when requesting the hash hash were invalid or empty.
Value: -2
DISPLAY_HASH_ERROR_INVALID_HASH_ALGORITHM
static val DISPLAY_HASH_ERROR_INVALID_HASH_ALGORITHM: Int
The hash algorithm sent to generate the hash was invalid. This means the value is not one of the supported values in DisplayHashManager#getSupportedHashAlgorithms()
Value: -5
DISPLAY_HASH_ERROR_MISSING_WINDOW
static val DISPLAY_HASH_ERROR_MISSING_WINDOW: Int
The window for the view that requested the hash is no longer around. This can happen if the window is getting torn down.
Value: -3
DISPLAY_HASH_ERROR_NOT_VISIBLE_ON_SCREEN
static val DISPLAY_HASH_ERROR_NOT_VISIBLE_ON_SCREEN: Int
The view that requested the hash is not visible on screen. This could either mean that the view bounds are offscreen, window bounds are offscreen, view is not visible, or window is not visible.
Value: -4
DISPLAY_HASH_ERROR_TOO_MANY_REQUESTS
static val DISPLAY_HASH_ERROR_TOO_MANY_REQUESTS: Int
The caller requested to generate the hash too frequently. The caller should try again at a after some time has passed to ensure the system isn't overloaded.
Value: -6
DISPLAY_HASH_ERROR_UNKNOWN
static val DISPLAY_HASH_ERROR_UNKNOWN: Int
An unknown error occurred.
Value: -1
Public methods
onDisplayHashError
abstract fun onDisplayHashError(errorCode: Int): Unit
Callback invoked when android.view.View#generateDisplayHash(String, Rect, Executor, * DisplayHashResultCallback)
results in an error and cannot generate a display hash.
onDisplayHashResult
abstract fun onDisplayHashResult(displayHash: DisplayHash): Unit
Callback invoked when calling android.view.View#generateDisplayHash(String, Rect, Executor, * DisplayHashResultCallback)
Parameters | |
---|---|
displayHash |
DisplayHash: The DisplayHash generated. If the hash cannot be generated, onDisplayHashError(int) will be called instead This value cannot be null . |