当前位置: 首页>>代码示例>>Java>>正文


Java DiskCacheUtils.removeFromCache方法代码示例

本文整理汇总了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();
}
 
开发者ID:Nventify,项目名称:ImagizerAndroidExample,代码行数:24,代码来源:CompareActivity.java

示例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();
    }
 
开发者ID:reyanshmishra,项目名称:Rey-MusicPlayer,代码行数:38,代码来源:AlbumsArtDownloadService.java

示例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);
}
 
开发者ID:sahasbhop,项目名称:apng-view,代码行数:38,代码来源:ApngImageLoadingListener.java

示例4: removeImageCache

import com.nostra13.universalimageloader.utils.DiskCacheUtils; //导入方法依赖的package包/类
public void removeImageCache(String s)
{
    MemoryCacheUtils.removeFromCache(s, b.getMemoryCache());
    DiskCacheUtils.removeFromCache(s, b.getDiscCache());
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:6,代码来源:BraceletImageLoader.java


注:本文中的com.nostra13.universalimageloader.utils.DiskCacheUtils.removeFromCache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。