Commit 475b6e140f960c29dece6f4655759cc87fcc8c6c

Authored by 袁思汶
1 parent f8eef888

外分至好友图片类型大小限制同步IM要求

OutSide_Share/src/main/java/com/cnlive/outside_share/activity/ShareIMActivity.java
@@ -408,11 +408,11 @@ public class ShareIMActivity extends AppCompatActivity { @@ -408,11 +408,11 @@ public class ShareIMActivity extends AppCompatActivity {
408 killTime(); 408 killTime();
409 } else if ("wbmp".equals(fileType)) { 409 } else if ("wbmp".equals(fileType)) {
410 File file = new File(path); 410 File file = new File(path);
411 - if (file.length() > FILE_MAX_SIZE) {  
412 - AlertUtil.showDeftToast(context, "文件太大无法发送(文件大小需小于100MB)"); 411 + if (file.length() > IMAGE_MAX_SIZE) {
  412 + AlertUtil.showDeftToast(context, "文件太大无法发送(文件大小需小于25MB)");
413 killTime(); 413 killTime();
414 } else { 414 } else {
415 - startSelectForwardActivity(context, path, TYPE_SHARE_FILE, IN_TYPE_EXT_SHARE); 415 + startSelectForwardActivity(context, path, TYPE_SHARE_IMAGE, IN_TYPE_EXT_SHARE);
416 killTime(); 416 killTime();
417 } 417 }
418 } else if ("video".equals(fileType) || "avi".equals(fileType)) { 418 } else if ("video".equals(fileType) || "avi".equals(fileType)) {
@@ -435,7 +435,12 @@ public class ShareIMActivity extends AppCompatActivity { @@ -435,7 +435,12 @@ public class ShareIMActivity extends AppCompatActivity {
435 killTime(); 435 killTime();
436 } 436 }
437 } else if (path != null && ("jpg".equals(fileType) || "png".equals(fileType) || path.endsWith("png") || path.endsWith("jpg")) && !(imageUri + "").contains("com.tencent.mtt")) { 437 } else if (path != null && ("jpg".equals(fileType) || "png".equals(fileType) || path.endsWith("png") || path.endsWith("jpg")) && !(imageUri + "").contains("com.tencent.mtt")) {
438 - startSelectForwardActivity(context, path, TYPE_SHARE_IMAGE, IN_TYPE_EXT_SHARE); 438 + File file = new File(path);
  439 + if (file.length() > IMAGE_MAX_SIZE) {
  440 + AlertUtil.showDeftToast(context, "文件太大无法发送(文件大小需小于25MB)");
  441 + } else {
  442 + startSelectForwardActivity(context, path, TYPE_SHARE_IMAGE, IN_TYPE_EXT_SHARE);
  443 + }
439 killTime(); 444 killTime();
440 } else if ((equals ? preferences.getString("extratext", null) : bundle.get(TEXT)) != null && 445 } else if ((equals ? preferences.getString("extratext", null) : bundle.get(TEXT)) != null &&
441 bundle != null && !(bundle.get(TEXT) + "").contains("http")) { //腾讯文件Android Q 446 bundle != null && !(bundle.get(TEXT) + "").contains("http")) { //腾讯文件Android Q
@@ -506,12 +511,12 @@ public class ShareIMActivity extends AppCompatActivity { @@ -506,12 +511,12 @@ public class ShareIMActivity extends AppCompatActivity {
506 return; 511 return;
507 } else { 512 } else {
508 File file = new File(pathImg); 513 File file = new File(pathImg);
509 - if (file.length() > FILE_MAX_SIZE) {  
510 - AlertUtil.showDeftToast(context, "文件太大无法发送(文件大小需小于100MB)"); 514 + if (file.length() > IMAGE_MAX_SIZE) {
  515 + AlertUtil.showDeftToast(context, "文件太大无法发送(文件大小需小于25MB)");
511 killTime(); 516 killTime();
512 return; 517 return;
513 } else { 518 } else {
514 - startSelectForwardActivity(context, pathImg, TYPE_SHARE_FILE, IN_TYPE_EXT_SHARE); 519 + startSelectForwardActivity(context, pathImg, TYPE_SHARE_IMAGE, IN_TYPE_EXT_SHARE);
515 } 520 }
516 } 521 }
517 } 522 }
config.gradle
@@ -21,7 +21,7 @@ ext { @@ -21,7 +21,7 @@ ext {
21 //编译方式 21 //编译方式
22 debug : false, 22 debug : false,
23 //版本号 23 //版本号
24 - version: "1.0.3.3", 24 + version: "1.0.3.4",
25 //Lib库前缀 25 //Lib库前缀
26 packeg : "com.cnlive.outside_share", 26 packeg : "com.cnlive.outside_share",
27 //Lib库名称 27 //Lib库名称