mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-26 03:40:56 +01:00
Tweak private story reaction UI.
This commit is contained in:
@@ -63,6 +63,7 @@ import com.annimon.stream.Stream;
|
||||
import com.google.android.exoplayer2.MediaItem;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import org.signal.core.util.DimensionUnit;
|
||||
import org.signal.core.util.StringUtil;
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.thoughtcrime.securesms.BindableConversationItem;
|
||||
@@ -82,7 +83,6 @@ import org.thoughtcrime.securesms.components.Outliner;
|
||||
import org.thoughtcrime.securesms.components.PlaybackSpeedToggleTextView;
|
||||
import org.thoughtcrime.securesms.components.QuoteView;
|
||||
import org.thoughtcrime.securesms.components.SharedContactView;
|
||||
import org.thoughtcrime.securesms.components.emoji.EmojiImageView;
|
||||
import org.thoughtcrime.securesms.components.emoji.EmojiTextView;
|
||||
import org.thoughtcrime.securesms.components.mention.MentionAnnotation;
|
||||
import org.thoughtcrime.securesms.contactshare.Contact;
|
||||
@@ -193,7 +193,6 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
||||
protected BadgeImageView badgeImageView;
|
||||
private View storyReactionLabelWrapper;
|
||||
private TextView storyReactionLabel;
|
||||
private EmojiImageView storyReactionEmoji;
|
||||
|
||||
private @NonNull Set<MultiselectPart> batchSelected = new HashSet<>();
|
||||
private @NonNull Outliner outliner = new Outliner();
|
||||
@@ -299,7 +298,6 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
||||
this.badgeImageView = findViewById(R.id.badge);
|
||||
this.storyReactionLabelWrapper = findViewById(R.id.story_reacted_label_holder);
|
||||
this.storyReactionLabel = findViewById(R.id.story_reacted_label);
|
||||
this.storyReactionEmoji = findViewById(R.id.story_reaction_emoji);
|
||||
|
||||
setOnClickListener(new ClickListener(null));
|
||||
|
||||
@@ -1432,7 +1430,9 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
||||
}
|
||||
|
||||
//noinspection ConstantConditions
|
||||
quoteView.setQuote(glideRequests, quote.getId(), Recipient.live(quote.getAuthor()).get(), quote.getDisplayText(), quote.isOriginalMissing(), quote.getAttachment(), chatColors);
|
||||
CharSequence body = isStoryReaction(current) ? current.getBody() : quote.getDisplayText();
|
||||
//noinspection ConstantConditions
|
||||
quoteView.setQuote(glideRequests, quote.getId(), Recipient.live(quote.getAuthor()).get(), body, quote.isOriginalMissing(), quote.getAttachment(), chatColors, isStoryReaction(current));
|
||||
quoteView.setVisibility(View.VISIBLE);
|
||||
quoteView.setTextSize(TypedValue.COMPLEX_UNIT_SP, SignalStore.settings().getMessageFontSize());
|
||||
quoteView.getLayoutParams().width = ViewGroup.LayoutParams.WRAP_CONTENT;
|
||||
@@ -1463,6 +1463,12 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
||||
}
|
||||
}
|
||||
|
||||
if (!isFooterVisible(current, next, isGroupThread) && isStoryReaction(current)) {
|
||||
ViewUtil.setBottomMargin(quoteView, (int) DimensionUnit.DP.toPixels(8));
|
||||
} else {
|
||||
ViewUtil.setBottomMargin(quoteView, 0);
|
||||
}
|
||||
|
||||
if (mediaThumbnailStub.resolved()) {
|
||||
ViewUtil.setTopMargin(mediaThumbnailStub.require(), readDimen(R.dimen.message_bubble_top_padding));
|
||||
}
|
||||
@@ -1553,11 +1559,8 @@ public final class ConversationItem extends RelativeLayout implements BindableCo
|
||||
storyReactionLabelWrapper.setVisibility(View.VISIBLE);
|
||||
storyReactionLabel.setTextColor(record.isOutgoing() ? colorizer.getOutgoingBodyTextColor(context) : ContextCompat.getColor(context, R.color.signal_text_primary));
|
||||
storyReactionLabel.setText(getStoryReactionLabelText(messageRecord));
|
||||
storyReactionEmoji.setImageEmoji(record.getBody());
|
||||
storyReactionEmoji.setVisibility(View.VISIBLE);
|
||||
} else if (storyReactionLabelWrapper != null) {
|
||||
storyReactionLabelWrapper.setVisibility(View.GONE);
|
||||
storyReactionEmoji.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user