mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-30 13:35:18 +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)
|
inflater.inflate(R.menu.menu_conversation_muted, menu)
|
||||||
} else {
|
} else {
|
||||||
inflater.inflate(R.menu.menu_conversation_unmuted, menu)
|
inflater.inflate(R.menu.menu_conversation_unmuted, menu)
|
||||||
|
inflater.inflate(R.menu.menu_conversation_notification_settings, menu)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Search
|
// Search
|
||||||
|
@ -237,6 +237,7 @@ public class RecipientDatabase extends Database {
|
|||||||
values.put(NOTIFY_TYPE, notifyType);
|
values.put(NOTIFY_TYPE, notifyType);
|
||||||
updateOrInsert(recipient.getAddress(), values);
|
updateOrInsert(recipient.getAddress(), values);
|
||||||
recipient.resolve().setNotifyType(notifyType);
|
recipient.resolve().setNotifyType(notifyType);
|
||||||
|
notifyConversationListListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setExpireMessages(@NonNull Recipient recipient, int expiration) {
|
public void setExpireMessages(@NonNull Recipient recipient, int expiration) {
|
||||||
|
@ -59,7 +59,7 @@ public class ConversationOptionsBottomSheet : BottomSheetDialogFragment(), View.
|
|||||||
muteNotificationsTextView.isVisible = !recipient.isMuted && !recipient.isLocalNumber
|
muteNotificationsTextView.isVisible = !recipient.isMuted && !recipient.isLocalNumber
|
||||||
unMuteNotificationsTextView.setOnClickListener(this)
|
unMuteNotificationsTextView.setOnClickListener(this)
|
||||||
muteNotificationsTextView.setOnClickListener(this)
|
muteNotificationsTextView.setOnClickListener(this)
|
||||||
notificationsTextView.isVisible = recipient.isGroupRecipient
|
notificationsTextView.isVisible = recipient.isGroupRecipient && !recipient.isMuted
|
||||||
notificationsTextView.setOnClickListener(this)
|
notificationsTextView.setOnClickListener(this)
|
||||||
deleteTextView.setOnClickListener(this)
|
deleteTextView.setOnClickListener(this)
|
||||||
}
|
}
|
||||||
|
@ -13,8 +13,4 @@
|
|||||||
android:title="@string/conversation__menu_leave_group"
|
android:title="@string/conversation__menu_leave_group"
|
||||||
app:showAsAction="collapseActionView"/>
|
app:showAsAction="collapseActionView"/>
|
||||||
|
|
||||||
<item
|
|
||||||
android:title="@string/RecipientPreferenceActivity_notification_settings"
|
|
||||||
android:id="@+id/menu_notification_settings"/>
|
|
||||||
|
|
||||||
</menu>
|
</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:title="@string/ConversationActivity_invite_to_open_group"
|
||||||
android:id="@+id/menu_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>
|
</menu>
|
Loading…
Reference in New Issue
Block a user