DataSourceBitmapLoader.Builder


public final class DataSourceBitmapLoader.Builder


A builder for DataSourceBitmapLoader instances.

Summary

Public constructors

Builder(Context context)

Creates a builder.

Public methods

DataSourceBitmapLoader

Builds a DataSourceBitmapLoader.

DataSourceBitmapLoader.Builder

Sets the BitmapFactory.Options to be used for decoding bitmaps.

DataSourceBitmapLoader.Builder

Sets the DataSource.Factory to be used to create DataSource instances for loading bitmaps.

DataSourceBitmapLoader.Builder

Sets the ListeningExecutorService to be used for loading bitmaps.

DataSourceBitmapLoader.Builder
@CanIgnoreReturnValue
setMakeShared(boolean makeShared)

Sets whether the Bitmap should be converted to an immutable, sharable instance that is most efficient for repeated transfer over binder interfaces.

DataSourceBitmapLoader.Builder
@CanIgnoreReturnValue
setMaximumOutputDimension(int maximumOutputDimension)

Sets the maximum output dimension for decoded bitmaps.

Public constructors

Builder

public Builder(Context context)

Creates a builder.

Parameters
Context context

The context.

Public methods

setBitmapFactoryOptions

@CanIgnoreReturnValue
public DataSourceBitmapLoader.Builder setBitmapFactoryOptions(@Nullable BitmapFactory.Options options)

Sets the BitmapFactory.Options to be used for decoding bitmaps.

Returns
DataSourceBitmapLoader.Builder

This builder.

setDataSourceFactory

@CanIgnoreReturnValue
public DataSourceBitmapLoader.Builder setDataSourceFactory(DataSource.Factory dataSourceFactory)

Sets the DataSource.Factory to be used to create DataSource instances for loading bitmaps.

If not set, a DefaultDataSource.Factory will be used.

Parameters
DataSource.Factory dataSourceFactory

A DataSource.Factory.

Returns
DataSourceBitmapLoader.Builder

This builder.

setExecutorService

@CanIgnoreReturnValue
public DataSourceBitmapLoader.Builder setExecutorService(ListeningExecutorService listeningExecutorService)

Sets the ListeningExecutorService to be used for loading bitmaps.

If not set, DEFAULT_EXECUTOR_SERVICE will be used.

Parameters
ListeningExecutorService listeningExecutorService

A ListeningExecutorService.

Returns
DataSourceBitmapLoader.Builder

This builder.

setMakeShared

@CanIgnoreReturnValue
public DataSourceBitmapLoader.Builder setMakeShared(boolean makeShared)

Sets whether the Bitmap should be converted to an immutable, sharable instance that is most efficient for repeated transfer over binder interfaces.

Parameters
boolean makeShared

Whether to make the Bitmap shared.

Returns
DataSourceBitmapLoader.Builder

This builder.

See also
makeShared

setMaximumOutputDimension

@CanIgnoreReturnValue
public DataSourceBitmapLoader.Builder setMaximumOutputDimension(int maximumOutputDimension)

Sets the maximum output dimension for decoded bitmaps.

Parameters
int maximumOutputDimension

The maximum output dimension in pixels.

Returns
DataSourceBitmapLoader.Builder

This builder.