Block blog notifications when viewing combined feed.

This commit is contained in:
akwizgran
2017-07-07 15:34:00 +01:00
parent de2ea112ee
commit 8f8751f4ac
3 changed files with 39 additions and 0 deletions

View File

@@ -600,6 +600,16 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
}
}
@Override
public void clearAllBlogPostNotifications() {
androidExecutor.runOnUiThread(new Runnable() {
@Override
public void run() {
clearBlogPostNotification();
}
});
}
private void showIntroductionNotification() {
androidExecutor.runOnUiThread(new Runnable() {
@Override
@@ -689,4 +699,24 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
}
});
}
@Override
public void blockAllBlogPostNotifications() {
androidExecutor.runOnUiThread(new Runnable() {
@Override
public void run() {
blockBlogs = true;
}
});
}
@Override
public void unblockAllBlogPostNotifications() {
androidExecutor.runOnUiThread(new Runnable() {
@Override
public void run() {
blockBlogs = false;
}
});
}
}

View File

@@ -53,11 +53,14 @@ class FeedControllerImpl extends BaseControllerImpl
public void onStart() {
super.onStart();
if (listener == null) throw new IllegalStateException();
notificationManager.blockAllBlogPostNotifications();
notificationManager.clearAllBlogPostNotifications();
}
@Override
public void onStop() {
super.onStop();
notificationManager.unblockAllBlogPostNotifications();
}
@Override

View File

@@ -28,6 +28,8 @@ public interface AndroidNotificationManager {
void clearBlogPostNotification(GroupId g);
void clearAllBlogPostNotifications();
void blockContactNotification(ContactId c);
void unblockContactNotification(ContactId c);
@@ -35,4 +37,8 @@ public interface AndroidNotificationManager {
void blockNotification(GroupId g);
void unblockNotification(GroupId g);
void blockAllBlogPostNotifications();
void unblockAllBlogPostNotifications();
}