本文整理汇总了Java中com.facebook.imagepipeline.drawable.DrawableFactory类的典型用法代码示例。如果您正苦于以下问题:Java DrawableFactory类的具体用法?Java DrawableFactory怎么用?Java DrawableFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DrawableFactory类属于com.facebook.imagepipeline.drawable包,在下文中一共展示了DrawableFactory类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.facebook.imagepipeline.drawable.DrawableFactory; //导入依赖的package包/类
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;
}
示例2: newController
import com.facebook.imagepipeline.drawable.DrawableFactory; //导入依赖的package包/类
public PipelineDraweeController newController(
Supplier<DataSource<CloseableReference<CloseableImage>>> dataSourceSupplier,
String id,
CacheKey cacheKey,
Object callerContext,
@Nullable ImmutableList<DrawableFactory> customDrawableFactories) {
Preconditions.checkState(mResources != null, "init() not called");
// Field values passed as arguments so that any subclass of PipelineDraweeControllerFactory
// can simply override internalCreateController() and return a custom Drawee controller
PipelineDraweeController controller = internalCreateController(
mResources,
mDeferredReleaser,
mAnimatedDrawableFactory,
mUiThreadExecutor,
mMemoryCache,
mDrawableFactories,
customDrawableFactories,
dataSourceSupplier,
id,
cacheKey,
callerContext);
if (mDebugOverlayEnabledSupplier != null) {
controller.setDrawDebugOverlay(mDebugOverlayEnabledSupplier.get());
}
return controller;
}
示例3: internalCreateController
import com.facebook.imagepipeline.drawable.DrawableFactory; //导入依赖的package包/类
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;
}
示例4: PipelineDraweeController
import com.facebook.imagepipeline.drawable.DrawableFactory; //导入依赖的package包/类
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);
}
示例5: maybeCreateDrawableFromFactories
import com.facebook.imagepipeline.drawable.DrawableFactory; //导入依赖的package包/类
private Drawable maybeCreateDrawableFromFactories(
@Nullable ImmutableList<DrawableFactory> drawableFactories,
CloseableImage closeableImage) {
if (drawableFactories == null) {
return null;
}
for (DrawableFactory factory : drawableFactories) {
if (factory.supportsImageType(closeableImage)) {
Drawable drawable = factory.createDrawable(closeableImage);
if (drawable != null) {
return drawable;
}
}
}
return null;
}
示例6: addCustomDrawableFactory
import com.facebook.imagepipeline.drawable.DrawableFactory; //导入依赖的package包/类
/**
* Add a custom drawable factory that will be used to create
* Drawables for {@link com.facebook.imagepipeline.image.CloseableImage}s.
*
* @param factory the factory to use
* @return the builder
*/
public Builder addCustomDrawableFactory(DrawableFactory factory) {
if (mCustomDrawableFactories == null) {
mCustomDrawableFactories = new ArrayList<>();
}
mCustomDrawableFactories.add(factory);
return this;
}
示例7: initialize
import com.facebook.imagepipeline.drawable.DrawableFactory; //导入依赖的package包/类
/**
* Initializes this controller with the new data source supplier, id and caller context. This
* allows for reusing of the existing controller instead of instantiating a new one. This method
* should be called when the controller is in detached state.
*
* @param dataSourceSupplier data source supplier
* @param id unique id for this controller
* @param callerContext tag and context for this controller
*/
public void initialize(
Supplier<DataSource<CloseableReference<CloseableImage>>> dataSourceSupplier,
String id,
CacheKey cacheKey,
Object callerContext,
@Nullable ImmutableList<DrawableFactory> customDrawableFactories) {
super.initialize(id, callerContext);
init(dataSourceSupplier);
mCacheKey = cacheKey;
setCustomDrawableFactories(customDrawableFactories);
}
示例8: getAnimatedDrawableFactory
import com.facebook.imagepipeline.drawable.DrawableFactory; //导入依赖的package包/类
@Nullable
@Override
public DrawableFactory getAnimatedDrawableFactory(Context context) {
if (mAnimatedDrawableFactory == null) {
mAnimatedDrawableFactory = createDrawableFactory();
}
return mAnimatedDrawableFactory;
}
示例9: setCustomDrawableFactories
import com.facebook.imagepipeline.drawable.DrawableFactory; //导入依赖的package包/类
public PipelineDraweeControllerBuilder setCustomDrawableFactories(
@Nullable ImmutableList<DrawableFactory> customDrawableFactories) {
mCustomDrawableFactories = customDrawableFactories;
return getThis();
}
示例10: setCustomDrawableFactory
import com.facebook.imagepipeline.drawable.DrawableFactory; //导入依赖的package包/类
public PipelineDraweeControllerBuilder setCustomDrawableFactory(DrawableFactory drawableFactory) {
Preconditions.checkNotNull(drawableFactory);
return setCustomDrawableFactories(ImmutableList.of(drawableFactory));
}
示例11: getCustomDrawableFactories
import com.facebook.imagepipeline.drawable.DrawableFactory; //导入依赖的package包/类
@Nullable
public ImmutableList<DrawableFactory> getCustomDrawableFactories() {
return mCustomDrawableFactories;
}
示例12: setCustomDrawableFactories
import com.facebook.imagepipeline.drawable.DrawableFactory; //导入依赖的package包/类
public void setCustomDrawableFactories(
@Nullable ImmutableList<DrawableFactory> customDrawableFactories) {
mCustomDrawableFactories = customDrawableFactories;
}
示例13: getAnimatedDrawableFactory
import com.facebook.imagepipeline.drawable.DrawableFactory; //导入依赖的package包/类
@Nullable
public DrawableFactory getAnimatedDrawableFactory(Context context) {
AnimatedFactory animatedFactory = getAnimatedFactory();
return animatedFactory == null ? null : animatedFactory.getAnimatedDrawableFactory(context);
}
示例14: createDrawableFactory
import com.facebook.imagepipeline.drawable.DrawableFactory; //导入依赖的package包/类
public static DrawableFactory createDrawableFactory() {
return new KeyframesDrawableFactory();
}
示例15: getAnimatedDrawableFactory
import com.facebook.imagepipeline.drawable.DrawableFactory; //导入依赖的package包/类
@Nullable DrawableFactory getAnimatedDrawableFactory(Context context);