Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #2829 Hide all notifications when clicking on tray actions #2831

Merged
merged 1 commit into from
Feb 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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<>();
keianhzo marked this conversation as resolved.
Show resolved Hide resolved

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