mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
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:
parent
0d0089e3d6
commit
2becf9fabe
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -13,8 +13,4 @@
|
||||
android:title="@string/conversation__menu_leave_group"
|
||||
app:showAsAction="collapseActionView"/>
|
||||
|
||||
<item
|
||||
android:title="@string/RecipientPreferenceActivity_notification_settings"
|
||||
android:id="@+id/menu_notification_settings"/>
|
||||
|
||||
</menu>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item
|
||||
android:title="@string/RecipientPreferenceActivity_notification_settings"
|
||||
android:id="@+id/menu_notification_settings"/>
|
||||
</menu>
|
@ -6,8 +6,4 @@
|
||||
android:title="@string/ConversationActivity_invite_to_open_group"
|
||||
android:id="@+id/menu_invite_to_open_group" />
|
||||
|
||||
<item
|
||||
android:title="@string/RecipientPreferenceActivity_notification_settings"
|
||||
android:id="@+id/menu_notification_settings"/>
|
||||
|
||||
</menu>
|
Loading…
Reference in New Issue
Block a user