Update UI for Flash notifications

1. Hide the preview button when it's disabled
2. Change the text from “Done” to “Save” in the color selector dialog

Flag: EXEMPT simple UI change
Bug: 356978471
Test: manually, video attached on the bug
Test: atest FlashNotificationsPreviewPreferenceControllerTest
Change-Id: I2e6e697ad10f0207602d613085663cdd82521ea2
This commit is contained in:
Angela Wang
2024-08-02 09:39:59 +00:00
parent b6e0cd99c1
commit 4ad8e0c568
4 changed files with 28 additions and 20 deletions

View File

@@ -110,7 +110,7 @@ public class FlashNotificationsPreviewPreferenceController extends
if (preference == null) {
return;
}
preference.setEnabled(FlashNotificationsUtil.getFlashNotificationsState(mContext)
preference.setVisible(FlashNotificationsUtil.getFlashNotificationsState(mContext)
!= FlashNotificationsUtil.State.OFF);
}
}

View File

@@ -65,8 +65,7 @@ public class ScreenFlashNotificationColorDialogFragment extends DialogFragment i
final ScreenFlashNotificationColorDialogFragment result =
new ScreenFlashNotificationColorDialogFragment();
result.mCurrentColor = initialColor;
result.mConsumer = colorConsumer != null ? colorConsumer : i -> {
};
result.mConsumer = colorConsumer != null ? colorConsumer : i -> {};
return result;
}
@@ -89,7 +88,7 @@ public class ScreenFlashNotificationColorDialogFragment extends DialogFragment i
.setNeutralButton(R.string.flash_notifications_preview, null)
.setNegativeButton(R.string.color_selector_dialog_cancel, (dialog, which) -> {
})
.setPositiveButton(R.string.color_selector_dialog_done, (dialog, which) -> {
.setPositiveButton(R.string.color_selector_dialog_save, (dialog, which) -> {
mCurrentColor = colorSelectorLayout.getCheckedColor(DEFAULT_SCREEN_FLASH_COLOR);
mConsumer.accept(mCurrentColor);
})