Use checkboxes on notification settings pages
Test: make RunSettingsRoboTests Bug: 63927402 Change-Id: Id751b807eae8a7a9165b0d020f10dd42f51382d1
This commit is contained in:
@@ -34,6 +34,7 @@ public class MasterCheckBoxPreference extends TwoTargetPreference {
|
||||
|
||||
private CheckBox mCheckBox;
|
||||
private boolean mChecked;
|
||||
private boolean mEnableCheckBox = true;
|
||||
|
||||
public MasterCheckBoxPreference(Context context, AttributeSet attrs,
|
||||
int defStyleAttr, int defStyleRes) {
|
||||
@@ -88,9 +89,7 @@ public class MasterCheckBoxPreference extends TwoTargetPreference {
|
||||
@Override
|
||||
public void setEnabled(boolean enabled) {
|
||||
super.setEnabled(enabled);
|
||||
if (mCheckBox != null) {
|
||||
mCheckBox.setEnabled(enabled);
|
||||
}
|
||||
setCheckBoxEnabled(enabled);
|
||||
}
|
||||
|
||||
public boolean isChecked() {
|
||||
@@ -104,6 +103,13 @@ public class MasterCheckBoxPreference extends TwoTargetPreference {
|
||||
}
|
||||
}
|
||||
|
||||
public void setCheckBoxEnabled(boolean enabled) {
|
||||
mEnableCheckBox = enabled;
|
||||
if (mCheckBox != null) {
|
||||
mCheckBox.setEnabled(enabled);
|
||||
}
|
||||
}
|
||||
|
||||
public CheckBox getCheckBox() {
|
||||
return mCheckBox;
|
||||
}
|
||||
|
Reference in New Issue
Block a user