• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java MemoryCacheUtil类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中com.nostra13.universalimageloader.core.assist.MemoryCacheUtil的典型用法代码示例。如果您正苦于以下问题:Java MemoryCacheUtil类的具体用法?Java MemoryCacheUtil怎么用?Java MemoryCacheUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

MemoryCacheUtil类属于com.nostra13.universalimageloader.core.assist包,在下文中一共展示了MemoryCacheUtil类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: loadAvatar

点赞 3

import com.nostra13.universalimageloader.core.assist.MemoryCacheUtil; //导入依赖的package包/类
private ImageView loadAvatar(final String channelJid, boolean skipCache) {
	ImageView avatarView = (ImageView) findViewById(R.id.bcProfilePic);
	DisplayImageOptions dio = new DisplayImageOptions.Builder()
			.cloneFrom(ImageHelper.defaultImageOptions())
			.showImageOnFail(R.drawable.ic_avatar)
			.showImageOnLoading(R.drawable.ic_avatar)
			.preProcessor(ImageHelper.createRoundProcessor(16, false, -1))
			.resetViewBeforeLoading(true)
			.build();

	String avatarURL = AvatarUtils.avatarURL(this, channelJid);
	if (skipCache) {
		DiscCacheUtil.removeFromCache(avatarURL, ImageLoader.getInstance()
				.getDiscCache());
		MemoryCacheUtil.removeFromCache(avatarURL, ImageLoader
				.getInstance().getMemoryCache());
	}

	ImageLoader.getInstance().displayImage(avatarURL, avatarView, dio);

	return avatarView;
}
 

开发者ID:buddycloud,
项目名称:buddycloud-android,
代码行数:23,
代码来源:ChannelDetailActivity.java

示例2: initEmptyFieldsWithDefaultValues

点赞 2

import com.nostra13.universalimageloader.core.assist.MemoryCacheUtil; //导入依赖的package包/类
private void initEmptyFieldsWithDefaultValues() {
	if (taskExecutor == null) {
		taskExecutor = DefaultConfigurationFactory
				.createExecutor(threadPoolSize, threadPriority, tasksProcessingType);
	} else {
		customExecutor = true;
	}
	if (taskExecutorForCachedImages == null) {
		taskExecutorForCachedImages = DefaultConfigurationFactory
				.createExecutor(threadPoolSize, threadPriority, tasksProcessingType);
	} else {
		customExecutorForCachedImages = true;
	}
	if (discCache == null) {
		if (discCacheFileNameGenerator == null) {
			discCacheFileNameGenerator = DefaultConfigurationFactory.createFileNameGenerator();
		}
		discCache = DefaultConfigurationFactory
				.createDiscCache(context, discCacheFileNameGenerator, discCacheSize, discCacheFileCount);
	}
	if (memoryCache == null) {
		memoryCache = DefaultConfigurationFactory.createMemoryCache(memoryCacheSize);
	}
	if (denyCacheImageMultipleSizesInMemory) {
		memoryCache = new FuzzyKeyMemoryCache<String, Bitmap>(memoryCache, MemoryCacheUtil
				.createFuzzyKeyComparator());
	}
	if (downloader == null) {
		downloader = DefaultConfigurationFactory.createImageDownloader(context);
	}
	if (decoder == null) {
		decoder = DefaultConfigurationFactory.createImageDecoder(writeLogs);
	}
	if (defaultDisplayImageOptions == null) {
		defaultDisplayImageOptions = DisplayImageOptions.createSimple();
	}
}
 

开发者ID:Apokrif,
项目名称:morse,
代码行数:38,
代码来源:ImageLoaderConfiguration.java

示例3: getView

点赞 2

