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);
}
});
}
Aggregations