com.bumptech.glide.ListPreloader.PreloadModelProvider Java Examples

The following examples show how to use com.bumptech.glide.ListPreloader.PreloadModelProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RecyclerViewPreloader.java    From FastAndroid with Apache License 2.0 5 votes vote down vote up
/**
 * Helper constructor that accepts an {@link AppCompatActivity}.
 */
public RecyclerViewPreloader(AppCompatActivity activity,
                             PreloadModelProvider<T> preloadModelProvider,
                             PreloadSizeProvider<T> preloadDimensionProvider,
                             int maxPreload) {

    this(Glide.with(activity), preloadModelProvider, preloadDimensionProvider, maxPreload);
}
 
Example #2
Source File: RecyclerViewPreloader.java    From FastAndroid with Apache License 2.0 5 votes vote down vote up
/**
 * Helper constructor that accepts an {@link Fragment}.
 */
public RecyclerViewPreloader(Fragment fragment,
                             PreloadModelProvider<T> preloadModelProvider,
                             PreloadSizeProvider<T> preloadDimensionProvider,
                             int maxPreload) {

    this(Glide.with(fragment), preloadModelProvider, preloadDimensionProvider, maxPreload);
}
 
Example #3
Source File: RecyclerViewPreloader.java    From FastAndroid with Apache License 2.0 5 votes vote down vote up
/**
 * Constructor that accepts interfaces for providing the dimensions of images to preload, the list
 * of models to preload for a given position, and the request to use to load images.
 *
 * @param preloadModelProvider     Provides models to load and requests capable of loading them.
 * @param preloadDimensionProvider Provides the dimensions of images to load.
 * @param maxPreload               Maximum number of items to preload.
 */
public RecyclerViewPreloader(RequestManager requestManager,
                             PreloadModelProvider<T> preloadModelProvider,
                             PreloadSizeProvider<T> preloadDimensionProvider,
                             int maxPreload) {

    ListPreloader<T> listPreloader = new ListPreloader<>(requestManager,
            preloadModelProvider,
            preloadDimensionProvider,
            maxPreload);

    recyclerScrollListener = new RecyclerToListViewScrollListener(listPreloader);
}
 
Example #4
Source File: RecyclerViewPreloader.java    From AndroidBase with Apache License 2.0 4 votes vote down vote up
/**
 * Helper constructor that accepts an {@link Activity}.
 */
public RecyclerViewPreloader(Activity activity,
    PreloadModelProvider<T> preloadModelProvider,
    PreloadSizeProvider<T> preloadDimensionProvider, int maxPreload) {
  this(Glide.with(activity), preloadModelProvider, preloadDimensionProvider, maxPreload);
}
 
Example #5
Source File: RecyclerViewPreloader.java    From AndroidBase with Apache License 2.0 4 votes vote down vote up
/**
 * Helper constructor that accepts an {@link FragmentActivity}.
 */
public RecyclerViewPreloader(FragmentActivity fragmentActivity,
    PreloadModelProvider<T> preloadModelProvider, PreloadSizeProvider<T> preloadDimensionProvider,
    int maxPreload) {
  this(Glide.with(fragmentActivity), preloadModelProvider, preloadDimensionProvider, maxPreload);
}
 
Example #6
Source File: RecyclerViewPreloader.java    From AndroidBase with Apache License 2.0 4 votes vote down vote up
/**
 * Helper constructor that accepts an {@link Fragment}.
 */
public RecyclerViewPreloader(Fragment fragment,
    PreloadModelProvider<T> preloadModelProvider, PreloadSizeProvider<T> preloadDimensionProvider,
    int maxPreload) {
  this(Glide.with(fragment), preloadModelProvider, preloadDimensionProvider, maxPreload);
}
 
Example #7
Source File: RecyclerViewPreloader.java    From AndroidBase with Apache License 2.0 4 votes vote down vote up
/**
 * Helper constructor that accepts an {@link android.support.v4.app.Fragment}.
 */
public RecyclerViewPreloader(android.support.v4.app.Fragment fragment,
    PreloadModelProvider<T> preloadModelProvider, PreloadSizeProvider<T> preloadDimensionProvider,
    int maxPreload) {
  this(Glide.with(fragment), preloadModelProvider, preloadDimensionProvider, maxPreload);
}
 
Example #8
Source File: RecyclerViewPreloader.java    From AndroidBase with Apache License 2.0 3 votes vote down vote up
/**
 * Constructor that accepts interfaces for providing the dimensions of images to preload, the list
 * of models to preload for a given position, and the request to use to load images.
 *
 * @param preloadModelProvider     Provides models to load and requests capable of loading them.
 * @param preloadDimensionProvider Provides the dimensions of images to load.
 * @param maxPreload               Maximum number of items to preload.
 */
public RecyclerViewPreloader(RequestManager requestManager,
    PreloadModelProvider<T> preloadModelProvider,
    PreloadSizeProvider<T> preloadDimensionProvider, int maxPreload) {
  ListPreloader<T> listPreloader = new ListPreloader<>(preloadModelProvider,
      preloadDimensionProvider, maxPreload);
  recyclerScrollListener = new RecyclerToListViewScrollListener(listPreloader);
}