Java Code Examples for com.facebook.imagepipeline.core.ImagePipelineFactory#initialize()

The following examples show how to use com.facebook.imagepipeline.core.ImagePipelineFactory#initialize() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RegResult.java    From Android-HTTPS-based-on-MVVM with Apache License 2.0 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ActivityRegResultBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_reg_result);
    ImagePipelineFactory.initialize(this);
    binding.setViewModel(new ResultViewModel(this, (UserBean) getIntent().getSerializableExtra("user")));
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
 
Example 2
Source File: DraweeSpan.java    From drawee-text-view with Apache License 2.0 5 votes vote down vote up
@VisibleForTesting
protected DataSource<CloseableReference<CloseableImage>> fetchDecodedImage() {
    ImagePipelineFactory factory;
    try {
        factory = ImagePipelineFactory.getInstance();
    } catch (NullPointerException e) {
        // Image pipeline is not initialized
        ImagePipelineFactory.initialize(mAttachedView.getContext().getApplicationContext());
        factory = ImagePipelineFactory.getInstance();
    }
    ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse(getImageUri()))
            .setImageDecodeOptions(ImageDecodeOptions.newBuilder().setDecodePreviewFrame(true).build())
            .build();
    return factory.getImagePipeline().fetchDecodedImage(request, null);
}
 
Example 3
Source File: WebpBitmapFactoryTest.java    From fresco with MIT License 5 votes vote down vote up
@Override
@Before
public void setUp() {
  mInstrumentation = InstrumentationRegistry.getInstrumentation();
  mWebpBitmapFactory = new WebpBitmapFactoryImpl();
  ImagePipelineConfig.Builder configBuilder =
      ImagePipelineConfig.newBuilder(mInstrumentation.getContext())
          .experiment()
          .setWebpBitmapFactory(mWebpBitmapFactory);
  ImagePipelineFactory.initialize(configBuilder.build());
}
 
Example 4
Source File: WebpDecodingTest.java    From fresco with MIT License 5 votes vote down vote up
@Override
@Before
public void setUp() {
  mInstrumentation = InstrumentationRegistry.getInstrumentation();
  mWebpBitmapFactory = new WebpBitmapFactoryImpl();
  ImagePipelineConfig.Builder configBuilder =
      ImagePipelineConfig.newBuilder(mInstrumentation.getContext())
          .experiment()
          .setWebpBitmapFactory(mWebpBitmapFactory);
  ImagePipelineFactory.initialize(configBuilder.build());
}
 
Example 5
Source File: FrescoPlusCore.java    From FrescoPlus with Apache License 2.0 4 votes vote down vote up
public static void init(Context context,ImagePipelineConfig imagePipelineConfig){
    ImagePipelineFactory.initialize(imagePipelineConfig);
    mDraweeControllerBuilderSupplier = new PipelineDraweeControllerBuilderSupplier(context);
    FrescoPlusView.initialize(mDraweeControllerBuilderSupplier);
}
 
Example 6
Source File: Fresco.java    From FanXin-based-HuanXin with GNU General Public License v2.0 4 votes vote down vote up
/** Initializes Fresco with the default config. */
public static void initialize(Context context) {
  ImagePipelineFactory.initialize(context);
  initializeDrawee(context);
}
 
Example 7
Source File: Fresco.java    From FanXin-based-HuanXin with GNU General Public License v2.0 4 votes vote down vote up
/** Initializes Fresco with the specified config. */
public static void initialize(Context context, ImagePipelineConfig imagePipelineConfig) {
  ImagePipelineFactory.initialize(imagePipelineConfig);
  initializeDrawee(context);
}