Back to Fresco

BaseNetworkFetcher

docs/javadoc/reference/com/facebook/imagepipeline/producers/BaseNetworkFetcher.html

3.6.023.3 KB
Original Source

Fresco

|

|

Packages | Classes

Interfaces

Classes

Annotations

Packages | Classes

Summary: Ctors | Methods | Inherited Methods | [Expand All]

public abstract class

BaseNetworkFetcher

extends Object
implements NetworkFetcher<FETCH_STATE extends FetchState>

| java.lang.Object | | ↳ | com.facebook.imagepipeline.producers.BaseNetworkFetcher<FETCH_STATE extends com.facebook.imagepipeline.producers.FetchState> |

| Known Direct Subclasses

HttpUrlConnectionNetworkFetcher, OkHttpNetworkFetcher, VolleyNetworkFetcher

| HttpUrlConnectionNetworkFetcher | Network fetcher that uses the simplest Android stack. | | OkHttpNetworkFetcher | Network fetcher that uses OkHttp 3 as a backend. | | VolleyNetworkFetcher | Network fetcher that uses Volley as its backend. |

|

Class Overview

Base class for NetworkFetcher.

Intermediate results are propagated.

{#code getExtraMap} returns null.

Summary

Public Constructors
Public Methods
Map<String, String>
Gets a map containing extra parameters to pass to the listeners.
void
Called after the fetch completes.
boolean
Gets whether the intermediate results should be propagated.

| [Expand] Inherited Methods | | --- | | 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 BaseNetworkFetcher()

Public Methods

public Map<String, String> getExtraMap(FETCH_STATE fetchState, int byteSize)

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

public void onFetchCompletion(FETCH_STATE fetchState, int byteSize)

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 |

public boolean shouldPropagate(FETCH_STATE fetchState)

Gets whether the intermediate results should be propagated.

In addition to the requirements of this method, intermediate results are throttled so that a maximum of one every 100 ms is propagated. This is to conserve CPU and other resources.

Not applicable if progressive rendering is disabled or not supported for this image.

Parameters

| fetchState | the fetch-specific state |

Returns
  • whether the intermediate results should be propagated

+Generated by Doclava. +