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


Java Fresco.getImagePipeline方法代码示例

本文整理汇总了Java中com.facebook.drawee.backends.pipeline.Fresco.getImagePipeline方法的典型用法代码示例。如果您正苦于以下问题:Java Fresco.getImagePipeline方法的具体用法?Java Fresco.getImagePipeline怎么用?Java Fresco.getImagePipeline使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.facebook.drawee.backends.pipeline.Fresco的用法示例。


在下文中一共展示了Fresco.getImagePipeline方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: clearCache

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
/**
     * 清除缓存
     */
    private void clearCache() {
        // 清理新闻json数据 - 不清理json数据
//        NewsDALManager.shared.clearCache();

        // Fresco清除图片缓存
        ImagePipeline imagePipeline = Fresco.getImagePipeline();
        imagePipeline.clearCaches();

        // 清除缓存目录 - 清除所有缓存目录文件
        FileCacheUtils.clearAllCache(mContext);

        final KProgressHUD hud = ProgressHUD.show(mContext, "正在清理...");
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                hud.dismiss();
                ProgressHUD.showInfo(mContext, "清理缓存完成");
            }
        }, 2000);

    }
 
开发者ID:6ag,项目名称:LiuAGeAndroid,代码行数:25,代码来源:MainActivity.java

示例2: clear

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
@Override
public void clear(Context ctx, FrescoImageConfig config) {
    Fresco.getImagePipeline().clearMemoryCaches();
    Fresco.getImagePipeline().clearCaches();
    Fresco.getImagePipeline().clearDiskCaches();
    String url = appendUrl(config.getUrl());
    ImagePipeline imagePipeline = Fresco.getImagePipeline();
    Uri uri = Uri.parse(url);
    imagePipeline.evictFromMemoryCache(uri);
}
 
开发者ID:BaoBaoJianqiang,项目名称:CustomListView,代码行数:11,代码来源:FrescoImageLoaderStrategy.java

示例3: onLowMemory

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
@Override
public void onLowMemory() {
    super.onLowMemory();
    ImagePipeline imagePipeline = Fresco.getImagePipeline();
    imagePipeline.clearMemoryCaches();
}
 
开发者ID:liu-xiao-dong,项目名称:JD-Test,代码行数:7,代码来源:MyApplication.java

示例4: evictUri

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
/**
 * 清除缓存中的一条url
 *
 * @param uri 需要被清除的url
 */
public void evictUri(Uri uri) {
    ImagePipeline imagePipeline = Fresco.getImagePipeline();
    imagePipeline.evictFromMemoryCache(uri);
    imagePipeline.evictFromDiskCache(uri);
    imagePipeline.evictFromCache(uri);

}
 
开发者ID:zhonglikui,项目名称:cardinalsSample,代码行数:13,代码来源:FrescoManager.java

示例5: clear

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
/**
 * 清除所有缓存
 */
public void clear() {
    ImagePipeline imagePipeline = Fresco.getImagePipeline();
    imagePipeline.clearMemoryCaches();
    imagePipeline.clearDiskCaches();
    imagePipeline.clearCaches();
}
 
开发者ID:zhonglikui,项目名称:cardinalsSample,代码行数:10,代码来源:FrescoManager.java

示例6: save

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
public static void save(Uri uri, String action) {
    ImageRequest request = ImageRequest.fromUri(uri);
    ImagePipeline pipeline = Fresco.getImagePipeline();
    DataSource<CloseableReference<PooledByteBuffer>> dataSource =
            pipeline.fetchEncodedImage(request, null);

    ImageSubscriber dataSubscriber = new ImageSubscriber(uri, action);

    dataSource.subscribe(dataSubscriber,
            ExpressApplication.getApplication().getImagePipelineConfig()
                    .getExecutorSupplier().forLocalStorageWrite());
}
 
开发者ID:mingdroid,项目名称:tumbviewer,代码行数:13,代码来源:FrescoUtils.java

