show "Edit Message" instead of "Me" in edition mode

This commit is contained in:
adbenitez
2025-02-20 02:17:52 +01:00
parent 441f943190
commit fce62453d1
5 changed files with 24 additions and 7 deletions
@@ -1440,7 +1440,8 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
msg.getTimestamp(),
author,
text,
slideDeck);
slideDeck,
false);
inputPanel.clickOnComposeInput();
}
@@ -1458,7 +1459,8 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
msg.getTimestamp(),
author,
text,
slideDeck);
slideDeck,
true);
setDraftText(msg.getText());
inputPanel.clickOnComposeInput();
@@ -717,7 +717,8 @@ public class ConversationItem extends BaseConversationItem
author,
quoteTxt,
slideDeck,
current.getType() == DcMsg.DC_MSG_STICKER);
current.getType() == DcMsg.DC_MSG_STICKER,
false);
quoteView.setVisibility(View.VISIBLE);
quoteView.getLayoutParams().width = ViewGroup.LayoutParams.WRAP_CONTENT;
@@ -120,9 +120,10 @@ public class InputPanel extends ConstraintLayout
long id,
@NonNull Recipient author,
@NonNull CharSequence body,
@NonNull SlideDeck attachments)
@NonNull SlideDeck attachments,
@NonNull boolean isEdit)
{
this.quoteView.setQuote(glideRequests, msg, author, body, attachments, false);
this.quoteView.setQuote(glideRequests, msg, author, body, attachments, false, isEdit);
int originalHeight = this.quoteView.getVisibility() == VISIBLE ? this.quoteView.getMeasuredHeight()
: 0;
@@ -60,6 +60,7 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
private SlideDeck attachments;
private int messageType;
private boolean hasSticker;
private boolean isEdit;
public QuoteView(Context context) {
super(context);
@@ -114,13 +115,15 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
@Nullable Recipient author,
@Nullable CharSequence body,
@NonNull SlideDeck attachments,
boolean hasSticker)
boolean hasSticker,
boolean isEdit)
{
quotedMsg = msg;
this.author = author != null ? author.getDcContact() : null;
this.body = body;
this.attachments = attachments;
this.hasSticker = hasSticker;
this.isEdit = isEdit;
if (hasSticker) {
this.setBackgroundResource(R.drawable.conversation_item_update_background);
@@ -144,7 +147,12 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
}
private void setQuoteAuthor(@Nullable Recipient author) {
if (author == null) {
if (isEdit) {
authorView.setVisibility(VISIBLE);
authorView.setTextColor(getEditColor());
quoteBarView.setBackgroundColor(getEditColor());
authorView.setText(getContext().getString(R.string.edit_message));
} else if (author == null) {
authorView.setVisibility(GONE);
quoteBarView.setBackgroundColor(getForwardedColor());
} else if (quotedMsg.isForwarded()) {
@@ -272,4 +280,8 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
private int getForwardedColor() {
return getResources().getColor(hasSticker? R.color.core_dark_05 : R.color.unknown_sender);
}
private int getEditColor() {
return getResources().getColor(R.color.delta_accent);
}
}