Skip to content

Commit

Permalink
Hide all notifications when clicking on tray actions (#2831)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo committed Feb 21, 2020
1 parent 2e7e67f commit 8f4044a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
import org.mozilla.vrbrowser.ui.views.UIButton;
import org.mozilla.vrbrowser.ui.widgets.NotificationManager.Notification.NotificationPosition;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class NotificationManager {

private static final int DEFAULT_DURATION = 3000;

private static HashMap<Integer, NotificationData> mData = new HashMap<>();
private static ConcurrentHashMap<Integer, NotificationData> mData = new ConcurrentHashMap<>();

private static class NotificationData {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,22 +247,27 @@ public void removeListeners(TrayListener... listeners) {
}

private void notifyBookmarksClicked() {
hideNotifications();
mTrayListeners.forEach(TrayListener::onBookmarksClicked);
}

private void notifyHistoryClicked() {
hideNotifications();
mTrayListeners.forEach(TrayListener::onHistoryClicked);
}

private void notifyTabsClicked() {
hideNotifications();
mTrayListeners.forEach(TrayListener::onTabsClicked);
}

private void notifyPrivateBrowsingClicked() {
hideNotifications();
mTrayListeners.forEach(TrayListener::onPrivateBrowsingClicked);
}

private void notifyAddWindowClicked() {
hideNotifications();
mTrayListeners.forEach(TrayListener::onAddWindowClicked);
}

Expand Down

0 comments on commit 8f4044a

Please sign in to comment.