示例7: onActivityResult

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    LogHelper.i("MainActivityFragment", "onActivityResult");
    super.onActivityResult(requestCode, resultCode, data);

    // retrieve selected image Uri from image picker
    Uri newImageUri = null;
    if (null != data) {
        newImageUri = data.getData();
    }

    if (requestCode == TransistorKeys.REQUEST_LOAD_IMAGE && resultCode == Activity.RESULT_OK && newImageUri != null) {

        ImageHelper imageHelper = new ImageHelper(newImageUri, mActivity, 500, 500);
        Bitmap newImage = imageHelper.getInputImage();

        if (newImage != null && mTempStationID_Position != -1) {
            // write image to storage
            File stationImageFile = mTempStation.getStationImageFileReference(mFolder);//get  station file with correct path according to UniqueID of the station
            try (FileOutputStream out = new FileOutputStream(stationImageFile)) {
                newImage.compress(Bitmap.CompressFormat.PNG, 100, out);
                out.close();
                //remve image from fresco cache
                ImagePipeline imagePipeline = Fresco.getImagePipeline();
                imagePipeline.evictFromCache(Uri.parse(stationImageFile.toURI().toString()));
            } catch (IOException e) {
                LogHelper.e(LOG_TAG, "Unable to save: " + newImage.toString());
            }

            // update adapter
            mCollectionAdapter.notifyItemChanged(mTempStationID_Position);
            Toast.makeText(mApplication, "Image Updated", Toast.LENGTH_SHORT).show();
        } else {
            LogHelper.e(LOG_TAG, "Unable to get image from media picker. Uri was:  " + newImageUri.toString());
        }

    } else {
        LogHelper.e(LOG_TAG, "Unable to get image from media picker. Did not receive an Uri");
    }
}
 
开发者ID:malah-code,项目名称:Open-Quran-Radio,代码行数:41,代码来源:MainActivityFragment.java

示例8: isCache

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
/**
 * @param uri 需要查找的uri
 * @return uri对应的图片是否在缓存中
 */
public boolean isCache(Uri uri) {
    ImagePipeline imagePipeline = Fresco.getImagePipeline();
    return imagePipeline.isInBitmapMemoryCache(uri);
}
 
开发者ID:zhonglikui,项目名称:cardinalsSample,代码行数:9,代码来源:FrescoManager.java

示例9: onActivityResult

import com.facebook.drawee.backends.pipeline.Fresco; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    // retrieve selected image Uri from image picker
    Uri newImageUri = null;
    if (null != data) {
        newImageUri = data.getData();
    }

    if (requestCode == TransistorKeys.REQUEST_LOAD_IMAGE && resultCode == Activity.RESULT_OK && null != data) {

        ImageHelper imageHelper = new ImageHelper(newImageUri, mActivity, 500, 500);
        Bitmap newImage = imageHelper.getInputImage();

        if (newImage != null) {
            // write image to storage
            StorageHelper storageHelper = new StorageHelper(mActivity);
            File mFolder = storageHelper.getCollectionDirectory();
            File stationImageFile = mStation.getStationImageFileReference(mFolder);//get  station file with correct path according to UniqueID of the station
            boolean changeImageSuccessfully = false;
            try (FileOutputStream out = new FileOutputStream(stationImageFile)) {
                newImage.compress(Bitmap.CompressFormat.PNG, 100, out);
                out.close();

                //remve image from fresco cache
                ImagePipeline imagePipeline = Fresco.getImagePipeline();
                imagePipeline.evictFromCache(Uri.parse(stationImageFile.toURI().toString()));

                changeImageSuccessfully = true;
            } catch (IOException e) {
                LogHelper.e(LOG_TAG, "Unable to save: " + newImage.toString());
            }

            // send local broadcast
            if (changeImageSuccessfully) {
                Intent i = new Intent();
                i.setAction(TransistorKeys.ACTION_COLLECTION_CHANGED);
                i.putExtra(TransistorKeys.EXTRA_COLLECTION_CHANGE, TransistorKeys.STATION_CHANGED_IMAGE);
                i.putExtra(TransistorKeys.EXTRA_STATION, mStation);
                i.putExtra(TransistorKeys.EXTRA_STATION_DB_ID, mStation._ID);
                LocalBroadcastManager.getInstance(mActivity.getApplicationContext()).sendBroadcast(i);
            }

            Toast.makeText(mActivity, "Image Updated", Toast.LENGTH_SHORT).show();
        } else {
            LogHelper.e(LOG_TAG, "Unable to get image from media picker: " + newImageUri.toString());
        }

    }
}
 
开发者ID:malah-code,项目名称:Open-Quran-Radio,代码行数:52,代码来源:PlayerActivityFragment.java


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