Add onPreferenceClickListener to dnd schedule
- Talkback says the preference is clickable Test: manual Bug: 124827588 Change-Id: I1cf5ae564eb0a7ddfa60e1c307f00194f9338a13
This commit is contained in:
@@ -63,6 +63,11 @@ public class ZenAutomaticRuleSwitchPreferenceController extends
|
||||
mSwitchBar.setSwitchBarText(R.string.zen_mode_use_automatic_rule,
|
||||
R.string.zen_mode_use_automatic_rule);
|
||||
try {
|
||||
pref.setOnPreferenceClickListener(preference -> {
|
||||
mRule.setEnabled(!mRule.isEnabled());
|
||||
mBackend.updateZenRule(mId, mRule);
|
||||
return true;
|
||||
});
|
||||
mSwitchBar.addOnSwitchChangeListener(this);
|
||||
} catch (IllegalStateException e) {
|
||||
// an exception is thrown if you try to add the listener twice
|
||||
@@ -71,7 +76,6 @@ public class ZenAutomaticRuleSwitchPreferenceController extends
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void onResume(AutomaticZenRule rule, String id) {
|
||||
mRule = rule;
|
||||
mId = id;
|
||||
|
Reference in New Issue
Block a user