JkImageLoader.java 文件源码

java
阅读 32 收藏 0 点赞 0 评论 0

项目:JkImageLoader 作者:
/**
 * Constructor
 * @author leibing
 * @createTime 2017/3/2
 * @lastModify 2017/3/2
 * @param context ref
 * @return
 */
private JkImageLoader(Context context){
    // init application conext
    mApplicationContext = context.getApplicationContext();
    // init memory cache(one 8 of the max memory)
    int maxMemory = (int) (Runtime.getRuntime().maxMemory() / 1024);
    int cacheSize = maxMemory / 8;
    mMemoryCache = new LruCache<String, Bitmap>(cacheSize) {
        @Override
        protected int sizeOf(String key, Bitmap bitmap) {
            return bitmap.getRowBytes() * bitmap.getHeight() / 1024;
        }
    };
    // init disk cache
    initDiskCache();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号