Disable 'remove' option while setting is selected
Test: robotests Bug: 78916709 Change-Id: Id1dfc3b61a80c2e0677472ae84dc7425116825f0
This commit is contained in:
@@ -65,6 +65,7 @@ public class ZenModeRestrictNotificationsSettings extends ZenModeSettingsBase im
|
|||||||
ZenModeVisEffectsCustomPreferenceController custom =
|
ZenModeVisEffectsCustomPreferenceController custom =
|
||||||
use(ZenModeVisEffectsCustomPreferenceController.class);
|
use(ZenModeVisEffectsCustomPreferenceController.class);
|
||||||
custom.setShownByMenu(mShowMenuSelected);
|
custom.setShownByMenu(mShowMenuSelected);
|
||||||
|
custom.displayPreference(getPreferenceScreen());
|
||||||
|
|
||||||
if (mShowMenuSelected) {
|
if (mShowMenuSelected) {
|
||||||
custom.select();
|
custom.select();
|
||||||
@@ -80,14 +81,20 @@ public class ZenModeRestrictNotificationsSettings extends ZenModeSettingsBase im
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPrepareOptionsMenu(Menu menu) {
|
public void onPrepareOptionsMenu(Menu menu) {
|
||||||
if (mShowMenuSelected && !use(ZenModeVisEffectsCustomPreferenceController.class)
|
if (mShowMenuSelected) {
|
||||||
.areCustomOptionsSelected()) {
|
|
||||||
menu.findItem(APP_MENU_SHOW_CUSTOM)
|
menu.findItem(APP_MENU_SHOW_CUSTOM)
|
||||||
.setTitle(R.string.zen_mode_restrict_notifications_disable_custom);
|
.setTitle(R.string.zen_mode_restrict_notifications_disable_custom);
|
||||||
} else {
|
} else {
|
||||||
menu.findItem(APP_MENU_SHOW_CUSTOM)
|
menu.findItem(APP_MENU_SHOW_CUSTOM)
|
||||||
.setTitle(R.string.zen_mode_restrict_notifications_enable_custom);
|
.setTitle(R.string.zen_mode_restrict_notifications_enable_custom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mShowMenuSelected && use(ZenModeVisEffectsCustomPreferenceController.class)
|
||||||
|
.areCustomOptionsSelected()) {
|
||||||
|
menu.findItem(APP_MENU_SHOW_CUSTOM).setEnabled(false);
|
||||||
|
} else {
|
||||||
|
menu.findItem(APP_MENU_SHOW_CUSTOM).setEnabled(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user