import com.nostra13.universalimageloader.core.assist.MemoryCacheUtil; //导入依赖的package包/类
@SuppressLint("SimpleDateFormat") 
@Override
public View getView(int position, View convertView, ViewGroup parent) {
	if (convertView == null) {
		convertView = (LinearLayout) inflater.inflate(rowID, null);
	}
	
	// set value to item
	DetailObj obj=(DetailObj)getItem(position);
	
	TextView title=(TextView)convertView.findViewById(R.id.detail_title);
	title.setText(obj.getTitle());
	
	//parse String -> date
	SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
       Calendar c=Calendar.getInstance();
       try {
           c.setTime(format.parse(obj.getEmpire()));
       } catch (Exception e) {
       	Log.e(mContext.getPackageName(), "can't parse String -> Date");
       }
       Log.d(mContext.getPackageName(),"parse result:"+ c.get(Calendar.HOUR_OF_DAY)+"h"+c.get(Calendar.MINUTE)+" Ngày "+c.get(Calendar.DAY_OF_MONTH)+"/"+c.get(Calendar.MONTH)+"/"+c.get(Calendar.YEAR));
	TextView expireDate=(TextView)convertView.findViewById(R.id.detail_empire);
	expireDate.setText("Đến hết: "+c.get(Calendar.HOUR_OF_DAY)+"h"+c.get(Calendar.MINUTE)+" Ngày "+c.get(Calendar.DAY_OF_MONTH)+"/"+c.get(Calendar.MONTH)+"/"+c.get(Calendar.YEAR));
	
	ImageView icon=(ImageView)convertView.findViewById(R.id.detail_iconDistributor);
	List<Bitmap> lbm=MemoryCacheUtil.findCachedBitmapsForImageUri(mIconPathDistributor, ImageLoader.getInstance().getMemoryCache());
	icon.setImageBitmap(lbm.get(0));
	
	return convertView;
}
 

开发者ID:thoinv,
项目名称:kaorisan,
代码行数:32,
代码来源:DetailAdapter.java

示例4: createMemoryCache

点赞 2

import com.nostra13.universalimageloader.core.assist.MemoryCacheUtil; //导入依赖的package包/类
/** Creates default implementation of {@link MemoryCacheAware} depends on incoming parameters */
public static MemoryCacheAware<String, Bitmap> createMemoryCache(int memoryCacheSize, boolean denyCacheImageMultipleSizesInMemory) {
	MemoryCacheAware<String, Bitmap> memoryCache = new UsingFreqLimitedMemoryCache(memoryCacheSize);
	if (denyCacheImageMultipleSizesInMemory) {
		memoryCache = new FuzzyKeyMemoryCache<String, Bitmap>(memoryCache, MemoryCacheUtil.createFuzzyKeyComparator());
	}
	return memoryCache;
}
 

开发者ID:jixieshi999,
项目名称:juahya,
代码行数:9,
代码来源:DefaultConfigurationFactory.java

示例5: ImageLoadingInfo

点赞 2

import com.nostra13.universalimageloader.core.assist.MemoryCacheUtil; //导入依赖的package包/类
public ImageLoadingInfo(String uri, ImageView imageView, ImageSize targetSize, DisplayImageOptions options, ImageLoadingListener listener, ReentrantLock loadFromUriLock) {
	this.uri = uri;
	this.imageView = imageView;
	this.targetSize = targetSize;
	this.options = options;
	this.listener = listener;
	this.loadFromUriLock = loadFromUriLock;
	memoryCacheKey = MemoryCacheUtil.generateKey(uri, targetSize);
}
 

开发者ID:jixieshi999,
项目名称:juahya,
代码行数:10,
代码来源:ImageLoadingInfo.java

示例6: loadCache

点赞 2

import com.nostra13.universalimageloader.core.assist.MemoryCacheUtil; //导入依赖的package包/类
public void loadCache() {
	List<Bitmap> lbm=MemoryCacheUtil.findCachedBitmapsForImageUri(spref.getString(BANNER_LINK_CACHE, ""), ImageLoader.getInstance().getMemoryCache());
	image.setImageBitmap(lbm.get(0));
}
 

开发者ID:thoinv,
项目名称:kaorisan,
代码行数:5,
代码来源:LoadFooter.java

示例7: onLoadingStarted

点赞 1

import com.nostra13.universalimageloader.core.assist.MemoryCacheUtil; //导入依赖的package包/类
@Override
    public void onLoadingStarted(String url, View view) {
        List<String> memCache = MemoryCacheUtil.
                findCacheKeysForImageUri(url, ImageLoader.getInstance().getMemoryCache());
        cacheFound = !memCache.isEmpty();
        if (!cacheFound) {
            File discCache = DiscCacheUtil.
                    findInCache(url, ImageLoader.getInstance().getDiscCache());
            if (discCache != null) {
                cacheFound = discCache.exists();
            }
        }
    } 

开发者ID:silvestrpredko,
项目名称:TNTU-APP,
代码行数:14,
代码来源:AnimateFirstDisplayListener.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)