Class Overview
Network fetcher that uses OkHttp 3 as a backend.
Summary
[Expand]
Inherited Methods |
From class
com.facebook.imagepipeline.producers.BaseNetworkFetcher
Map<String, String>
|
getExtraMap(FETCH_STATE fetchState, int byteSize)
Gets a map containing extra parameters to pass to the listeners.
|
void
|
onFetchCompletion(FETCH_STATE fetchState, int byteSize)
Called after the fetch completes.
|
boolean
|
shouldPropagate(FETCH_STATE fetchState)
Gets whether the intermediate results should be propagated.
|
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
From interface
com.facebook.imagepipeline.producers.NetworkFetcher
abstract
FETCH_STATE
|
createFetchState(Consumer<EncodedImage> consumer, ProducerContext producerContext)
Creates a new instance of the FetchState -derived object used to store state.
|
abstract
void
|
fetch(FETCH_STATE fetchState, NetworkFetcher.Callback callback)
Initiates the network fetch and informs the producer when a response is received via the
provided callback.
|
abstract
Map<String, String>
|
getExtraMap(FETCH_STATE fetchState, int byteSize)
Gets a map containing extra parameters to pass to the listeners.
|
abstract
void
|
onFetchCompletion(FETCH_STATE fetchState, int byteSize)
Called after the fetch completes.
|
abstract
boolean
|
shouldPropagate(FETCH_STATE fetchState)
Gets whether the intermediate results should be propagated.
|
|
Public Constructors
public
OkHttpNetworkFetcher
(OkHttpClient okHttpClient)
Parameters
okHttpClient |
client to use |
public
OkHttpNetworkFetcher
(Call.Factory callFactory, Executor cancellationExecutor)
Parameters
callFactory |
custom Call.Factory for fetching image from the network |
cancellationExecutor |
executor on which fetching cancellation is performed if
cancellation is requested from the UI Thread
|
public
OkHttpNetworkFetcher
(Call.Factory callFactory, Executor cancellationExecutor, boolean disableOkHttpCache)
Parameters
callFactory |
custom Call.Factory for fetching image from the network |
cancellationExecutor |
executor on which fetching cancellation is performed if
cancellation is requested from the UI Thread |
disableOkHttpCache |
true if network requests should not be cached by OkHttp
|
Public Methods
Gets a map containing extra parameters to pass to the listeners.
Returning map is optional and is useful for instrumentation purposes.
This map won't be modified by the caller.
Parameters
fetchState |
the fetch-specific state |
byteSize |
size of the data in bytes |
Returns
- a map with extra parameters
Called after the fetch completes.
Implementing this method is optional and is useful for instrumentation purposes.
Parameters
fetchState |
the fetch-specific state |
byteSize |
size of the data in bytes
|
Protected Methods