Java 类com.facebook.drawee.components.DeferredReleaser 实例源码

项目:GitHub    文件:PipelineDraweeControllerFactory.java   
public void init(
    Resources resources,
    DeferredReleaser deferredReleaser,
    DrawableFactory animatedDrawableFactory,
    Executor uiThreadExecutor,
    MemoryCache<CacheKey, CloseableImage> memoryCache,
    @Nullable ImmutableList<DrawableFactory> drawableFactories,
    @Nullable Supplier<Boolean> debugOverlayEnabledSupplier) {
  mResources = resources;
  mDeferredReleaser = deferredReleaser;
  mAnimatedDrawableFactory = animatedDrawableFactory;
  mUiThreadExecutor = uiThreadExecutor;
  mMemoryCache = memoryCache;
  mDrawableFactories = drawableFactories;
  mDebugOverlayEnabledSupplier = debugOverlayEnabledSupplier;
}
项目:GitHub    文件:PipelineDraweeControllerFactory.java   
protected PipelineDraweeController internalCreateController(
    Resources resources,
    DeferredReleaser deferredReleaser,
    DrawableFactory animatedDrawableFactory,
    Executor uiThreadExecutor,
    MemoryCache<CacheKey, CloseableImage> memoryCache,
    @Nullable ImmutableList<DrawableFactory> globalDrawableFactories,
    @Nullable ImmutableList<DrawableFactory> customDrawableFactories,
    Supplier<DataSource<CloseableReference<CloseableImage>>> dataSourceSupplier,
    String id,
    CacheKey cacheKey,
    Object callerContext) {
  PipelineDraweeController controller = new PipelineDraweeController(
      resources,
      deferredReleaser,
      animatedDrawableFactory,
      uiThreadExecutor,
      memoryCache,
      dataSourceSupplier,
      id,
      cacheKey,
      callerContext,
      globalDrawableFactories);
  controller.setCustomDrawableFactories(customDrawableFactories);
  return controller;
}
项目:GitHub    文件:PipelineDraweeController.java   
public PipelineDraweeController(
        Resources resources,
        DeferredReleaser deferredReleaser,
        DrawableFactory animatedDrawableFactory,
        Executor uiThreadExecutor,
        MemoryCache<CacheKey, CloseableImage> memoryCache,
        Supplier<DataSource<CloseableReference<CloseableImage>>> dataSourceSupplier,
        String id,
        CacheKey cacheKey,
        Object callerContext) {
  this(
      resources,
      deferredReleaser,
      animatedDrawableFactory,
      uiThreadExecutor,
      memoryCache,
      dataSourceSupplier,
      id,
      cacheKey,
      callerContext,
      null);
}
项目:GitHub    文件:PipelineDraweeController.java   
public PipelineDraweeController(
    Resources resources,
    DeferredReleaser deferredReleaser,
    DrawableFactory animatedDrawableFactory,
    Executor uiThreadExecutor,
    MemoryCache<CacheKey, CloseableImage> memoryCache,
    Supplier<DataSource<CloseableReference<CloseableImage>>> dataSourceSupplier,
    String id,
    CacheKey cacheKey,
    Object callerContext,
    @Nullable ImmutableList<DrawableFactory> globalDrawableFactories) {
  super(deferredReleaser, uiThreadExecutor, id, callerContext);
  mResources = resources;
  mAnimatedDrawableFactory = animatedDrawableFactory;
  mMemoryCache = memoryCache;
  mCacheKey = cacheKey;
  mGlobalDrawableFactories = globalDrawableFactories;
  init(dataSourceSupplier);
}
项目:GitHub    文件:AbstractDraweeControllerTest.java   
@Before
public void setUp() {
  mDeferredReleaser = mock(DeferredReleaser.class);
  mCallerContext = mock(Object.class);
  mDataSourceSupplier = mock(Supplier.class);
  mDraweeHierarchy = mock(SettableDraweeHierarchy.class);
  mUiThreadExecutor = CallerThreadExecutor.getInstance();
  mController = new FakeDraweeController(
      mDeferredReleaser,
      mUiThreadExecutor,
      mDataSourceSupplier,
      "id",
      mCallerContext);
  doAnswer(
      new Answer<Object>() {
        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
          ((DeferredReleaser.Releasable) invocation.getArguments()[0]).release();
          return null;
        }
      }).when(mDeferredReleaser).scheduleDeferredRelease(any(DeferredReleaser.Releasable.class));
  when(mDataSourceSupplier.get()).thenReturn(SimpleDataSource.<FakeImage>create());
}
项目:fresco    文件:PipelineDraweeControllerFactory.java   
public void init(
    Resources resources,
    DeferredReleaser deferredReleaser,
    DrawableFactory animatedDrawableFactory,
    Executor uiThreadExecutor,
    MemoryCache<CacheKey, CloseableImage> memoryCache,
    @Nullable ImmutableList<DrawableFactory> drawableFactories,
    @Nullable Supplier<Boolean> debugOverlayEnabledSupplier) {
  mResources = resources;
  mDeferredReleaser = deferredReleaser;
  mAnimatedDrawableFactory = animatedDrawableFactory;
  mUiThreadExecutor = uiThreadExecutor;
  mMemoryCache = memoryCache;
  mDrawableFactories = drawableFactories;
  mDebugOverlayEnabledSupplier = debugOverlayEnabledSupplier;
}
项目:fresco    文件:PipelineDraweeControllerFactory.java   
protected PipelineDraweeController internalCreateController(
    Resources resources,
    DeferredReleaser deferredReleaser,
    DrawableFactory animatedDrawableFactory,
    Executor uiThreadExecutor,
    MemoryCache<CacheKey, CloseableImage> memoryCache,
    @Nullable ImmutableList<DrawableFactory> globalDrawableFactories,
    @Nullable ImmutableList<DrawableFactory> customDrawableFactories,
    Supplier<DataSource<CloseableReference<CloseableImage>>> dataSourceSupplier,
    String id,
    CacheKey cacheKey,
    Object callerContext) {
  PipelineDraweeController controller = new PipelineDraweeController(
      resources,
      deferredReleaser,
      animatedDrawableFactory,
      uiThreadExecutor,
      memoryCache,
      dataSourceSupplier,
      id,
      cacheKey,
      callerContext,
      globalDrawableFactories);
  controller.setCustomDrawableFactories(customDrawableFactories);
  return controller;
}
项目:fresco    文件:PipelineDraweeController.java   
public PipelineDraweeController(
        Resources resources,
        DeferredReleaser deferredReleaser,
        DrawableFactory animatedDrawableFactory,
        Executor uiThreadExecutor,
        MemoryCache<CacheKey, CloseableImage> memoryCache,
        Supplier<DataSource<CloseableReference<CloseableImage>>> dataSourceSupplier,
        String id,
        CacheKey cacheKey,
        Object callerContext) {
  this(
      resources,
      deferredReleaser,
      animatedDrawableFactory,
      uiThreadExecutor,
      memoryCache,
      dataSourceSupplier,
      id,
      cacheKey,
      callerContext,
      null);
}
项目:fresco    文件:PipelineDraweeController.java   
public PipelineDraweeController(
    Resources resources,
    DeferredReleaser deferredReleaser,
    DrawableFactory animatedDrawableFactory,
    Executor uiThreadExecutor,
    MemoryCache<CacheKey, CloseableImage> memoryCache,
    Supplier<DataSource<CloseableReference<CloseableImage>>> dataSourceSupplier,
    String id,
    CacheKey cacheKey,
    Object callerContext,
    @Nullable ImmutableList<DrawableFactory> globalDrawableFactories) {
  super(deferredReleaser, uiThreadExecutor, id, callerContext);
  mResources = resources;
  mAnimatedDrawableFactory = animatedDrawableFactory;
  mMemoryCache = memoryCache;
  mCacheKey = cacheKey;
  mGlobalDrawableFactories = globalDrawableFactories;
  init(dataSourceSupplier);
}
项目:fresco    文件:AbstractDraweeControllerTest.java   
@Before
public void setUp() {
  mDeferredReleaser = mock(DeferredReleaser.class);
  mCallerContext = mock(Object.class);
  mDataSourceSupplier = mock(Supplier.class);
  mDraweeHierarchy = mock(SettableDraweeHierarchy.class);
  mUiThreadExecutor = CallerThreadExecutor.getInstance();
  mController = new FakeDraweeController(
      mDeferredReleaser,
      mUiThreadExecutor,
      mDataSourceSupplier,
      "id",
      mCallerContext);
  doAnswer(
      new Answer<Object>() {
        @Override
        public Object answer(InvocationOnMock invocation) throws Throwable {
          ((DeferredReleaser.Releasable) invocation.getArguments()[0]).release();
          return null;
        }
      }).when(mDeferredReleaser).scheduleDeferredRelease(any(DeferredReleaser.Releasable.class));
  when(mDataSourceSupplier.get()).thenReturn(SimpleDataSource.<FakeImage>create());
}
项目:GitHub    文件:PipelineDraweeControllerBuilderSupplier.java   
public PipelineDraweeControllerBuilderSupplier(
    Context context,
    ImagePipelineFactory imagePipelineFactory,
    Set<ControllerListener> boundControllerListeners,
    @Nullable DraweeConfig draweeConfig) {
  mContext = context;
  mImagePipeline = imagePipelineFactory.getImagePipeline();

  if (draweeConfig != null && draweeConfig.getPipelineDraweeControllerFactory() != null) {
    mPipelineDraweeControllerFactory = draweeConfig.getPipelineDraweeControllerFactory();
  } else {
    mPipelineDraweeControllerFactory = new PipelineDraweeControllerFactory();
  }
  mPipelineDraweeControllerFactory.init(
      context.getResources(),
      DeferredReleaser.getInstance(),
      imagePipelineFactory.getAnimatedDrawableFactory(context),
      UiThreadImmediateExecutorService.getInstance(),
      mImagePipeline.getBitmapMemoryCache(),
      draweeConfig != null
          ? draweeConfig.getCustomDrawableFactories()
          : null,
      draweeConfig != null
          ? draweeConfig.getDebugOverlayEnabledSupplier()
          : null);
  mBoundControllerListeners = boundControllerListeners;
}
项目:GitHub    文件:VolleyDraweeController.java   
public VolleyDraweeController(
    Resources resources,
    DeferredReleaser deferredReleaser,
    Executor uiThreadExecutor,
    Supplier<DataSource<Bitmap>> dataSourceSupplier,
    String id,
    Object callerContext) {
  super(deferredReleaser, uiThreadExecutor, id, callerContext);
  mResources = resources;
  init(dataSourceSupplier);
}
项目:GitHub    文件:VolleyDraweeControllerBuilderSupplier.java   
public VolleyDraweeControllerBuilderSupplier(
    Context context,
    ImageLoader imageLoader,
    Set<ControllerListener> boundControllerListeners) {
  mContext = context;
  mImageLoader = imageLoader;
  mVolleyDraweeControllerFactory = new VolleyDraweeControllerFactory(
      context.getResources(),
      DeferredReleaser.getInstance(),
      UiThreadImmediateExecutorService.getInstance());
  mBoundControllerListeners = boundControllerListeners;
}
项目:GitHub    文件:VolleyDraweeControllerFactory.java   
public VolleyDraweeControllerFactory(
    Resources resources,
    DeferredReleaser deferredReleaser,
    Executor uiThreadExecutor) {
  mResources = resources;
  mDeferredReleaser = deferredReleaser;
  mUiThreadExecutor = uiThreadExecutor;
}
项目:GitHub    文件:AbstractDraweeController.java   
public AbstractDraweeController(
    DeferredReleaser deferredReleaser,
    Executor uiThreadImmediateExecutor,
    String id,
    Object callerContext) {
  mDeferredReleaser = deferredReleaser;
  mUiThreadImmediateExecutor = uiThreadImmediateExecutor;
  init(id, callerContext, true);
}
项目:GitHub    文件:AbstractDraweeControllerTest.java   
public FakeDraweeController(
    DeferredReleaser deferredReleaser,
    Executor uiThreadExecutor,
    Supplier<DataSource<FakeImage>> dataSourceSupplier,
    String id,
    Object callerContext) {
  super(deferredReleaser, uiThreadExecutor, id, callerContext);
  mDataSourceSupplier = dataSourceSupplier;
}
项目:drawee-text-view    文件:DraweeSpan.java   
/**
 * Use {@link Builder} to build a DraweeSpan.
 */
