Commit 475b6e140f960c29dece6f4655759cc87fcc8c6c
1 parent
f8eef888
外分至好友图片类型大小限制同步IM要求
Showing
2 changed files
with
13 additions
and
8 deletions
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