Skip to content

Commit

Permalink
修复列表选择到最大数量后,滑动列表会出现未选中Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay committed Dec 20, 2017
1 parent 9f8657b commit 3c07429
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,18 +328,20 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
String data = resource.data;
resource.isChecked = isChecked;
if (isChecked) {
if (mSelectResources.size() == max) {
buttonView.setChecked(false);
Toast.makeText(this, getString(R.string.daguerre_max_select, max), Toast.LENGTH_SHORT).show();
return;
}
if (!mSelectResources.contains(data)) {
if (mSelectResources.size() == max) {
buttonView.setChecked(false);
resource.isChecked = false;
Toast.makeText(this, getString(R.string.daguerre_max_select, max), Toast.LENGTH_SHORT).show();
return;
}
mSelectResources.add(data);
}
if (mActionModel == null) {
startSupportActionMode(this);
}
} else {
if (mSelectResources.contains(data))
mSelectResources.remove(data);
}
if (mActionModel != null) {
Expand Down

0 comments on commit 3c07429

Please sign in to comment.