diff options
author | aurimas@chromium.org <aurimas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-02 19:50:49 +0000 |
---|---|---|
committer | aurimas@chromium.org <aurimas@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-02 19:50:49 +0000 |
commit | 8852c1f480491964c532d944a31b18e69d55051a (patch) | |
tree | f76f40281dd5941f63915568381d0ab51db01c21 /chrome/android | |
parent | 23fc8faec2a3e4fdfddf477c4cb54909c3d9a435 (diff) | |
download | chromium_src-8852c1f480491964c532d944a31b18e69d55051a.zip chromium_src-8852c1f480491964c532d944a31b18e69d55051a.tar.gz chromium_src-8852c1f480491964c532d944a31b18e69d55051a.tar.bz2 |
[android] Clear old notifications on notification update in AutofillDialog.
Previously the code did not clear the old notifications so on the second
update duplicate notifications would appear.
BUG=178536
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/13467008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191881 0039d316-1c4b-4281-b951-d872f2087c98
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); } |