ImageLoader配置(注釋)

2021-07-03 22:57:12 字數 1549 閱讀 4927

/**

* 配置imageloader

*/private void configimageloader() ", memclass);

final int cachesize = 1024 * 1024 * memclass / 4;

logger.d( " memory cache size:", cachesize);

.memorycacheextraoptions(240, 240).taskexecutor(executors.newfixedthreadpool(10))

// 設定快取的每個檔案的最大寬高,預設是螢幕寬高

// .diskcacheextraoptions(1280, 1280, null)

// 存放到sd卡上的最大寬高

// .diskcacheextraoptions(240, 240, null)

// .threadpoolsize(3)

// 設定執行緒池大小,預設為3

// .denycacheimagemultiplesizesinmemory()

// 禁止快取多份不同大小的

// .threadpriority(thread.norm_priority - 1)

// 執行緒優先順序,預設

// .tasksprocessingorder(queueprocessingtype.fifo)

// .taskexecutor(executor)

.memorycache(new lrumemorycache(cachesize))

// 快取策略

// 預設已設為1/8

// .memorycachesize(cachesize)

// .memorycachesizepercentage(13)//設定最大記憶體快取大小

.diskcache(new unlimiteddisccache(disccachedir))

// 硬碟快取策略:這個快取類沒有任何的限制

// sets disk cache for

// .diskcachesize(50 * 1024 * 1024)//50m

// .diskcachefilecount(500)//sets maximum file count in disk

// cache directory.設定最大檔案數

// .diskcachefilenamegenerator(new

// hashcodefilenamegenerator())//將儲存的時候的uri名稱用hashcode加密

// .image**********(new iworkerimage**********(this))

// .defaultdisplayimageoptions(displayimageoptions.create******())

.writedebuglogs()// 輸出debug資訊,釋放版本的時候,不需要這句

.build();

imageloader.getinstance().init(config);

}

ImageLoader配置過程

imageloader使用詳解 github位址 配置imageloader public void initimageloader 在使用載入的類中去配置這些資源,比如在activity中進行配置 bash public void initoptions imageloader的使用 imagel...

ImageLoader配置引數

imageloader使用詳解 github位址 配置imageloader public void initimageloader 在使用載入的類中去配置這些資源,比如在activity中進行配置 bash public void initoptions imageloader的使用 imagel...

ImageLoader配置(凝視)

配置imageloader private void configimageloader memclass final int cachesize 1024 1024 memclass 4 logger.d memory cache size cachesize memorycacheextraop...