com.bumptech.glide.util
Class FixedPreloadSizeProvider<T>

java.lang.Object
  extended by com.bumptech.glide.util.FixedPreloadSizeProvider<T>
Type Parameters:
T - The type of the model the size should be provided for.
All Implemented Interfaces:
ListPreloader.PreloadSizeProvider<T>

public class FixedPreloadSizeProvider<T>
extends Object
implements ListPreloader.PreloadSizeProvider<T>

A ListPreloader.PreloadSizeProvider with a fixed width and height.


Constructor Summary
FixedPreloadSizeProvider(int width, int height)
          Constructor for a PreloadSizeProvider with a fixed size.
 
Method Summary
 int[] getPreloadSize(T item, int adapterPosition, int itemPosition)
          Returns the size of the view in the list where the resources will be displayed in pixels in the format [x, y], or null if no size is currently available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedPreloadSizeProvider

public FixedPreloadSizeProvider(int width,
                                int height)
Constructor for a PreloadSizeProvider with a fixed size.

Parameters:
width - The width of the preload size in pixels.
height - The height of the preload size in pixels.
Method Detail

getPreloadSize

public int[] getPreloadSize(T item,
                            int adapterPosition,
                            int itemPosition)
Description copied from interface: ListPreloader.PreloadSizeProvider
Returns the size of the view in the list where the resources will be displayed in pixels in the format [x, y], or null if no size is currently available.

Note - The dimensions returned here must precisely match those of the view in the list.

Specified by:
getPreloadSize in interface ListPreloader.PreloadSizeProvider<T>
Parameters:
item - A model