Search in sources :

Example 1 with ShowcaseMediaIdExtractor

use of com.facebook.fresco.samples.showcase.imagepipeline.ShowcaseMediaIdExtractor in project fresco by facebook.

the class ShowcaseApplication method onCreate.

@Override
public void onCreate() {
    super.onCreate();
    FLog.setMinimumLoggingLevel(FLog.VERBOSE);
    Set<RequestListener> listeners = new HashSet<>();
    listeners.add(new RequestLoggingListener());
    ImagePipelineConfig imagePipelineConfig = ImagePipelineConfig.newBuilder(this).setRequestListeners(listeners).setImageDecoderConfig(CustomImageFormatConfigurator.createImageDecoderConfig(this)).experiment().setMediaVariationsIndexEnabled(new Supplier<Boolean>() {

        @Override
        public Boolean get() {
            return true;
        }
    }).experiment().setMediaIdExtractor(new ShowcaseMediaIdExtractor()).build();
    DraweeConfig.Builder draweeConfigBuilder = DraweeConfig.newBuilder();
    CustomImageFormatConfigurator.addCustomDrawableFactories(this, draweeConfigBuilder);
    draweeConfigBuilder.setDebugOverlayEnabledSupplier(DebugOverlaySupplierSingleton.getInstance(getApplicationContext()));
    Fresco.initialize(this, imagePipelineConfig, draweeConfigBuilder.build());
}
Also used : RequestListener(com.facebook.imagepipeline.listener.RequestListener) ShowcaseMediaIdExtractor(com.facebook.fresco.samples.showcase.imagepipeline.ShowcaseMediaIdExtractor) ImagePipelineConfig(com.facebook.imagepipeline.core.ImagePipelineConfig) RequestLoggingListener(com.facebook.imagepipeline.listener.RequestLoggingListener) Supplier(com.facebook.common.internal.Supplier) DraweeConfig(com.facebook.drawee.backends.pipeline.DraweeConfig) HashSet(java.util.HashSet)

Aggregations

Supplier (com.facebook.common.internal.Supplier)1 DraweeConfig (com.facebook.drawee.backends.pipeline.DraweeConfig)1 ShowcaseMediaIdExtractor (com.facebook.fresco.samples.showcase.imagepipeline.ShowcaseMediaIdExtractor)1 ImagePipelineConfig (com.facebook.imagepipeline.core.ImagePipelineConfig)1 RequestListener (com.facebook.imagepipeline.listener.RequestListener)1 RequestLoggingListener (com.facebook.imagepipeline.listener.RequestLoggingListener)1 HashSet (java.util.HashSet)1