Commit 5fe7dc12 by 郭倩芳

图片加载框架picasso支持v2.7、2.8版本

parent db474104
...@@ -30,7 +30,7 @@ dependencies { ...@@ -30,7 +30,7 @@ dependencies {
compileOnly 'androidx.legacy:legacy-support-v4:1.0.0' compileOnly 'androidx.legacy:legacy-support-v4:1.0.0'
compileOnly 'com.nostra13.universalimageloader:universal-image-loader:1.9.5' compileOnly 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
compileOnly 'com.github.bumptech.glide:glide:3.8.0' compileOnly 'com.github.bumptech.glide:glide:3.8.0'
compileOnly 'com.squareup.picasso:picasso:2.5.2' compileOnly 'com.squareup.picasso:picasso:2.8'
compileOnly 'com.facebook.fresco:fresco:2.6.0' compileOnly 'com.facebook.fresco:fresco:2.6.0'
api 'com.sobot.chat:sobotsupport-glidev4:1.0' api 'com.sobot.chat:sobotsupport-glidev4:1.0'
} }
......
...@@ -12,7 +12,7 @@ task androidSourcesJar(type: Jar) { ...@@ -12,7 +12,7 @@ task androidSourcesJar(type: Jar) {
ext { ext {
PUBLISH_GROUP_ID = "com.sobot.library" //项目包名 PUBLISH_GROUP_ID = "com.sobot.library" //项目包名
PUBLISH_ARTIFACT_ID = 'picture_x' //项目名 PUBLISH_ARTIFACT_ID = 'picture_x' //项目名
PUBLISH_VERSION = '1.1.7' //版本号 PUBLISH_VERSION = '1.1.8' //版本号
} }
......
...@@ -25,14 +25,13 @@ public class SobotPicassoImageLoader extends SobotImageLoader { ...@@ -25,14 +25,13 @@ public class SobotPicassoImageLoader extends SobotImageLoader {
} }
RequestCreator creator ; RequestCreator creator ;
if (pathStr.startsWith("http")) { if (pathStr.startsWith("http")) {
creator = Picasso.with(context).load(pathStr); creator = Picasso.get().load(pathStr);
} else { } else {
//本地文件
File file = new File(pathStr); File file = new File(pathStr);
if (file != null) { if (file != null) {
creator = Picasso.with(context).load(file); creator = Picasso.get().load(file);
}else{ } else {
creator = Picasso.with(context).load(pathStr); creator = Picasso.get().load(pathStr);;
} }
} }
if (loadingResId != 0) { if (loadingResId != 0) {
...@@ -59,7 +58,7 @@ public class SobotPicassoImageLoader extends SobotImageLoader { ...@@ -59,7 +58,7 @@ public class SobotPicassoImageLoader extends SobotImageLoader {
@Override @Override
public void displayImage(Context context, final ImageView imageView, int targetResId, int loadingResId, int failResId, int width, int height, final SobotDisplayImageListener listener) { public void displayImage(Context context, final ImageView imageView, int targetResId, int loadingResId, int failResId, int width, int height, final SobotDisplayImageListener listener) {
RequestCreator creator = Picasso.with(context).load(targetResId).config(Bitmap.Config.RGB_565); RequestCreator creator = Picasso.get().load(targetResId).config(Bitmap.Config.RGB_565);
if (loadingResId != 0) { if (loadingResId != 0) {
creator.placeholder(loadingResId); creator.placeholder(loadingResId);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment