Clear thread notification automatically after blocking new ones

This commit is contained in:
Torsten Grote
2021-01-26 15:42:18 -03:00
parent 635008fb60
commit e5d78a858d
6 changed files with 7 additions and 16 deletions

View File

@@ -79,12 +79,6 @@ public class ForumActivity extends
}
}
@Override
public void onStart() {
super.onStart();
viewModel.clearForumPostNotification();
}
@Override
protected void onActivityResult(int request, int result,
@Nullable Intent data) {

View File

@@ -116,7 +116,7 @@ class ForumViewModel extends ThreadListViewModel<ForumPostItem> {
}
}
void clearForumPostNotification() {
protected void clearNotifications() {
notificationManager.clearForumPostNotification(groupId);
}

View File

@@ -84,12 +84,6 @@ public class GroupActivity extends
});
}
@Override
public void onStart() {
super.onStart();
viewModel.clearGroupMessageNotifications();
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu items for use in the action bar

View File

@@ -138,7 +138,7 @@ class GroupViewModel extends ThreadListViewModel<GroupMessageItem> {
loadPrivateGroup(groupId);
}
public void clearGroupMessageNotifications() {
protected void clearNotifications() {
notificationManager.clearGroupMessageNotification(groupId);
}

View File

@@ -110,7 +110,7 @@ public abstract class ThreadListActivity<I extends ThreadItem, A extends ThreadI
@Override
public void onStart() {
super.onStart();
getViewModel().blockNotifications();
getViewModel().blockAndClearNotifications();
list.startPeriodicUpdate();
}

View File

@@ -124,8 +124,11 @@ public abstract class ThreadListViewModel<I extends ThreadItem>
loadSharingContacts();
}
public void blockNotifications() {
protected abstract void clearNotifications();
public void blockAndClearNotifications() {
notificationManager.blockNotification(groupId);
clearNotifications();
}
public void unblockNotifications() {