本文整理汇总了Java中org.kymjs.kjframe.bitmap.BitmapConfig类的典型用法代码示例。如果您正苦于以下问题:Java BitmapConfig类的具体用法?Java BitmapConfig怎么用?Java BitmapConfig使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BitmapConfig类属于org.kymjs.kjframe.bitmap包,在下文中一共展示了BitmapConfig类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: calculateCacheSize
import org.kymjs.kjframe.bitmap.BitmapConfig; //导入依赖的package包/类
/**
* 计算缓存的大小
*/
private void calculateCacheSize() {
long fileSize = 0;
String cacheSize = "0KB";
File filesDir = getActivity().getFilesDir();
File cacheDir = getActivity().getCacheDir();
fileSize += FileUtil.getDirSize(filesDir);
fileSize += FileUtil.getDirSize(cacheDir);
File externalCacheDir = getActivity().getExternalCacheDir();
fileSize += FileUtil.getDirSize(externalCacheDir);
fileSize += FileUtil.getDirSize(new File(
org.kymjs.kjframe.utils.FileUtils.getSDCardPath()
+ File.separator + BitmapConfig.CACHEPATH));
if (fileSize > 0)
cacheSize = FileUtil.formatFileSize(fileSize);
mTvCacheSize.setText(cacheSize);
}
示例2: init
import org.kymjs.kjframe.bitmap.BitmapConfig; //导入依赖的package包/类
private void init() {
// 初始化网络请求
AsyncHttpClient client = new AsyncHttpClient();
PersistentCookieStore myCookieStore = new PersistentCookieStore(this);
client.setCookieStore(myCookieStore);
ApiHttpClient.setHttpClient(client);
ApiHttpClient.setCookie(ApiHttpClient.getCookie(this));
// Log控制器
KJLoger.openDebutLog(true);
TLog.DEBUG = BuildConfig.DEBUG;
// Bitmap缓存地址
BitmapConfig.CACHEPATH = "OSChina/imagecache";
}
示例3: finish
import org.kymjs.kjframe.bitmap.BitmapConfig; //导入依赖的package包/类
public void finish() {
for (String url : currentUrls) {
BitmapConfig.mMemoryCache.remove(url);
}
currentUrls = null;
displayer = null;
diskImageRequest = null;
}
示例4: KJBitmap
import org.kymjs.kjframe.bitmap.BitmapConfig; //导入依赖的package包/类
public KJBitmap(BitmapConfig bitmapConfig) {
this((KJHttp) null, bitmapConfig);
}
示例5: cleanCache
import org.kymjs.kjframe.bitmap.BitmapConfig; //导入依赖的package包/类
/**
* 清空缓存
*/
public void cleanCache() {
BitmapConfig.mMemoryCache.clean();
HttpConfig.mCache.clean();
}
示例6: showLogIfOpen
import org.kymjs.kjframe.bitmap.BitmapConfig; //导入依赖的package包/类
private static void showLogIfOpen(String msg) {
if (BitmapConfig.isDEBUG) {
KJLoger.debugLog(KJBitmap.class.getSimpleName(), msg);
}
}
示例7: removeCache
import org.kymjs.kjframe.bitmap.BitmapConfig; //导入依赖的package包/类
/**
* 移除一个缓存
*
* @param url 哪条url的缓存
*/
public void removeCache(String url) {
BitmapConfig.mMemoryCache.remove(url);
HttpConfig.mCache.remove(url);
}
示例8: getMemoryCache
import org.kymjs.kjframe.bitmap.BitmapConfig; //导入依赖的package包/类
/**
* 获取内存缓存
*
* @param url key
* @return 缓存的bitmap或null
*/
public static Bitmap getMemoryCache(String url) {
return BitmapConfig.mMemoryCache.getBitmap(url);
}