Add enabled preference setting (#1539)

* Add enabled preference setting

* Don't change preference if its not enabled
This commit is contained in:
Mitchell Syer
2025-07-21 15:13:17 -04:00
committed by GitHub
parent 798b9d0c98
commit ac5f1a0d93
3 changed files with 20 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ public class Preference {
protected Context context;
private boolean isVisible;
private boolean isEnabled = true;
private String key;
private CharSequence title;
private CharSequence summary;
@@ -68,7 +69,11 @@ public class Preference {
}
public void setEnabled(boolean enabled) {
throw new RuntimeException("Stub!");
isEnabled = enabled;
}
public boolean isEnabled() {
return isEnabled;
}
public String getKey() {