Skip to content

Commit

Permalink
delete code
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinea committed Jan 4, 2014
1 parent dbe8fc9 commit 7dbc062
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/cn/trinea/android/demo/ImageCacheDemo.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,22 @@ public void onCreate(Bundle savedInstanceState) {
IMAGE_CACHE.initData(this, TAG_CACHE);
IMAGE_CACHE.setContext(context);
// intelligent compress image
IMAGE_CACHE.setCompressListener(new CompressListener() {

@Override
public int getCompressSize(String imagePath) {
if (FileUtils.isFileExist(imagePath)) {
long fileSize = FileUtils.getFileSize(imagePath) / 1000;
/**
* if image bigger than 100k, compress to 1/(n + 1) width and 1/(n + 1) height, n is fileSize / 100k
**/
if (fileSize > 100) {
return (int)(fileSize / 100) + 1;
}
}
return 1;
}
});
// IMAGE_CACHE.setCompressListener(new CompressListener() {
//
// @Override
// public int getCompressSize(String imagePath) {
// if (FileUtils.isFileExist(imagePath)) {
// long fileSize = FileUtils.getFileSize(imagePath) / 1000;
// /**
// * if image bigger than 100k, compress to 1/(n + 1) width and 1/(n + 1) height, n is fileSize / 100k
// **/
// if (fileSize > 100) {
// return (int)(fileSize / 100) + 1;
// }
// }
// return 1;
// }
// });

int count = 0, viewId = 0x7F24FFF0;
int verticalSpacing, horizontalSpacing;
Expand Down

0 comments on commit 7dbc062

Please sign in to comment.