Allow to toggle noquote when forwarding to multiple targets

This commit is contained in:
luvletter2333 2022-02-18 15:50:18 +08:00
parent f438230f13
commit 6512972f30
No known key found for this signature in database
GPG Key ID: A26A8880836E1978
2 changed files with 27 additions and 2 deletions

View File

@ -753,7 +753,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
destroyTextureView();
};
private static boolean noForwardQuote;
public static boolean noForwardQuote;
private TLRPC.ChatParticipant selectedParticipant;
private Paint scrimPaint;

View File

@ -7230,7 +7230,6 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
ActionBarMenuSubItem sendWithoutSound = new ActionBarMenuSubItem(parentActivity, true, true, resourcesProvider);
sendWithoutSound.setTextAndIcon(LocaleController.getString("SendWithoutSound", R.string.SendWithoutSound), R.drawable.baseline_notifications_off_24);
sendWithoutSound.setMinimumWidth(AndroidUtilities.dp(196));
sendPopupLayout2.addView(sendWithoutSound, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 48));
sendWithoutSound.setOnClickListener(v -> {
if (sendPopupWindow != null && sendPopupWindow.isShowing()) {
sendPopupWindow.dismiss();
@ -7242,6 +7241,32 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
delegate.didSelectDialogs(DialogsActivity.this, selectedDialogs, commentView.getFieldText(), false);
});
ActionBarMenuSubItem showSendersNameView = new ActionBarMenuSubItem(parentActivity, true, true, false, resourcesProvider);
showSendersNameView.setTextAndIcon(LocaleController.getString("ShowSendersName", R.string.ShowSendersName), 0);
showSendersNameView.setChecked(!ChatActivity.noForwardQuote);
ActionBarMenuSubItem hideSendersNameView = new ActionBarMenuSubItem(parentActivity, true, false, true, resourcesProvider);
hideSendersNameView.setTextAndIcon(LocaleController.getString("HideSendersName", R.string.HideSendersName), 0);
hideSendersNameView.setChecked(ChatActivity.noForwardQuote);
showSendersNameView.setOnClickListener(e -> {
if (ChatActivity.noForwardQuote) {
ChatActivity.noForwardQuote = false;
showSendersNameView.setChecked(true);
hideSendersNameView.setChecked(false);
}
});
hideSendersNameView.setOnClickListener(e -> {
if (!ChatActivity.noForwardQuote) {
ChatActivity.noForwardQuote = true;
showSendersNameView.setChecked(false);
hideSendersNameView.setChecked(true);
}
});
sendPopupLayout2.addView(showSendersNameView, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 48));
sendPopupLayout2.addView(hideSendersNameView, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 48));
sendPopupLayout2.addView(sendWithoutSound, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, 48));
layout.addView(sendPopupLayout2, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT));
sendPopupWindow = new ActionBarPopupWindow(layout, LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT);