Skip to content

Commit 8b11363

Browse files
author
admin
committed
修复了些许bug
1 parent 0e68712 commit 8b11363

File tree

1 file changed

+11
-2
lines changed
  • twocheckboxlibrary/src/main/java/com/pineteree/twocheckboxlibrary

1 file changed

+11
-2
lines changed

twocheckboxlibrary/src/main/java/com/pineteree/twocheckboxlibrary/TwoCheckbox.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
6060
if (isChecked) {
6161
mCheckBox2.setChecked(false);
6262
checkInt = 0;
63+
} else if (mCheckBox2.isChecked()) {
64+
checkInt = 1;
65+
} else if (!mCheckBox1.isChecked() && !mCheckBox2.isChecked()) {
66+
checkInt = 2;
6367
}
6468

6569
}
@@ -86,6 +90,10 @@ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
8690
if (isChecked) {
8791
mCheckBox1.setChecked(false);
8892
checkInt = 1;
93+
} else if (mCheckBox1.isChecked()) {
94+
checkInt = 1;
95+
} else if (!mCheckBox1.isChecked() && !mCheckBox2.isChecked()) {
96+
checkInt = 2;
8997
}
9098

9199
}
@@ -200,8 +208,9 @@ public void setCheckInt(int checkInt) {
200208
/**
201209
* 设置模式
202210
* 必选模式 MODE_MANDATORY = 0;
203-
//可选模式
204-
public static final int MODE_OPTIONAL = 1;
211+
* //可选模式
212+
* public static final int MODE_OPTIONAL = 1;
213+
*
205214
* @param mode
206215
*/
207216
public void setMode(int mode) {

0 commit comments

Comments
 (0)