Search in sources :

Example 1 with RetainingDataSourceSupplier

use of com.facebook.datasource.RetainingDataSourceSupplier in project fresco by facebook.

the class RetainingDataSourceSupplierFragment method onViewCreated.

@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
    final SimpleDraweeView simpleDraweeView = view.findViewById(R.id.drawee_view);
    final RetainingDataSourceSupplier<CloseableReference<CloseableImage>> retainingSupplier = new RetainingDataSourceSupplier<>();
    simpleDraweeView.setController(Fresco.newDraweeControllerBuilder().setDataSourceSupplier(retainingSupplier).setControllerListener(controllerListener).build());
    replaceImage(retainingSupplier);
    simpleDraweeView.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View view) {
            replaceImage(retainingSupplier);
        }
    });
}
Also used : SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) CloseableReference(com.facebook.common.references.CloseableReference) RetainingDataSourceSupplier(com.facebook.datasource.RetainingDataSourceSupplier) SimpleDraweeView(com.facebook.drawee.view.SimpleDraweeView) View(android.view.View)

Aggregations

View (android.view.View)1 CloseableReference (com.facebook.common.references.CloseableReference)1 RetainingDataSourceSupplier (com.facebook.datasource.RetainingDataSourceSupplier)1 SimpleDraweeView (com.facebook.drawee.view.SimpleDraweeView)1