本文整理汇总了Java中com.bumptech.glide.load.DataSource.MEMORY_CACHE属性的典型用法代码示例。如果您正苦于以下问题:Java DataSource.MEMORY_CACHE属性的具体用法?Java DataSource.MEMORY_CACHE怎么用?Java DataSource.MEMORY_CACHE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.bumptech.glide.load.DataSource
的用法示例。
在下文中一共展示了DataSource.MEMORY_CACHE属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
/**
* Returns a new {@link Transition} for the given arguments. If isMemoryCache is {@code true} or
* isFirstImage is {@code false}, returns a {@link NoTransition} and otherwise returns a new
* {@link ViewPropertyTransition} for the {@link ViewPropertyTransition.Animator} provided in the
* constructor.
*/
@Override
public Transition<R> build(DataSource dataSource, boolean isFirstResource) {
if (dataSource == DataSource.MEMORY_CACHE || !isFirstResource) {
return NoTransition.get();
}
if (animation == null) {
animation = new ViewPropertyTransition<>(animator);
}
return animation;
}
示例2: build
@Override
public Transition<Drawable> build(DataSource dataSource, boolean isFirstResource) {
if (dataSource == DataSource.MEMORY_CACHE) {
return NoTransition.get();
} else if (isFirstResource) {
return getFirstResourceTransition(dataSource);
} else {
return getSecondResourceTransition(dataSource);
}
}
示例3: build
/**
* Returns a new {@link Transition} for the given arguments. If isFromMemoryCache is {@code true}
* or isFirstImage is {@code false}, returns a {@link NoTransition} and otherwise returns a new
* {@link ViewTransition}.
*
* @param dataSource {@inheritDoc}
* @param isFirstResource {@inheritDoc}
*/
@Override
public Transition<R> build(DataSource dataSource, boolean isFirstResource) {
if (dataSource == DataSource.MEMORY_CACHE || !isFirstResource) {
return NoTransition.get();
}
if (transition == null) {
transition = new ViewTransition<>(viewTransitionAnimationFactory);
}
return transition;
}
示例4: isResourceCacheable
@Override
public boolean isResourceCacheable(boolean isFromAlternateCacheKey, DataSource dataSource,
EncodeStrategy encodeStrategy) {
return dataSource != DataSource.RESOURCE_DISK_CACHE && dataSource != DataSource.MEMORY_CACHE;
}
示例5: isDataCacheable
@Override
public boolean isDataCacheable(DataSource dataSource) {
return dataSource != DataSource.DATA_DISK_CACHE && dataSource != DataSource.MEMORY_CACHE;
}
示例6: build
@Override
public Transition<Drawable> build(DataSource dataSource, boolean isFirstResource) {
return dataSource == DataSource.MEMORY_CACHE
? NoTransition.<Drawable>get() : getResourceTransition();
}