本文整理汇总了Java中com.nostra13.universalimageloader.utils.DiskCacheUtils.removeFromCache方法的典型用法代码示例。如果您正苦于以下问题:Java DiskCacheUtils.removeFromCache方法的具体用法?Java DiskCacheUtils.removeFromCache怎么用?Java DiskCacheUtils.removeFromCache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.nostra13.universalimageloader.utils.DiskCacheUtils
的用法示例。
在下文中一共展示了DiskCacheUtils.removeFromCache方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: cleanUp
import com.nostra13.universalimageloader.utils.DiskCacheUtils; //导入方法依赖的package包/类
@SuppressLint("SetTextI18n")
private void cleanUp() {
progressbar.setProgress(0);
totalOriginalSize.setText("0 kb");
totalFileSize.setText("0 kb");
reductionPercent.setText("0 %");
DownloadStorageSizes.clearAll();
for (String image: imageUrls) {
MemoryCacheUtils.removeFromCache(image, imageLoader.getMemoryCache());
DiskCacheUtils.removeFromCache(image, imageLoader.getDiskCache());
}
for (ImageView imageView : imageViews) {
if (imageView != null) {
imageLoader.cancelDisplayTask(imageView);
imageView.setImageResource(android.R.color.transparent);
}
}
imageUrls.clear();
}
示例2: setAlbumArt
import com.nostra13.universalimageloader.utils.DiskCacheUtils; //导入方法依赖的package包/类
public void setAlbumArt(File file, Bitmap artworkBitmap, Song song) throws IOException, TagException, ReadOnlyFileException, CannotReadException, InvalidAudioFrameException {
artworkBitmap = Bitmap.createScaledBitmap(artworkBitmap, 500, 500, false);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
artworkBitmap.compress(Bitmap.CompressFormat.PNG, 100, stream);
byte[] byteArray = stream.toByteArray();
File artworkFile = new File(Environment.getExternalStorageDirectory() + "/artwork.jpg");
if (!artworkFile.exists())
artworkFile.createNewFile();
FileOutputStream out = new FileOutputStream(artworkFile);
artworkBitmap.compress(Bitmap.CompressFormat.JPEG, 90, out);
Artwork artwork = Artwork.createArtworkFromFile(artworkFile);
artwork.setBinaryData(byteArray);
AudioFile audioFile = AudioFileIO.read(file);
Tag tag = audioFile.getTagOrCreateAndSetDefault();
if (tag.getFirstArtwork() != null) {
tag.deleteArtworkField();
tag.setField(artwork);
} else {
tag.addField(artwork);
}
Uri uri = MusicUtils.getAlbumArtUri(song._albumId);
DiskCacheUtils.removeFromCache(uri.toString(), ImageLoader.getInstance().getDiskCache());
String path = FileUtils.getRealPathFromURI(uri);
new File(path).delete();
artworkFile.delete();
}
示例3: onLoadingComplete
import com.nostra13.universalimageloader.utils.DiskCacheUtils; //导入方法依赖的package包/类
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
if (view == null) return;
Object tag = view.getTag(R.id.tag_image);
if (enableDebugLog) FLog.d("tag: %s", tag);
if (tag != null && tag instanceof String) {
String actualUri = tag.toString();
File pngFile = AssistUtil.getCopiedFile(context, actualUri);
if (pngFile == null) {
if (enableDebugLog) FLog.w("Can't locate the file!!! %s", actualUri);
} else if (pngFile.exists()) {
boolean isApng = AssistUtil.isApng(pngFile);
if (isApng) {
if (enableDebugLog) FLog.d("Setup apng drawable");
ApngDrawable drawable = new ApngDrawable(context, loadedImage, Uri.fromFile(pngFile));
((ImageView) view).setImageDrawable(drawable);
} else {
((ImageView) view).setImageBitmap(loadedImage);
}
} else {
if (enableDebugLog) FLog.d("Clear cache and reload");
MemoryCacheUtils.removeFromCache(actualUri, ApngImageLoader.getInstance().getMemoryCache());
DiskCacheUtils.removeFromCache(actualUri, ApngImageLoader.getInstance().getDiskCache());
ApngImageLoader.getInstance().displayImage(actualUri, (ImageView) view, this);
}
}
if (shouldForward()) callback.onLoadFinish(true, imageUri, view);
}
示例4: removeImageCache
import com.nostra13.universalimageloader.utils.DiskCacheUtils; //导入方法依赖的package包/类
public void removeImageCache(String s)
{
MemoryCacheUtils.removeFromCache(s, b.getMemoryCache());
DiskCacheUtils.removeFromCache(s, b.getDiscCache());
}