Java 类com.bumptech.glide.provider.LoadProvider 实例源码

项目:saarang-iosched    文件:GenericRequestBuilder.java   
GenericRequestBuilder(Context context, ModelType model,
        LoadProvider<ModelType, DataType, ResourceType, TranscodeType> loadProvider,
        Class<TranscodeType> transcodeClass, Glide glide) {
    this.transcodeClass = transcodeClass;
    this.glide = glide;
    this.loadProvider = loadProvider != null ?
            new ChildLoadProvider<ModelType, DataType, ResourceType, TranscodeType>(loadProvider) : null;
    preSkipEncoder = loadProvider != null ? loadProvider.getEncoder() : null;

    if (context == null) {
        throw new NullPointerException("Context can't be null");
    }
    if (model != null && loadProvider == null) {
        throw new NullPointerException("LoadProvider must not be null");
    }
    this.context = context;
    this.model = model;
}
项目:AppDevFestSudeste2015    文件:GenericRequestBuilder.java   
GenericRequestBuilder(Context context, ModelType model,
        LoadProvider<ModelType, DataType, ResourceType, TranscodeType> loadProvider,
        Class<TranscodeType> transcodeClass, Glide glide) {
    this.transcodeClass = transcodeClass;
    this.glide = glide;
    this.loadProvider = loadProvider != null ?
            new ChildLoadProvider<ModelType, DataType, ResourceType, TranscodeType>(loadProvider) : null;
    preSkipEncoder = loadProvider != null ? loadProvider.getEncoder() : null;

    if (context == null) {
        throw new NullPointerException("Context can't be null");
    }
    if (model != null && loadProvider == null) {
        throw new NullPointerException("LoadProvider must not be null");
    }
    this.context = context;
    this.model = model;
}
项目:devfestnorte-app    文件:GenericRequestBuilder.java   
GenericRequestBuilder(Context context, ModelType model,
        LoadProvider<ModelType, DataType, ResourceType, TranscodeType> loadProvider,
        Class<TranscodeType> transcodeClass, Glide glide) {
    this.transcodeClass = transcodeClass;
    this.glide = glide;
    this.loadProvider = loadProvider != null ?
            new ChildLoadProvider<ModelType, DataType, ResourceType, TranscodeType>(loadProvider) : null;
    preSkipEncoder = loadProvider != null ? loadProvider.getEncoder() : null;

    if (context == null) {
        throw new NullPointerException("Context can't be null");
    }
    if (model != null && loadProvider == null) {
        throw new NullPointerException("LoadProvider must not be null");
    }
    this.context = context;
    this.model = model;
}
项目:saarang-iosched    文件:GenericRequestBuilder.java   
GenericRequestBuilder(Context context, ModelType model,
        LoadProvider<ModelType, DataType, ResourceType, TranscodeType> loadProvider,
        Class<TranscodeType> transcodeClass, Glide glide) {
    this.transcodeClass = transcodeClass;
    this.glide = glide;
    this.loadProvider = loadProvider != null ?
            new ChildLoadProvider<ModelType, DataType, ResourceType, TranscodeType>(loadProvider) : null;
    preSkipEncoder = loadProvider != null ? loadProvider.getEncoder() : null;

    if (context == null) {
        throw new NullPointerException("Context can't be null");
    }
    if (model != null && loadProvider == null) {
        throw new NullPointerException("LoadProvider must not be null");
    }
    this.context = context;
    this.model = model;
}
项目:saarang-iosched    文件:GenericTranscodeRequest.java   
private static <A, T, Z, R> LoadProvider<A, T, Z, R> build(Glide glide, ModelLoader<A, T> modelLoader,
        Class<T> dataClass, Class<Z> resourceClass, ResourceTranscoder<Z, R> transcoder) {
    if (transcoder == null) {
        transcoder = UnitTranscoder.get();
    }
    return new FixedLoadProvider<A, T, Z, R>(modelLoader, transcoder,
            glide.buildDataProvider(dataClass, resourceClass));
}
项目:saarang-iosched    文件:GenericRequestBuilder.java   
private <Z> Request buildRequestForDataType(Target<TranscodeType> target,
        LoadProvider<ModelType, Z, ResourceType, TranscodeType> loadProvider, float sizeMultiplier,
        Priority priority, RequestCoordinator requestCoordinator) {
    return new GenericRequest<ModelType, Z, ResourceType, TranscodeType>(loadProvider, model, context, priority,
            target, sizeMultiplier, placeholderDrawable, placeholderId, errorPlaceholder, errorId, requestListener,
            animationId, animation, requestCoordinator, glide.getEngine(), getFinalTransformation(),
            transcodeClass, isCacheable);
}
项目:saarang-iosched    文件:BitmapRequestBuilder.java   
BitmapRequestBuilder(Context context, ModelType model,
        LoadProvider<ModelType, ImageVideoWrapper, Bitmap, TranscodeType> streamLoadProvider,
        Class<TranscodeType> transcodeClass, Glide glide) {
    super(context, model, streamLoadProvider, transcodeClass, glide);
    this.bitmapPool = glide.getBitmapPool();

    imageDecoder = new StreamBitmapDecoder(bitmapPool);
    videoDecoder = new FileDescriptorBitmapDecoder(bitmapPool);
}
项目:AppDevFestSudeste2015    文件:GenericTranscodeRequest.java   
private static <A, T, Z, R> LoadProvider<A, T, Z, R> build(Glide glide, ModelLoader<A, T> modelLoader,
        Class<T> dataClass, Class<Z> resourceClass, ResourceTranscoder<Z, R> transcoder) {
    if (transcoder == null) {
        transcoder = UnitTranscoder.get();
    }
    return new FixedLoadProvider<A, T, Z, R>(modelLoader, transcoder,
            glide.buildDataProvider(dataClass, resourceClass));
}
项目:AppDevFestSudeste2015    文件:GenericRequestBuilder.java   
private <Z> Request buildRequestForDataType(Target<TranscodeType> target,
        LoadProvider<ModelType, Z, ResourceType, TranscodeType> loadProvider, float sizeMultiplier,
        Priority priority, RequestCoordinator requestCoordinator) {
    return new GenericRequest<ModelType, Z, ResourceType, TranscodeType>(loadProvider, model, context, priority,
            target, sizeMultiplier, placeholderDrawable, placeholderId, errorPlaceholder, errorId, requestListener,
            animationId, animation, requestCoordinator, glide.getEngine(), getFinalTransformation(),
            transcodeClass, isCacheable);
}
项目:AppDevFestSudeste2015    文件:BitmapRequestBuilder.java   
BitmapRequestBuilder(Context context, ModelType model,
        LoadProvider<ModelType, ImageVideoWrapper, Bitmap, TranscodeType> streamLoadProvider,
        Class<TranscodeType> transcodeClass, Glide glide) {
    super(context, model, streamLoadProvider, transcodeClass, glide);
    this.bitmapPool = glide.getBitmapPool();

    imageDecoder = new StreamBitmapDecoder(bitmapPool);
    videoDecoder = new FileDescriptorBitmapDecoder(bitmapPool);
}
项目:devfestnorte-app    文件:GenericTranscodeRequest.java   
private static <A, T, Z, R> LoadProvider<A, T, Z, R> build(Glide glide, ModelLoader<A, T> modelLoader,
        Class<T> dataClass, Class<Z> resourceClass, ResourceTranscoder<Z, R> transcoder) {
    if (transcoder == null) {
        transcoder = UnitTranscoder.get();
    }
    return new FixedLoadProvider<A, T, Z, R>(modelLoader, transcoder,
            glide.buildDataProvider(dataClass, resourceClass));
}
项目:devfestnorte-app    文件:GenericRequestBuilder.java   
private <Z> Request buildRequestForDataType(Target<TranscodeType> target,
        LoadProvider<ModelType, Z, ResourceType, TranscodeType> loadProvider, float sizeMultiplier,
        Priority priority, RequestCoordinator requestCoordinator) {
    return new GenericRequest<ModelType, Z, ResourceType, TranscodeType>(loadProvider, model, context, priority,
            target, sizeMultiplier, placeholderDrawable, placeholderId, errorPlaceholder, errorId, requestListener,
            animationId, animation, requestCoordinator, glide.getEngine(), getFinalTransformation(),
            transcodeClass, isCacheable);
}
项目:devfestnorte-app    文件:BitmapRequestBuilder.java   
BitmapRequestBuilder(Context context, ModelType model,
        LoadProvider<ModelType, ImageVideoWrapper, Bitmap, TranscodeType> streamLoadProvider,
        Class<TranscodeType> transcodeClass, Glide glide) {
    super(context, model, streamLoadProvider, transcodeClass, glide);
    this.bitmapPool = glide.getBitmapPool();

    imageDecoder = new StreamBitmapDecoder(bitmapPool);
    videoDecoder = new FileDescriptorBitmapDecoder(bitmapPool);
}
项目:saarang-iosched    文件:GenericTranscodeRequest.java   
private static <A, T, Z, R> LoadProvider<A, T, Z, R> build(Glide glide, ModelLoader<A, T> modelLoader,
        Class<T> dataClass, Class<Z> resourceClass, ResourceTranscoder<Z, R> transcoder) {
    if (transcoder == null) {
        transcoder = UnitTranscoder.get();
    }
    return new FixedLoadProvider<A, T, Z, R>(modelLoader, transcoder,
            glide.buildDataProvider(dataClass, resourceClass));
}
项目:saarang-iosched    文件:GenericRequestBuilder.java   
private <Z> Request buildRequestForDataType(Target<TranscodeType> target,
        LoadProvider<ModelType, Z, ResourceType, TranscodeType> loadProvider, float sizeMultiplier,
        Priority priority, RequestCoordinator requestCoordinator) {
    return new GenericRequest<ModelType, Z, ResourceType, TranscodeType>(loadProvider, model, context, priority,
            target, sizeMultiplier, placeholderDrawable, placeholderId, errorPlaceholder, errorId, requestListener,
            animationId, animation, requestCoordinator, glide.getEngine(), getFinalTransformation(),
            transcodeClass, isCacheable);
}
项目:saarang-iosched    文件:BitmapRequestBuilder.java   
BitmapRequestBuilder(Context context, ModelType model,
        LoadProvider<ModelType, ImageVideoWrapper, Bitmap, TranscodeType> streamLoadProvider,
        Class<TranscodeType> transcodeClass, Glide glide) {
    super(context, model, streamLoadProvider, transcodeClass, glide);
    this.bitmapPool = glide.getBitmapPool();

    imageDecoder = new StreamBitmapDecoder(bitmapPool);
    videoDecoder = new FileDescriptorBitmapDecoder(bitmapPool);
}
项目:saarang-iosched    文件:GenericRequest.java   
public GenericRequest(LoadProvider<A, T, Z, R> loadProvider, A model, Context context, Priority priority,
        Target<R> target, float sizeMultiplier, Drawable placeholderDrawable, int placeholderResourceId,
        Drawable errorDrawable, int errorResourceId, RequestListener<A> requestListener, int animationId,
        Animation animation, RequestCoordinator requestCoordinator, Engine engine,
        Transformation<Z> transformation, Class<R> transcodeClass, boolean isMemoryCacheable) {
    this.loadProvider = loadProvider;
    this.model = model;
    this.context = context;
    this.priority = priority;
    this.target = target;
    this.sizeMultiplier = sizeMultiplier;
    this.placeholderDrawable = placeholderDrawable;
    this.placeholderResourceId = placeholderResourceId;
    this.errorDrawable = errorDrawable;
    this.errorResourceId = errorResourceId;
    this.requestListener = requestListener;
    this.animationId = animationId;
    this.animation = animation;
    this.requestCoordinator = requestCoordinator;
    this.engine = engine;
    this.transformation = transformation;
    this.transcodeClass = transcodeClass;
    this.isMemoryCacheable = isMemoryCacheable;

    // We allow null models by just setting an error drawable. Null models will always have empty providers, we
    // simply skip our sanity checks in that unusual case.
    if (model != null) {
        if (loadProvider.getCacheDecoder() == null) {
            throw new NullPointerException("CacheDecoder must not be null, try .cacheDecoder(ResouceDecoder)");
        }
        if (loadProvider.getSourceDecoder() == null) {
            throw new NullPointerException("SourceDecoder must not be null, try .imageDecoder(ResourceDecoder) " +
                    "and/or .videoDecoder()");
        }
        if (loadProvider.getEncoder() == null) {
            throw new NullPointerException("Encoder must not be null, try .encode(ResourceEncoder)");
        }
        if (loadProvider.getTranscoder() == null) {
            throw new NullPointerException("Transcoder must not be null, try .as(Class, ResourceTranscoder)");
        }
        if (loadProvider.getModelLoader() == null) {
            throw new NullPointerException("ModelLoader must not be null, try .using(ModelLoader)");
        }
    }
}
项目:saarang-iosched    文件:DrawableRequestBuilder.java   
DrawableRequestBuilder(Context context, ModelType model,
        LoadProvider<ModelType, ImageVideoWrapper, GifBitmapWrapper, Drawable> loadProvider, Glide glide) {
    super(context, model, loadProvider, Drawable.class, glide);
    this.context = context;
    this.glide = glide;
}
项目:AppDevFestSudeste2015    文件:GenericRequest.java   
public GenericRequest(LoadProvider<A, T, Z, R> loadProvider, A model, Context context, Priority priority,
        Target<R> target, float sizeMultiplier, Drawable placeholderDrawable, int placeholderResourceId,
        Drawable errorDrawable, int errorResourceId, RequestListener<A> requestListener, int animationId,
        Animation animation, RequestCoordinator requestCoordinator, Engine engine,
        Transformation<Z> transformation, Class<R> transcodeClass, boolean isMemoryCacheable) {
    this.loadProvider = loadProvider;
    this.model = model;
    this.context = context;
    this.priority = priority;
    this.target = target;
    this.sizeMultiplier = sizeMultiplier;
    this.placeholderDrawable = placeholderDrawable;
    this.placeholderResourceId = placeholderResourceId;
    this.errorDrawable = errorDrawable;
    this.errorResourceId = errorResourceId;
    this.requestListener = requestListener;
    this.animationId = animationId;
    this.animation = animation;
    this.requestCoordinator = requestCoordinator;
    this.engine = engine;
    this.transformation = transformation;
    this.transcodeClass = transcodeClass;
    this.isMemoryCacheable = isMemoryCacheable;

    // We allow null models by just setting an error drawable. Null models will always have empty providers, we
    // simply skip our sanity checks in that unusual case.
    if (model != null) {
        if (loadProvider.getCacheDecoder() == null) {
            throw new NullPointerException("CacheDecoder must not be null, try .cacheDecoder(ResouceDecoder)");
        }
        if (loadProvider.getSourceDecoder() == null) {
            throw new NullPointerException("SourceDecoder must not be null, try .imageDecoder(ResourceDecoder) " +
                    "and/or .videoDecoder()");
        }
        if (loadProvider.getEncoder() == null) {
            throw new NullPointerException("Encoder must not be null, try .encode(ResourceEncoder)");
        }
        if (loadProvider.getTranscoder() == null) {
            throw new NullPointerException("Transcoder must not be null, try .as(Class, ResourceTranscoder)");
        }
        if (loadProvider.getModelLoader() == null) {
            throw new NullPointerException("ModelLoader must not be null, try .using(ModelLoader)");
        }
    }
}
项目:AppDevFestSudeste2015    文件:DrawableRequestBuilder.java   
DrawableRequestBuilder(Context context, ModelType model,
        LoadProvider<ModelType, ImageVideoWrapper, GifBitmapWrapper, Drawable> loadProvider, Glide glide) {
    super(context, model, loadProvider, Drawable.class, glide);
    this.context = context;
    this.glide = glide;
}
项目:devfestnorte-app    文件:GenericRequest.java   
public GenericRequest(LoadProvider<A, T, Z, R> loadProvider, A model, Context context, Priority priority,
        Target<R> target, float sizeMultiplier, Drawable placeholderDrawable, int placeholderResourceId,
        Drawable errorDrawable, int errorResourceId, RequestListener<A> requestListener, int animationId,
        Animation animation, RequestCoordinator requestCoordinator, Engine engine,
        Transformation<Z> transformation, Class<R> transcodeClass, boolean isMemoryCacheable) {
    this.loadProvider = loadProvider;
    this.model = model;
    this.context = context;
    this.priority = priority;
    this.target = target;
    this.sizeMultiplier = sizeMultiplier;
    this.placeholderDrawable = placeholderDrawable;
    this.placeholderResourceId = placeholderResourceId;
    this.errorDrawable = errorDrawable;
    this.errorResourceId = errorResourceId;
    this.requestListener = requestListener;
    this.animationId = animationId;
    this.animation = animation;
    this.requestCoordinator = requestCoordinator;
    this.engine = engine;
    this.transformation = transformation;
    this.transcodeClass = transcodeClass;
    this.isMemoryCacheable = isMemoryCacheable;

    // We allow null models by just setting an error drawable. Null models will always have empty providers, we
    // simply skip our sanity checks in that unusual case.
    if (model != null) {
        if (loadProvider.getCacheDecoder() == null) {
            throw new NullPointerException("CacheDecoder must not be null, try .cacheDecoder(ResouceDecoder)");
        }
        if (loadProvider.getSourceDecoder() == null) {
            throw new NullPointerException("SourceDecoder must not be null, try .imageDecoder(ResourceDecoder) " +
                    "and/or .videoDecoder()");
        }
        if (loadProvider.getEncoder() == null) {
            throw new NullPointerException("Encoder must not be null, try .encode(ResourceEncoder)");
        }
        if (loadProvider.getTranscoder() == null) {
            throw new NullPointerException("Transcoder must not be null, try .as(Class, ResourceTranscoder)");
        }
        if (loadProvider.getModelLoader() == null) {
            throw new NullPointerException("ModelLoader must not be null, try .using(ModelLoader)");
        }
    }
}
项目:devfestnorte-app    文件:DrawableRequestBuilder.java   
DrawableRequestBuilder(Context context, ModelType model,
        LoadProvider<ModelType, ImageVideoWrapper, GifBitmapWrapper, Drawable> loadProvider, Glide glide) {
    super(context, model, loadProvider, Drawable.class, glide);
    this.context = context;
    this.glide = glide;
}
项目:saarang-iosched    文件:GenericRequest.java   
public GenericRequest(LoadProvider<A, T, Z, R> loadProvider, A model, Context context, Priority priority,
        Target<R> target, float sizeMultiplier, Drawable placeholderDrawable, int placeholderResourceId,
        Drawable errorDrawable, int errorResourceId, RequestListener<A> requestListener, int animationId,
        Animation animation, RequestCoordinator requestCoordinator, Engine engine,
        Transformation<Z> transformation, Class<R> transcodeClass, boolean isMemoryCacheable) {
    this.loadProvider = loadProvider;
    this.model = model;
    this.context = context;
    this.priority = priority;
    this.target = target;
    this.sizeMultiplier = sizeMultiplier;
    this.placeholderDrawable = placeholderDrawable;
    this.placeholderResourceId = placeholderResourceId;
    this.errorDrawable = errorDrawable;
    this.errorResourceId = errorResourceId;
    this.requestListener = requestListener;
    this.animationId = animationId;
    this.animation = animation;
    this.requestCoordinator = requestCoordinator;
    this.engine = engine;
    this.transformation = transformation;
    this.transcodeClass = transcodeClass;
    this.isMemoryCacheable = isMemoryCacheable;

    // We allow null models by just setting an error drawable. Null models will always have empty providers, we
    // simply skip our sanity checks in that unusual case.
    if (model != null) {
        if (loadProvider.getCacheDecoder() == null) {
            throw new NullPointerException("CacheDecoder must not be null, try .cacheDecoder(ResouceDecoder)");
        }
        if (loadProvider.getSourceDecoder() == null) {
            throw new NullPointerException("SourceDecoder must not be null, try .imageDecoder(ResourceDecoder) " +
                    "and/or .videoDecoder()");
        }
        if (loadProvider.getEncoder() == null) {
            throw new NullPointerException("Encoder must not be null, try .encode(ResourceEncoder)");
        }
        if (loadProvider.getTranscoder() == null) {
            throw new NullPointerException("Transcoder must not be null, try .as(Class, ResourceTranscoder)");
        }
        if (loadProvider.getModelLoader() == null) {
            throw new NullPointerException("ModelLoader must not be null, try .using(ModelLoader)");
        }
    }
}
项目:saarang-iosched    文件:DrawableRequestBuilder.java   
DrawableRequestBuilder(Context context, ModelType model,
        LoadProvider<ModelType, ImageVideoWrapper, GifBitmapWrapper, Drawable> loadProvider, Glide glide) {
    super(context, model, loadProvider, Drawable.class, glide);
    this.context = context;
    this.glide = glide;
}