This repository was archived by the owner on Jul 22, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
app/src/common/shared/org/mozilla/vrbrowser/ui/widgets Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -1190,11 +1190,31 @@ public void onPopUpAvailable() {
11901190 @ Override
11911191 public void onPopUpsCleared () {
11921192 mURLBar .setIsPopUpAvailable (false );
1193+ hidePopUpsBlockedNotification ();
11931194 }
11941195 };
11951196
1197+ private int mBlockedCount ;
1198+
11961199 public void showPopUpsBlockedNotification () {
1197- post (() -> showNotification (mURLBar .getPopUpButton (), R .string .popup_tooltip ));
1200+ final int POP_UP_NOTIFICATION_DELAY = 800 ;
1201+ mBlockedCount ++;
1202+ final int currentCount = mBlockedCount ;
1203+ postDelayed (() -> {
1204+ if (currentCount == mBlockedCount ) {
1205+ showNotification (mURLBar .getPopUpButton (), R .string .popup_tooltip );
1206+ }
1207+ }, POP_UP_NOTIFICATION_DELAY );
1208+ }
1209+
1210+ public void hidePopUpsBlockedNotification () {
1211+ mBlockedCount ++;
1212+ final int currentCount = mBlockedCount ;
1213+ post (() -> {
1214+ if (currentCount == mBlockedCount ) {
1215+ hideNotification (mURLBar .getPopUpButton ());
1216+ }
1217+ });
11981218 }
11991219
12001220 private void showNotification (UIButton button , int stringRes ) {
You can’t perform that action at this time.
0 commit comments