diff options
Diffstat (limited to 'chrome/android')
-rw-r--r-- | chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillDialog.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillDialog.java b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillDialog.java index 4f2082e..8f27e03 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillDialog.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/autofill/AutofillDialog.java @@ -274,10 +274,17 @@ public class AutofillDialog extends AlertDialog * @param notifications Array of notifications to be displayed in the dialog. */ public void updateNotificationArea(AutofillDialogNotification[] notifications) { + // Clear all the previous notifications + CheckBox checkBox = ((CheckBox) findViewById(R.id.top_notification)); + checkBox.setVisibility(View.GONE); + ViewGroup notificationsContainer = + ((ViewGroup) findViewById(R.id.bottom_notifications)); + notificationsContainer.removeAllViews(); + + // Add new notifications for (AutofillDialogNotification notification: notifications) { if (notification.mHasArrow && notification.mHasCheckbox) { // Assuming that there will always be only one top notification. - CheckBox checkBox = ((CheckBox) findViewById(R.id.top_notification)); checkBox.setBackgroundColor(notification.mBackgroundColor); checkBox.setTextColor(notification.mTextColor); checkBox.setText(notification.mText); @@ -293,9 +300,6 @@ public class AutofillDialog extends AlertDialog int padding = getContext().getResources(). getDimensionPixelSize(R.dimen.autofill_notification_padding); notificationView.setPadding(padding, padding, padding, padding); - - ViewGroup notificationsContainer = - ((ViewGroup) findViewById(R.id.bottom_notifications)); notificationsContainer.addView(notificationView); notificationsContainer.setVisibility(View.VISIBLE); } |