private DraweeSpan(String uri, int verticalAlignment, Drawable placeHolder, boolean showAnim) {
    super(verticalAlignment);
    mImageUri = uri;
    mShouldShowAnim = showAnim;
    mDeferredReleaser = DeferredReleaser.getInstance();
    mPlaceHolder = placeHolder;
    // create forwarding drawable with placeholder
    mActualDrawable = new ForwardingDrawable(mPlaceHolder);
}
项目:fresco    文件:PipelineDraweeControllerBuilderSupplier.java   
public PipelineDraweeControllerBuilderSupplier(
    Context context,
    ImagePipelineFactory imagePipelineFactory,
    Set<ControllerListener> boundControllerListeners,
    @Nullable DraweeConfig draweeConfig) {
  mContext = context;
  mImagePipeline = imagePipelineFactory.getImagePipeline();

  if (draweeConfig != null && draweeConfig.getPipelineDraweeControllerFactory() != null) {
    mPipelineDraweeControllerFactory = draweeConfig.getPipelineDraweeControllerFactory();
  } else {
    mPipelineDraweeControllerFactory = new PipelineDraweeControllerFactory();
  }
  mPipelineDraweeControllerFactory.init(
      context.getResources(),
      DeferredReleaser.getInstance(),
      imagePipelineFactory.getAnimatedDrawableFactory(context),
      UiThreadImmediateExecutorService.getInstance(),
      mImagePipeline.getBitmapMemoryCache(),
      draweeConfig != null
          ? draweeConfig.getCustomDrawableFactories()
          : null,
      draweeConfig != null
          ? draweeConfig.getDebugOverlayEnabledSupplier()
          : null);
  mBoundControllerListeners = boundControllerListeners;
}
项目:fresco    文件:VolleyDraweeController.java   
public VolleyDraweeController(
    Resources resources,
    DeferredReleaser deferredReleaser,
    Executor uiThreadExecutor,
    Supplier<DataSource<Bitmap>> dataSourceSupplier,
    String id,
    Object callerContext) {
  super(deferredReleaser, uiThreadExecutor, id, callerContext);
  mResources = resources;
  init(dataSourceSupplier);
}
项目:fresco    文件:VolleyDraweeControllerBuilderSupplier.java   
public VolleyDraweeControllerBuilderSupplier(
    Context context,
    ImageLoader imageLoader,
    Set<ControllerListener> boundControllerListeners) {
  mContext = context;
  mImageLoader = imageLoader;
  mVolleyDraweeControllerFactory = new VolleyDraweeControllerFactory(
      context.getResources(),
      DeferredReleaser.getInstance(),
      UiThreadImmediateExecutorService.getInstance());
  mBoundControllerListeners = boundControllerListeners;
}
项目:fresco    文件:VolleyDraweeControllerFactory.java   
public VolleyDraweeControllerFactory(
    Resources resources,
    DeferredReleaser deferredReleaser,
    Executor uiThreadExecutor) {
  mResources = resources;
  mDeferredReleaser = deferredReleaser;
  mUiThreadExecutor = uiThreadExecutor;
}
项目:fresco    文件:AbstractDraweeController.java   
public AbstractDraweeController(
    DeferredReleaser deferredReleaser,
    Executor uiThreadImmediateExecutor,
    String id,
    Object callerContext) {
  mDeferredReleaser = deferredReleaser;
  mUiThreadImmediateExecutor = uiThreadImmediateExecutor;
  init(id, callerContext, true);
}
项目:fresco    文件:AbstractDraweeControllerTest.java   
public FakeDraweeController(
    DeferredReleaser deferredReleaser,
    Executor uiThreadExecutor,
    Supplier<DataSource<FakeImage>> dataSourceSupplier,
    String id,
    Object callerContext) {
  super(deferredReleaser, uiThreadExecutor, id, callerContext);
  mDataSourceSupplier = dataSourceSupplier;
}