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; }
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; }
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); }
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); }
@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()); }
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; }
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); }
public VolleyDraweeControllerBuilderSupplier( Context context, ImageLoader imageLoader, Set<ControllerListener> boundControllerListeners) { mContext = context; mImageLoader = imageLoader; mVolleyDraweeControllerFactory = new VolleyDraweeControllerFactory( context.getResources(), DeferredReleaser.getInstance(), UiThreadImmediateExecutorService.getInstance()); mBoundControllerListeners = boundControllerListeners; }
public VolleyDraweeControllerFactory( Resources resources, DeferredReleaser deferredReleaser, Executor uiThreadExecutor) { mResources = resources; mDeferredReleaser = deferredReleaser; mUiThreadExecutor = uiThreadExecutor; }
public AbstractDraweeController( DeferredReleaser deferredReleaser, Executor uiThreadImmediateExecutor, String id, Object callerContext) { mDeferredReleaser = deferredReleaser; mUiThreadImmediateExecutor = uiThreadImmediateExecutor; init(id, callerContext, true); }
public FakeDraweeController( DeferredReleaser deferredReleaser, Executor uiThreadExecutor, Supplier<DataSource<FakeImage>> dataSourceSupplier, String id, Object callerContext) { super(deferredReleaser, uiThreadExecutor, id, callerContext); mDataSourceSupplier = dataSourceSupplier; }
/** * 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); }