Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

混选模式下出现长度超出 #1511

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -606,11 +606,15 @@ protected void onCheckedComplete() {
if (config.isWithVideoImage) {
// 混选模式
int videoSize = 0;
int imageSize = 0;
for (int i = 0; i < currentSize; i++) {
LocalMedia media = selectData.get(i);
if (PictureMimeType.isHasVideo(media.getMimeType())) {
videoSize++;
}
if (PictureMimeType.isHasImage(media.getMimeType())) {
imageSize++;
}
}
if (image != null && PictureMimeType.isHasVideo(image.getMimeType())) {
if (config.maxVideoSelectNum <= 0) {
Expand All @@ -619,7 +623,7 @@ protected void onCheckedComplete() {
return;
}

if (selectData.size() >= config.maxSelectNum && !check.isSelected()) {
if (imageSize >= config.maxSelectNum && !check.isSelected()) {
showPromptDialog(getString(R.string.picture_message_max_num, config.maxSelectNum));
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,15 @@ private void changeCheckboxState(ViewHolder contentHolder, LocalMedia image) {
if (config.isWithVideoImage) {
// isWithVideoImage mode
int videoSize = 0;
int imageSize = 0;
for (int i = 0; i < count; i++) {
LocalMedia media = selectData.get(i);
if (PictureMimeType.isHasVideo(media.getMimeType())) {
videoSize++;
}
if (PictureMimeType.isHasImage(media.getMimeType())) {
imageSize++;
}
}

if (PictureMimeType.isHasVideo(image.getMimeType())) {
Expand All @@ -429,7 +433,7 @@ private void changeCheckboxState(ViewHolder contentHolder, LocalMedia image) {
return;
}

if (getSelectedSize() >= config.maxSelectNum && !isChecked) {
if (imageSize >= config.maxSelectNum && !isChecked) {
showPromptDialog(context.getString(R.string.picture_message_max_num, config.maxSelectNum));
return;
}
Expand Down