mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 09:49:21 +02:00
make in-chat-menu more flexible
This commit is contained in:
parent
2c8ce5b9bc
commit
4e3345a912
4 changed files with 16 additions and 29 deletions
|
@ -428,15 +428,12 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||
return true;
|
||||
}
|
||||
|
||||
if (recipient != null && Prefs.isChatMuted(this, chatId)) {
|
||||
inflater.inflate(R.menu.conversation_muted, menu);
|
||||
}
|
||||
else {
|
||||
inflater.inflate(R.menu.conversation_unmuted, menu);
|
||||
}
|
||||
|
||||
inflater.inflate(R.menu.conversation, menu);
|
||||
|
||||
if(Prefs.isChatMuted(this, chatId)) {
|
||||
menu.findItem(R.id.menu_mute_notifications).setTitle(R.string.menu_unmute);
|
||||
}
|
||||
|
||||
if (!Prefs.isLocationStreamingEnabled(this)) {
|
||||
menu.findItem(R.id.menu_show_map).setVisible(false);
|
||||
}
|
||||
|
@ -469,7 +466,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||
case R.id.menu_archive_chat: handleArchiveChat(); return true;
|
||||
case R.id.menu_delete_chat: handleDeleteChat(); return true;
|
||||
case R.id.menu_mute_notifications: handleMuteNotifications(); return true;
|
||||
case R.id.menu_unmute_notifications: handleUnmuteNotifications(); return true;
|
||||
case R.id.menu_profile: handleProfile(); return true;
|
||||
case R.id.menu_show_map: handleShowMap(); return true;
|
||||
case android.R.id.home: handleReturnToConversationList(); return true;
|
||||
|
@ -525,10 +521,15 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||
}
|
||||
|
||||
private void handleMuteNotifications() {
|
||||
MuteDialog.show(this, until -> {
|
||||
Prefs.setChatMutedUntil(this, chatId, until);
|
||||
titleView.setTitle(glideRequests, dcChat); // update title-mute-icon
|
||||
});
|
||||
if(!Prefs.isChatMuted(this, chatId)) {
|
||||
MuteDialog.show(this, until -> {
|
||||
Prefs.setChatMutedUntil(this, chatId, until);
|
||||
titleView.setTitle(glideRequests, dcChat);
|
||||
});
|
||||
} else {
|
||||
Prefs.setChatMutedUntil(this, chatId, 0);
|
||||
titleView.setTitle(glideRequests, dcChat);
|
||||
}
|
||||
}
|
||||
|
||||
private void handleProfile() {
|
||||
|
@ -541,11 +542,6 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
|||
}
|
||||
}
|
||||
|
||||
private void handleUnmuteNotifications() {
|
||||
Prefs.setChatMutedUntil(this, chatId, 0);
|
||||
titleView.setTitle(glideRequests, dcChat); // update title-mute-icon
|
||||
}
|
||||
|
||||
private void handleLeaveGroup() {
|
||||
new AlertDialog.Builder(this)
|
||||
.setMessage(getString(R.string.ask_leave_group))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue