RequestCoordinator

interface RequestCoordinator

An interface for coordinating multiple requests with the same .

To avoid deadlock, implemenations must not call into individual Requests to determine their state (ie do not call isCleared or isRunning etc). Instead use RequestState and the various methods available on this interface and Request to track states manually.

Types

Link copied to clipboard
enum RequestState
A simple state enum to keep track of the states of individual subrequests.

Functions

Link copied to clipboard
abstract fun canNotifyCleared(request: Request): Boolean
Returns true if the Request can clear the .
Link copied to clipboard
abstract fun canNotifyStatusChanged(request: Request): Boolean
Returns true if the Request can display a placeholder.
Link copied to clipboard
abstract fun canSetImage(request: Request): Boolean
Returns true if the Request can display a loaded bitmap.
Link copied to clipboard
abstract fun getRoot(): RequestCoordinator
Returns the top most parent RequestCoordinator.
Link copied to clipboard
abstract fun isAnyResourceSet(): Boolean
Returns true if any coordinated Request has successfully completed.
Link copied to clipboard
abstract fun onRequestFailed(request: Request)
Must be called when a Request coordinated by this object fails.
Link copied to clipboard
abstract fun onRequestSuccess(request: Request)
Must be called when a Request coordinated by this object completes successfully.

Inheritors

Link copied to clipboard
Link copied to clipboard