Commit 1f22956e by 郑娜伟

picture 支持fresco 3

parent e58b9efa
......@@ -39,9 +39,11 @@ dependencies {
// api 'com.sobot.library:sobotcommon:1.0'
// api 'com.sobot.library:sobotcommon_x:1.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.sobot.chat:sobotsupport-glidev4:2.1'
// implementation 'com.facebook.fresco:fresco:1.13.0'
// implementation 'com.github.bumptech.glide:glide:4.9.0'
// implementation 'com.sobot.chat:sobotsupport-glidev4:2.1'
implementation 'com.facebook.fresco:fresco:1.13.0'
//android x 可以用这个 ,普通版不能用这个
// implementation 'com.facebook.fresco:fresco:2.6.0'
implementation 'com.squareup.okhttp3:okhttp:4.4.0'
//添加此行
......
......@@ -55,67 +55,67 @@ public class MainActivity extends SobotBaseActivity {
img2 = findViewById(R.id.img2);
// img2.setScaleType(ImageView.ScaleType.FIT_XY);
// SobotBitmapUtil.display(this,"https://img.sobot.com/chatres/75574e5fa29a48458d1f57ab5489a4c5/msg/20220421/34a466420d78fa1172bc0acd85166745/9410b53be86b4d589c61c60f6aee2461.jpeg",img2);
File save=new File(SobotSDCardUtils.getSDCardRootPath(MainActivity.this)+"/9410b53be86b4d589c61c60f6aee2461.jpeg");
HttpBaseUtils.getInstance().download("https://img.sobot.com/chatres/75574e5fa29a48458d1f57ab5489a4c5/msg/20220421/34a466420d78fa1172bc0acd85166745/9410b53be86b4d589c61c60f6aee2461.jpeg", save, new HttpBaseUtils.FileCallBack() {
@Override
public void onResponse(File result) {
Bitmap bitmap= SobotBitmapUtil.compress(result.getPath(),MainActivity.this,true);
img2.setImageBitmap(bitmap);
}
@Override
public void onError(Exception e, String msg, int responseCode) {
SobotLogUtils.i("下载失败:"+msg);
}
@Override
public void inProgress(int progress) {
SobotLogUtils.i("下载进度:"+progress);
}
});
SobotDownloadManager.getInstance().get("sdfsdfds");
Map<String, String> map = new HashMap<>();
map.put("number", "142160000");
map.put("companyId", "1eae128b7e394aedafd28828bfa84767");
map.put("agentId", "969a7ee9fd4c42f48171b0128df2f16c");
map.put("displayNumber", "01051393569");
map.put("callWay", "2");
map.put("isRecordStereo", "false");
map.put("agentState", "1");
map.put("appId", "a4b246c8b67e4543b3b870ce62f75546");
map.put("groupId", "36b0f8eb2de948d99e89c8f0c3d92e68_5");
map.put("agentPhoneNum", "18600978969");
SobotSharedPreferencesUtil.getInstance(this).put("aa",map);
Map<String, String> map1=SobotSharedPreferencesUtil.getInstance(this).get("aa",Map.class);
SobotSharedPreferencesUtil.getInstance(this).clearAll();
Map<String, String> map2=SobotSharedPreferencesUtil.getInstance(this).get("aa",Map.class);
SobotSharedPreferencesUtil.getInstance(this).put("aa",map);
Map<String, String> map3=SobotSharedPreferencesUtil.getInstance(this).get("aa",Map.class);
SobotSharedPreferencesUtil.getInstance(this).remove("aa");
Map<String, String> map4=SobotSharedPreferencesUtil.getInstance(this).get("aa",Map.class);
SobotHttpUtils.doPostByJsonString(this, "https://sobot.com/comm/api/4/call/agentOnWork?access_token=c273b74c-3b37-48cf-937f-9c46940cc19d", map, null, new HttpBaseUtils.StringCallBack() {
@Override
public void onResponse(String result) {
SobotLogUtils.i(result);
}
@Override
public void onError(Exception e, String msg, int responseCode) {
}
@Override
public void inProgress(int progress) {
}
});
SobotBitmapUtil.display(this,"https://img.sobot.com/chatres/75574e5fa29a48458d1f57ab5489a4c5/msg/20220421/34a466420d78fa1172bc0acd85166745/9410b53be86b4d589c61c60f6aee2461.jpeg",img2);
// File save=new File(SobotSDCardUtils.getSDCardRootPath(MainActivity.this)+"/9410b53be86b4d589c61c60f6aee2461.jpeg");
// HttpBaseUtils.getInstance().download("https://img.sobot.com/chatres/75574e5fa29a48458d1f57ab5489a4c5/msg/20220421/34a466420d78fa1172bc0acd85166745/9410b53be86b4d589c61c60f6aee2461.jpeg", save, new HttpBaseUtils.FileCallBack() {
// @Override
// public void onResponse(File result) {
// Bitmap bitmap= SobotBitmapUtil.compress(result.getPath(),MainActivity.this,true);
// img2.setImageBitmap(bitmap);
// }
//
// @Override
// public void onError(Exception e, String msg, int responseCode) {
// SobotLogUtils.i("下载失败:"+msg);
// }
//
// @Override
// public void inProgress(int progress) {
//SobotLogUtils.i("下载进度:"+progress);
// }
// });
//
// SobotDownloadManager.getInstance().get("sdfsdfds");
//
// Map<String, String> map = new HashMap<>();
// map.put("number", "142160000");
// map.put("companyId", "1eae128b7e394aedafd28828bfa84767");
// map.put("agentId", "969a7ee9fd4c42f48171b0128df2f16c");
// map.put("displayNumber", "01051393569");
// map.put("callWay", "2");
// map.put("isRecordStereo", "false");
//
// map.put("agentState", "1");
// map.put("appId", "a4b246c8b67e4543b3b870ce62f75546");
// map.put("groupId", "36b0f8eb2de948d99e89c8f0c3d92e68_5");
// map.put("agentPhoneNum", "18600978969");
//
// SobotSharedPreferencesUtil.getInstance(this).put("aa",map);
// Map<String, String> map1=SobotSharedPreferencesUtil.getInstance(this).get("aa",Map.class);
// SobotSharedPreferencesUtil.getInstance(this).clearAll();
// Map<String, String> map2=SobotSharedPreferencesUtil.getInstance(this).get("aa",Map.class);
//
// SobotSharedPreferencesUtil.getInstance(this).put("aa",map);
// Map<String, String> map3=SobotSharedPreferencesUtil.getInstance(this).get("aa",Map.class);
// SobotSharedPreferencesUtil.getInstance(this).remove("aa");
// Map<String, String> map4=SobotSharedPreferencesUtil.getInstance(this).get("aa",Map.class);
//
// SobotHttpUtils.doPostByJsonString(this, "https://sobot.com/comm/api/4/call/agentOnWork?access_token=c273b74c-3b37-48cf-937f-9c46940cc19d", map, null, new HttpBaseUtils.StringCallBack() {
// @Override
// public void onResponse(String result) {
// SobotLogUtils.i(result);
// }
//
// @Override
// public void onError(Exception e, String msg, int responseCode) {
//
// }
//
// @Override
// public void inProgress(int progress) {
//
// }
// });
// selectPicFromLocal();
// selectVedioFromLocal();
// openCamera();
......
......@@ -20,12 +20,12 @@ dependencies {
// api project(':sobot_gson')
api 'com.sobot.library:utils:1.1.1'
api 'com.sobot.library:picture:1.1'
api 'com.sobot.library:picture:1.1.2'
api 'com.sobot.library:net:1.1.1'
api 'com.sobot.library:gson:1.1.1'
// api 'com.sobot.library:utils:1.1.1'
// api 'com.sobot.library:picture_x:1.1'
// api 'com.sobot.library:picture_x:1.1.2'
// api 'com.sobot.library:net:1.1.1'
// api 'com.sobot.library:gson:1.1.1'
}
......
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