本文整理汇总了Java中com.facebook.imagepipeline.request.ImageRequest.RequestLevel方法的典型用法代码示例。如果您正苦于以下问题:Java ImageRequest.RequestLevel方法的具体用法?Java ImageRequest.RequestLevel怎么用?Java ImageRequest.RequestLevel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.facebook.imagepipeline.request.ImageRequest
的用法示例。
在下文中一共展示了ImageRequest.RequestLevel方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SettableProducerContext
import com.facebook.imagepipeline.request.ImageRequest; //导入方法依赖的package包/类
public SettableProducerContext(
ImageRequest imageRequest,
String id,
ProducerListener producerListener,
Object callerContext,
ImageRequest.RequestLevel lowestPermittedRequestLevel,
boolean isPrefetch,
boolean isIntermediateResultExpected,
Priority priority) {
super(
imageRequest,
id,
producerListener,
callerContext,
lowestPermittedRequestLevel,
isPrefetch,
isIntermediateResultExpected,
priority);
}
示例2: BaseProducerContext
import com.facebook.imagepipeline.request.ImageRequest; //导入方法依赖的package包/类
public BaseProducerContext(
ImageRequest imageRequest,
String id,
ProducerListener producerListener,
Object callerContext,
ImageRequest.RequestLevel lowestPermittedRequestLevel,
boolean isPrefetch,
boolean isIntermediateResultExpected,
Priority priority) {
mImageRequest = imageRequest;
mId = id;
mProducerListener = producerListener;
mCallerContext = callerContext;
mLowestPermittedRequestLevel = lowestPermittedRequestLevel;
mIsPrefetch = isPrefetch;
mPriority = priority;
mIsIntermediateResultExpected = isIntermediateResultExpected;
mIsCancelled = false;
mCallbacks = new ArrayList<>();
}
示例3: getDataSourceSupplier
import com.facebook.imagepipeline.request.ImageRequest; //导入方法依赖的package包/类
/**
* Returns a DataSource supplier that will on get submit the request for execution and return a
* DataSource representing the pending results of the task.
*
* @param imageRequest the request to submit (what to execute).
* @param callerContext the caller context of the caller of data source supplier
* @param requestLevel which level to look down until for the image
* @return a DataSource representing pending results and completion of the request
*/
public Supplier<DataSource<CloseableReference<CloseableImage>>> getDataSourceSupplier(
final ImageRequest imageRequest,
final Object callerContext,
final ImageRequest.RequestLevel requestLevel) {
return new Supplier<DataSource<CloseableReference<CloseableImage>>>() {
@Override
public DataSource<CloseableReference<CloseableImage>> get() {
return fetchDecodedImage(imageRequest, callerContext, requestLevel);
}
@Override
public String toString() {
return Objects.toStringHelper(this)
.add("uri", imageRequest.getSourceUri())
.toString();
}
};
}
示例4: fetchDecodedImage
import com.facebook.imagepipeline.request.ImageRequest; //导入方法依赖的package包/类
/**
* Submits a request for execution and returns a DataSource representing the pending decoded
* image(s).
* <p>The returned DataSource must be closed once the client has finished with it.
*
* @param imageRequest the request to submit
* @param callerContext the caller context for image request
* @param lowestPermittedRequestLevelOnSubmit the lowest request level permitted for image request
* @return a DataSource representing the pending decoded image(s)
*/
public DataSource<CloseableReference<CloseableImage>> fetchDecodedImage(
ImageRequest imageRequest,
Object callerContext,
ImageRequest.RequestLevel lowestPermittedRequestLevelOnSubmit) {
try {
Producer<CloseableReference<CloseableImage>> producerSequence =
mProducerSequenceFactory.getDecodedImageProducerSequence(imageRequest);
return submitFetchRequest(
producerSequence,
imageRequest,
lowestPermittedRequestLevelOnSubmit,
callerContext);
} catch (Exception exception) {
return DataSources.immediateFailedDataSource(exception);
}
}
示例5: loadThumb
import com.facebook.imagepipeline.request.ImageRequest; //导入方法依赖的package包/类
private void loadThumb(
SimpleDraweeView draweeView,
Size size,
ImageRequest.RequestLevel requestLevel) {
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(size.uri)
.setMediaVariations(MediaVariations.newBuilderForMediaId(MEDIA_ID)
.setForceRequestForSpecifiedUri(true)
.build())
.setLowestPermittedRequestLevel(requestLevel)
.setResizeOptions(new ResizeOptions(draweeView.getWidth(), draweeView.getHeight()))
.setCacheChoice(size.cacheChoice)
.build();
DraweeController controller = Fresco.newDraweeControllerBuilder()
.setImageRequest(request)
.setOldController(draweeView.getController())
.build();
draweeView.setController(controller);
}
示例6: convertCacheLevelToRequestLevel
import com.facebook.imagepipeline.request.ImageRequest; //导入方法依赖的package包/类
public static ImageRequest.RequestLevel convertCacheLevelToRequestLevel(
AbstractDraweeControllerBuilder.CacheLevel cacheLevel) {
switch (cacheLevel) {
case FULL_FETCH:
return ImageRequest.RequestLevel.FULL_FETCH;
case DISK_CACHE:
return ImageRequest.RequestLevel.DISK_CACHE;
case BITMAP_MEMORY_CACHE:
return ImageRequest.RequestLevel.BITMAP_MEMORY_CACHE;
default:
throw new RuntimeException("Cache level" + cacheLevel + "is not supported. ");
}
}
示例7: getKey
import com.facebook.imagepipeline.request.ImageRequest; //导入方法依赖的package包/类
protected Pair<CacheKey, ImageRequest.RequestLevel> getKey(ProducerContext producerContext) {
return Pair.create(
mCacheKeyFactory.getEncodedCacheKey(
producerContext.getImageRequest(),
producerContext.getCallerContext()),
producerContext.getLowestPermittedRequestLevel());
}
示例8: getKey
import com.facebook.imagepipeline.request.ImageRequest; //导入方法依赖的package包/类
protected Pair<CacheKey, ImageRequest.RequestLevel> getKey(
ProducerContext producerContext) {
return Pair.create(
mCacheKeyFactory.getBitmapCacheKey(
producerContext.getImageRequest(),
producerContext.getCallerContext()),
producerContext.getLowestPermittedRequestLevel());
}
示例9: submitFetchRequest
import com.facebook.imagepipeline.request.ImageRequest; //导入方法依赖的package包/类
private <T> DataSource<CloseableReference<T>> submitFetchRequest(
Producer<CloseableReference<T>> producerSequence,
ImageRequest imageRequest,
ImageRequest.RequestLevel lowestPermittedRequestLevelOnSubmit,
Object callerContext) {
final RequestListener requestListener = getRequestListenerForRequest(imageRequest);
try {
ImageRequest.RequestLevel lowestPermittedRequestLevel =
ImageRequest.RequestLevel.getMax(
imageRequest.getLowestPermittedRequestLevel(),
lowestPermittedRequestLevelOnSubmit);
SettableProducerContext settableProducerContext = new SettableProducerContext(
imageRequest,
generateUniqueFutureId(),
requestListener,
callerContext,
lowestPermittedRequestLevel,
/* isPrefetch */ false,
imageRequest.getProgressiveRenderingEnabled() ||
imageRequest.getMediaVariations() != null ||
!UriUtil.isNetworkUri(imageRequest.getSourceUri()),
imageRequest.getPriority());
return CloseableProducerToDataSourceAdapter.create(
producerSequence,
settableProducerContext,
requestListener);
} catch (Exception exception) {
return DataSources.immediateFailedDataSource(exception);
}
}
示例10: submitPrefetchRequest
import com.facebook.imagepipeline.request.ImageRequest; //导入方法依赖的package包/类
private DataSource<Void> submitPrefetchRequest(
Producer<Void> producerSequence,
ImageRequest imageRequest,
ImageRequest.RequestLevel lowestPermittedRequestLevelOnSubmit,
Object callerContext,
Priority priority) {
final RequestListener requestListener = getRequestListenerForRequest(imageRequest);
try {
ImageRequest.RequestLevel lowestPermittedRequestLevel =
ImageRequest.RequestLevel.getMax(
imageRequest.getLowestPermittedRequestLevel(),
lowestPermittedRequestLevelOnSubmit);
SettableProducerContext settableProducerContext = new SettableProducerContext(
imageRequest,
generateUniqueFutureId(),
requestListener,
callerContext,
lowestPermittedRequestLevel,
/* isPrefetch */ true,
/* isIntermediateResultExpected */ false,
priority);
return ProducerToDataSourceAdapter.create(
producerSequence,
settableProducerContext,
requestListener);
} catch (Exception exception) {
return DataSources.immediateFailedDataSource(exception);
}
}
示例11: getLowestPermittedRequestLevel
import com.facebook.imagepipeline.request.ImageRequest; //导入方法依赖的package包/类
@Override
public ImageRequest.RequestLevel getLowestPermittedRequestLevel() {
return mLowestPermittedRequestLevel;
}
示例12: getLowestPermittedRequestLevel
import com.facebook.imagepipeline.request.ImageRequest; //导入方法依赖的package包/类
/**
* @return the lowest permitted {@link ImageRequest.RequestLevel}
*/
ImageRequest.RequestLevel getLowestPermittedRequestLevel();