package chat.rocket.android.widget;

import android.content.Context;

import com.facebook.common.logging.FLog;
import com.facebook.drawee.backends.pipeline.DraweeConfig;
import com.facebook.drawee.backends.pipeline.Fresco;
import com.facebook.imagepipeline.backends.okhttp3.OkHttpImagePipelineConfigFactory;
import com.facebook.imagepipeline.core.ImagePipelineConfig;
import com.facebook.imagepipeline.listener.RequestListener;
import com.facebook.imagepipeline.listener.RequestLoggingListener;

import java.util.HashSet;
import java.util.Set;

import chat.rocket.android.widget.fresco.CustomImageFormatConfigurator;
import okhttp3.OkHttpClient;

public class RocketChatWidgets {

  /**
   * TODO
   * The SVG support (by setImageDecoderConfig method) should be enabled after RC servers are stable.
   * Info about that: https://github.com/RocketChat/Rocket.Chat/pull/7572
   */
  public static void initialize(Context context, OkHttpClient okHttpClient) {
    FLog.setMinimumLoggingLevel(FLog.VERBOSE);
    Set<RequestListener> listeners = new HashSet<>();
    listeners.add(new RequestLoggingListener());

    ImagePipelineConfig imagePipelineConfig = OkHttpImagePipelineConfigFactory
        .newBuilder(context, okHttpClient)
        .setRequestListeners(listeners)
//        .setImageDecoderConfig(CustomImageFormatConfigurator.createImageDecoderConfig())
        .setDownsampleEnabled(true)
        .experiment().setBitmapPrepareToDraw(true)
        .experiment().setPartialImageCachingEnabled(true)
        .build();

    DraweeConfig.Builder draweeConfigBuilder = DraweeConfig.newBuilder();
    CustomImageFormatConfigurator.addCustomDrawableFactories(draweeConfigBuilder);

    Fresco.initialize(context, imagePipelineConfig, draweeConfigBuilder.build());
  }
}
@@ -108,67 +108,8 @@
 og;%0A
-import com.facebook.drawee.backends.pipeline.DraweeConfig;%0A
 impo
@@ -490,334 +490,64 @@
 ort 
-chat.rocket.android.widget.fresco.CustomImageFormatConfigurator;%0Aimport okhttp3.OkHttpClient;%0A%0Apublic class RocketChatWidgets %7B%0A%0A  /**%0A   * TODO%0A   * The SVG support (by setImageDecoderConfig method) should be enabled after RC servers are stable.%0A   * Info about that: https://github.com/RocketChat/Rocket.Chat/pull/7572%0A   */
+okhttp3.OkHttpClient;%0A%0Apublic class RocketChatWidgets %7B%0A
 %0A  p
@@ -938,99 +938,8 @@
 rs)%0A
-//        .setImageDecoderConfig(CustomImageFormatConfigurator.createImageDecoderConfig())%0A
     
@@ -1102,166 +1102,8 @@
 );%0A%0A
-    DraweeConfig.Builder draweeConfigBuilder = DraweeConfig.newBuilder();%0A    CustomImageFormatConfigurator.addCustomDrawableFactories(draweeConfigBuilder);%0A%0A
     
@@ -1152,37 +1152,8 @@
 nfig
-, draweeConfigBuilder.build()
 );%0A 

Update RocketChatWidgets.java