Skip to content

Commit

Permalink
修改readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jeasonlzy committed Oct 6, 2016
1 parent 3435968 commit 81f0f7a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 39 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ dependencies {
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.google.code.gson:gson:2.5'
compile 'com.lzy.widget:ninegridview:0.2.0'
compile 'com.lzy.widget:ninegridview:0.2.1'
compile 'com.lzy.widget:imagepicker:0.3.2'
compile 'com.lzy.widget:view-core:0.2.1'
// compile 'com.lzy.net:okgo:2.0.0'
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/com/lzy/demo/utils/GlideImageLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public class GlideImageLoader implements ImageLoader, NineGridView.ImageLoader {
@Override
public void onDisplayImage(Context context, ImageView imageView, String url) {
Glide.with(context).load(url)//
.placeholder(R.drawable.ic_default_image)// 这行貌似是glide的bug,在部分机型上会导致第一次图片不在中间
.error(R.drawable.ic_default_image)//
.placeholder(R.drawable.ic_default_color)// 这行貌似是glide的bug,在部分机型上会导致第一次图片不在中间
.error(R.drawable.ic_default_color)//
.diskCacheStrategy(DiskCacheStrategy.ALL)//
.into(imageView);
}
Expand All @@ -40,8 +40,8 @@ public Bitmap getCacheImage(String url) {
@Override
public void displayImage(Activity activity, String path, ImageView imageView, int width, int height) {
Glide.with(activity).load(new File(path))//
.placeholder(R.drawable.ic_default_image)//
.error(R.drawable.ic_default_image)//
.placeholder(R.drawable.ic_default_color)//
.error(R.drawable.ic_default_color)//
.diskCacheStrategy(DiskCacheStrategy.ALL)//
.into(imageView);
}
Expand Down
12 changes: 6 additions & 6 deletions app/src/main/java/com/lzy/demo/utils/PicassoImageLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ public class PicassoImageLoader implements ImageLoader, NineGridView.ImageLoader

@Override
public void displayImage(Activity activity, String path, ImageView imageView, int width, int height) {
Picasso.with(activity) //配置上下文
.load(Uri.fromFile(new File(path))) //设置图片路径(fix #8,文件名包含%符号 无法识别和显示)
.error(R.mipmap.default_image) //设置错误图片
.placeholder(R.mipmap.default_image) //设置占位图片
Picasso.with(activity) //配置上下文
.load(Uri.fromFile(new File(path))) //设置图片路径(fix #8,文件名包含%符号 无法识别和显示)
.error(R.drawable.ic_default_color) //设置错误图片
.placeholder(R.drawable.ic_default_color) //设置占位图片
.into(imageView);
}

Expand All @@ -40,8 +40,8 @@ public void clearMemoryCache() {
@Override
public void onDisplayImage(Context context, ImageView imageView, String url) {
Picasso.with(context).load(url)//
.placeholder(R.drawable.ic_default_image)//
.error(R.drawable.ic_default_image)//
.placeholder(R.drawable.ic_default_color)//
.error(R.drawable.ic_default_color)//
.into(imageView);
}

Expand Down
28 changes: 0 additions & 28 deletions app/src/main/res/layout/activity_recycler_view1.xml

This file was deleted.

0 comments on commit 81f0f7a

Please sign in to comment.