mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-06 03:49:58 +02:00
improve quote style when replying with a sticker
This commit is contained in:
parent
0dccbb9789
commit
e6006c874b
3 changed files with 23 additions and 6 deletions
|
@ -549,6 +549,8 @@ public class ConversationItem extends BaseConversationItem
|
|||
quoteView.dismiss();
|
||||
if (mediaThumbnailStub.resolved()) {
|
||||
ViewUtil.setTopMargin(mediaThumbnailStub.get(), 0);
|
||||
} else if (stickerStub.resolved()) {
|
||||
ViewUtil.setTopMargin(stickerStub.get(), 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -571,7 +573,8 @@ public class ConversationItem extends BaseConversationItem
|
|||
msg,
|
||||
author,
|
||||
quoteTxt,
|
||||
slideDeck);
|
||||
slideDeck,
|
||||
current.getType() == DcMsg.DC_MSG_STICKER);
|
||||
|
||||
quoteView.setVisibility(View.VISIBLE);
|
||||
quoteView.getLayoutParams().width = ViewGroup.LayoutParams.WRAP_CONTENT;
|
||||
|
@ -588,6 +591,8 @@ public class ConversationItem extends BaseConversationItem
|
|||
|
||||
if (mediaThumbnailStub.resolved()) {
|
||||
ViewUtil.setTopMargin(mediaThumbnailStub.get(), readDimen(R.dimen.message_bubble_top_padding));
|
||||
} else if (stickerStub.resolved()) {
|
||||
ViewUtil.setTopMargin(stickerStub.get(), readDimen(R.dimen.message_bubble_top_padding));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -140,7 +140,7 @@ public class InputPanel extends ConstraintLayout
|
|||
@NonNull CharSequence body,
|
||||
@NonNull SlideDeck attachments)
|
||||
{
|
||||
this.quoteView.setQuote(glideRequests, msg, author, body, attachments);
|
||||
this.quoteView.setQuote(glideRequests, msg, author, body, attachments, false);
|
||||
|
||||
int originalHeight = this.quoteView.getVisibility() == VISIBLE ? this.quoteView.getMeasuredHeight()
|
||||
: 0;
|
||||
|
|
|
@ -56,6 +56,7 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
|
|||
private CharSequence body;
|
||||
private SlideDeck attachments;
|
||||
private int messageType;
|
||||
private boolean hasSticker;
|
||||
|
||||
public QuoteView(Context context) {
|
||||
super(context);
|
||||
|
@ -115,13 +116,19 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
|
|||
DcMsg msg,
|
||||
@Nullable Recipient author,
|
||||
@Nullable CharSequence body,
|
||||
@NonNull SlideDeck attachments)
|
||||
@NonNull SlideDeck attachments,
|
||||
boolean hasSticker)
|
||||
{
|
||||
quotedMsg = msg;
|
||||
this.author = author != null ? author.getDcContact() : null;
|
||||
this.body = body;
|
||||
this.attachments = attachments;
|
||||
this.hasSticker = hasSticker;
|
||||
|
||||
if (hasSticker) {
|
||||
this.setBackgroundResource(R.drawable.conversation_item_update_background);
|
||||
bodyView.setTextColor(getResources().getColor(R.color.core_dark_05));
|
||||
}
|
||||
setQuoteAuthor(author);
|
||||
setQuoteText(body, attachments);
|
||||
setQuoteAttachment(glideRequests, attachments);
|
||||
|
@ -161,11 +168,16 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
|
|||
} else {
|
||||
authorView.setVisibility(VISIBLE);
|
||||
authorView.setText(quotedMsg.getSenderName(contact, true));
|
||||
if (hasSticker) {
|
||||
authorView.setTextColor(getResources().getColor(R.color.core_dark_05));
|
||||
quoteBarView.setBackgroundColor(getResources().getColor(R.color.core_dark_05));
|
||||
} else {
|
||||
authorView.setTextColor(Util.rgbToArgbColor(contact.getColor()));
|
||||
quoteBarView.setBackgroundColor(Util.rgbToArgbColor(contact.getColor()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setQuoteText(@Nullable CharSequence body, @NonNull SlideDeck attachments) {
|
||||
if (!TextUtils.isEmpty(body) || !attachments.containsMediaSlide()) {
|
||||
|
@ -233,6 +245,6 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
|
|||
}
|
||||
|
||||
private int getForwardedColor() {
|
||||
return getResources().getColor(R.color.unknown_sender);
|
||||
return getResources().getColor(hasSticker? R.color.core_dark_05 : R.color.unknown_sender);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue