refactor: only display notification settings when the conversation is unmuted, notify the conversation list listeners when notify settings are updated

This commit is contained in:
Harris
2021-07-26 14:50:43 +10:00
parent 0d0089e3d6
commit 2becf9fabe
6 changed files with 9 additions and 9 deletions

View File

@@ -92,6 +92,7 @@ object ConversationMenuHelper {
inflater.inflate(R.menu.menu_conversation_muted, menu)
} else {
inflater.inflate(R.menu.menu_conversation_unmuted, menu)
inflater.inflate(R.menu.menu_conversation_notification_settings, menu)
}
// Search

View File

@@ -237,6 +237,7 @@ public class RecipientDatabase extends Database {
values.put(NOTIFY_TYPE, notifyType);
updateOrInsert(recipient.getAddress(), values);
recipient.resolve().setNotifyType(notifyType);
notifyConversationListListeners();
}
public void setExpireMessages(@NonNull Recipient recipient, int expiration) {

View File

@@ -59,7 +59,7 @@ public class ConversationOptionsBottomSheet : BottomSheetDialogFragment(), View.
muteNotificationsTextView.isVisible = !recipient.isMuted && !recipient.isLocalNumber
unMuteNotificationsTextView.setOnClickListener(this)
muteNotificationsTextView.setOnClickListener(this)
notificationsTextView.isVisible = recipient.isGroupRecipient
notificationsTextView.isVisible = recipient.isGroupRecipient && !recipient.isMuted
notificationsTextView.setOnClickListener(this)
deleteTextView.setOnClickListener(this)
}