Commit 26302a31 authored by Tiago Cunha's avatar Tiago Cunha

"revert"

parent 8b343180
......@@ -2,12 +2,26 @@ package chat.rocket.android.widget;
import android.content.Context;
import chat.rocket.android.widget.fresco.FrescoConfiguration;
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 chat.rocket.android.widget.fresco.ImageFormatConfigurator;
import okhttp3.OkHttpClient;
public class RocketChatWidgets {
public static void initialize(Context context, OkHttpClient okHttpClient) {
FrescoConfiguration.initialize(context, okHttpClient);
ImagePipelineConfig config = OkHttpImagePipelineConfigFactory
.newBuilder(context, okHttpClient)
.setDownsampleEnabled(true)
.setImageDecoderConfig(ImageFormatConfigurator.createImageDecoderConfig())
.build();
DraweeConfig.Builder draweeConfigBuilder = DraweeConfig.newBuilder();
ImageFormatConfigurator.addCustomDrawableFactories(draweeConfigBuilder);
Fresco.initialize(context, config, draweeConfigBuilder.build());
}
}
package chat.rocket.android.widget.fresco;
import android.content.Context;
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 okhttp3.OkHttpClient;
public class FrescoConfiguration {
public static void initialize(Context context, OkHttpClient okHttpClient) {
ImagePipelineConfig config = OkHttpImagePipelineConfigFactory
.newBuilder(context, okHttpClient)
.setDownsampleEnabled(true)
.setImageDecoderConfig(ImageFormatConfigurator.createImageDecoderConfig())
.build();
DraweeConfig.Builder draweeConfigBuilder = DraweeConfig.newBuilder();
ImageFormatConfigurator.addCustomDrawableFactories(draweeConfigBuilder);
Fresco.initialize(context, config, draweeConfigBuilder.build());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment