mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 13:19:52 +01:00
Clear thread notification automatically after blocking new ones
This commit is contained in:
@@ -79,12 +79,6 @@ public class ForumActivity extends
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStart() {
|
|
||||||
super.onStart();
|
|
||||||
viewModel.clearForumPostNotification();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int request, int result,
|
protected void onActivityResult(int request, int result,
|
||||||
@Nullable Intent data) {
|
@Nullable Intent data) {
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ class ForumViewModel extends ThreadListViewModel<ForumPostItem> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearForumPostNotification() {
|
protected void clearNotifications() {
|
||||||
notificationManager.clearForumPostNotification(groupId);
|
notificationManager.clearForumPostNotification(groupId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -84,12 +84,6 @@ public class GroupActivity extends
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onStart() {
|
|
||||||
super.onStart();
|
|
||||||
viewModel.clearGroupMessageNotifications();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(Menu menu) {
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
// Inflate the menu items for use in the action bar
|
// Inflate the menu items for use in the action bar
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ class GroupViewModel extends ThreadListViewModel<GroupMessageItem> {
|
|||||||
loadPrivateGroup(groupId);
|
loadPrivateGroup(groupId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearGroupMessageNotifications() {
|
protected void clearNotifications() {
|
||||||
notificationManager.clearGroupMessageNotification(groupId);
|
notificationManager.clearGroupMessageNotification(groupId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ public abstract class ThreadListActivity<I extends ThreadItem, A extends ThreadI
|
|||||||
@Override
|
@Override
|
||||||
public void onStart() {
|
public void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
getViewModel().blockNotifications();
|
getViewModel().blockAndClearNotifications();
|
||||||
list.startPeriodicUpdate();
|
list.startPeriodicUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -124,8 +124,11 @@ public abstract class ThreadListViewModel<I extends ThreadItem>
|
|||||||
loadSharingContacts();
|
loadSharingContacts();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void blockNotifications() {
|
protected abstract void clearNotifications();
|
||||||
|
|
||||||
|
public void blockAndClearNotifications() {
|
||||||
notificationManager.blockNotification(groupId);
|
notificationManager.blockNotification(groupId);
|
||||||
|
clearNotifications();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unblockNotifications() {
|
public void unblockNotifications() {
|
||||||
|
|||||||
Reference in New Issue
Block a user