mirror of
https://github.com/topjohnwu/indeterminate-checkbox.git
synced 2024-11-26 21:20:39 +00:00
Add more nullability info
This commit is contained in:
parent
7b320b898f
commit
46865ac6f4
@ -105,13 +105,15 @@ public class IndeterminateCheckBox extends MaterialCheckBox implements Indetermi
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
@ViewDebug.ExportedProperty
|
||||
public Boolean getState() {
|
||||
return mIndeterminate ? null : isChecked();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setState(Boolean state) {
|
||||
public void setState(@Nullable Boolean state) {
|
||||
if (state != null) {
|
||||
setChecked(state);
|
||||
} else {
|
||||
|
@ -2,6 +2,8 @@ package com.topjohnwu.widget;
|
||||
|
||||
import android.widget.Checkable;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* Extension to Checkable interface with addition "indeterminate" state
|
||||
* represented by <code>getState()</code>. Value meanings:
|
||||
@ -11,6 +13,8 @@ import android.widget.Checkable;
|
||||
*/
|
||||
public interface IndeterminateCheckable extends Checkable {
|
||||
|
||||
void setState(Boolean state);
|
||||
void setState(@Nullable Boolean state);
|
||||
|
||||
@Nullable
|
||||
Boolean getState();
|
||||
}
|
||||
|
@ -109,13 +109,15 @@ public class IndeterminateRadioButton extends MaterialRadioButton
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
@ViewDebug.ExportedProperty
|
||||
public Boolean getState() {
|
||||
return mIndeterminate ? null : isChecked();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setState(Boolean state) {
|
||||
public void setState(@Nullable Boolean state) {
|
||||
if (state != null) {
|
||||
setChecked(state);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user