Search in sources :

Example 6 with RequestLoggingListener

use of com.facebook.imagepipeline.listener.RequestLoggingListener 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);
}
Also used : RequestListener(com.facebook.imagepipeline.listener.RequestListener) ImagePipelineConfig(com.facebook.imagepipeline.core.ImagePipelineConfig) RequestLoggingListener(com.facebook.imagepipeline.listener.RequestLoggingListener) DraweeConfig(com.facebook.drawee.backends.pipeline.DraweeConfig) HashSet(java.util.HashSet)

Example 7 with RequestLoggingListener

use of com.facebook.imagepipeline.listener.RequestLoggingListener in project fresco by facebook.

the class ZoomableApplication 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();
    Fresco.initialize(this, config);
}
Also used : RequestListener(com.facebook.imagepipeline.listener.RequestListener) ImagePipelineConfig(com.facebook.imagepipeline.core.ImagePipelineConfig) RequestLoggingListener(com.facebook.imagepipeline.listener.RequestLoggingListener) HashSet(java.util.HashSet)

Example 8 with RequestLoggingListener

use of com.facebook.imagepipeline.listener.RequestLoggingListener in project fresco by facebook.

the class ImageRequestTest method testCreatingRequestFromExistingRequest.

@Test
public void testCreatingRequestFromExistingRequest() {
    ImageRequest original = ImageRequestBuilder.newBuilderWithSource(Uri.parse("http://frescolib.org/image.jpg")).setCacheChoice(ImageRequest.CacheChoice.SMALL).setImageDecodeOptions(new ImageDecodeOptionsBuilder().build()).setLocalThumbnailPreviewsEnabled(true).setLowestPermittedRequestLevel(ImageRequest.RequestLevel.DISK_CACHE).setMediaVariations(MediaVariations.forMediaId("A113")).setPostprocessor(new BasePostprocessor() {

        @Override
        public String getName() {
            return super.getName();
        }
    }).setProgressiveRenderingEnabled(true).setRequestListener(new RequestLoggingListener()).setResizeOptions(new ResizeOptions(20, 20)).setRotationOptions(RotationOptions.forceRotation(RotationOptions.ROTATE_90)).setRequestPriority(Priority.HIGH).build();
    ImageRequest copy = ImageRequestBuilder.fromRequest(original).build();
    assertThat(copy).isEqualTo(original);
}
Also used : ResizeOptions(com.facebook.imagepipeline.common.ResizeOptions) RequestLoggingListener(com.facebook.imagepipeline.listener.RequestLoggingListener) ImageDecodeOptionsBuilder(com.facebook.imagepipeline.common.ImageDecodeOptionsBuilder) Test(org.junit.Test)

Example 9 with RequestLoggingListener

use of com.facebook.imagepipeline.listener.RequestLoggingListener in project fresco by facebook.

the class AnimationApplication 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();
    Fresco.initialize(this, config);
}
Also used : RequestListener(com.facebook.imagepipeline.listener.RequestListener) ImagePipelineConfig(com.facebook.imagepipeline.core.ImagePipelineConfig) RequestLoggingListener(com.facebook.imagepipeline.listener.RequestLoggingListener) HashSet(java.util.HashSet)

Aggregations

RequestLoggingListener (com.facebook.imagepipeline.listener.RequestLoggingListener)9 RequestListener (com.facebook.imagepipeline.listener.RequestListener)8 HashSet (java.util.HashSet)8 ImagePipelineConfig (com.facebook.imagepipeline.core.ImagePipelineConfig)7 DraweeConfig (com.facebook.drawee.backends.pipeline.DraweeConfig)2 Supplier (com.facebook.common.internal.Supplier)1 ShowcaseMediaIdExtractor (com.facebook.fresco.samples.showcase.imagepipeline.ShowcaseMediaIdExtractor)1 ImageDecodeOptionsBuilder (com.facebook.imagepipeline.common.ImageDecodeOptionsBuilder)1 ResizeOptions (com.facebook.imagepipeline.common.ResizeOptions)1 Test (org.junit.Test)1