use of com.facebook.drawee.backends.pipeline.DraweeConfig in project fresco by facebook.
the class DemoApplication method onCreate.
@Override
public void onCreate() {
super.onCreate();
FLog.setMinimumLoggingLevel(FLog.VERBOSE);
Set<RequestListener> listeners = new HashSet<>();
listeners.add(new RequestLoggingListener());
ImagePipelineConfig config = ImagePipelineConfig.newBuilder(this).setRequestListeners(listeners).build();
DraweeConfig draweeConfig = DraweeConfig.newBuilder().setDrawDebugOverlay(DebugOverlayHelper.isDebugOverlayEnabled(this)).build();
Fresco.initialize(this, config, draweeConfig);
}
use of com.facebook.drawee.backends.pipeline.DraweeConfig in project fresco by facebook.
the class ScrollPerfApplication method onCreate.
@Override
public void onCreate() {
super.onCreate();
final Config config = Config.load(this);
ImagePipelineConfig.Builder imagePipelineConfigBuilder = ImagePipelineConfig.newBuilder(this).setResizeAndRotateEnabledForNetwork(false).setDownsampleEnabled(config.downsampling);
if (WebpSupportStatus.sIsWebpSupportRequired) {
imagePipelineConfigBuilder.experiment().setWebpSupportEnabled(config.webpSupportEnabled);
}
if (config.decodingThreadCount == 0) {
imagePipelineConfigBuilder.setExecutorSupplier(new DefaultExecutorSupplier(Const.NUMBER_OF_PROCESSORS));
} else {
imagePipelineConfigBuilder.setExecutorSupplier(new ScrollPerfExecutorSupplier(Const.NUMBER_OF_PROCESSORS, config.decodingThreadCount));
}
imagePipelineConfigBuilder.experiment().setDecodeCancellationEnabled(config.decodeCancellation);
DraweeConfig draweeConfig = DraweeConfig.newBuilder().setDrawDebugOverlay(config.draweeOverlayEnabled).build();
if (BuildConfig.FLAVOR == "noNativeCode") {
imagePipelineConfigBuilder.setMemoryChunkType(MemoryChunkType.BUFFER_MEMORY);
Fresco.initialize(this, imagePipelineConfigBuilder.build(), draweeConfig, false);
} else {
Fresco.initialize(this, imagePipelineConfigBuilder.build(), draweeConfig, true);
}
}
Aggregations