mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-20 18:58:27 +00:00
Cleanup ConversationReactionOverlay
This commit is contained in:
parent
6d528d0e92
commit
cbe90e7bfc
@ -82,6 +82,7 @@ public final class ConversationReactionOverlay extends FrameLayout {
|
|||||||
private View dropdownAnchor;
|
private View dropdownAnchor;
|
||||||
private LinearLayout conversationItem;
|
private LinearLayout conversationItem;
|
||||||
private View conversationBubble;
|
private View conversationBubble;
|
||||||
|
private TextView conversationTimestamp;
|
||||||
private View backgroundView;
|
private View backgroundView;
|
||||||
private ConstraintLayout foregroundView;
|
private ConstraintLayout foregroundView;
|
||||||
private EmojiImageView[] emojiViews;
|
private EmojiImageView[] emojiViews;
|
||||||
@ -118,6 +119,7 @@ public final class ConversationReactionOverlay extends FrameLayout {
|
|||||||
dropdownAnchor = findViewById(R.id.dropdown_anchor);
|
dropdownAnchor = findViewById(R.id.dropdown_anchor);
|
||||||
conversationItem = findViewById(R.id.conversation_item);
|
conversationItem = findViewById(R.id.conversation_item);
|
||||||
conversationBubble = conversationItem.findViewById(R.id.conversation_item_bubble);
|
conversationBubble = conversationItem.findViewById(R.id.conversation_item_bubble);
|
||||||
|
conversationTimestamp = conversationItem.findViewById(R.id.conversation_item_timestamp);
|
||||||
backgroundView = findViewById(R.id.conversation_reaction_scrubber_background);
|
backgroundView = findViewById(R.id.conversation_reaction_scrubber_background);
|
||||||
foregroundView = findViewById(R.id.conversation_reaction_scrubber_foreground);
|
foregroundView = findViewById(R.id.conversation_reaction_scrubber_foreground);
|
||||||
|
|
||||||
@ -169,7 +171,6 @@ public final class ConversationReactionOverlay extends FrameLayout {
|
|||||||
|
|
||||||
conversationBubble.setLayoutParams(new LinearLayout.LayoutParams(conversationItemSnapshot.getWidth(), conversationItemSnapshot.getHeight()));
|
conversationBubble.setLayoutParams(new LinearLayout.LayoutParams(conversationItemSnapshot.getWidth(), conversationItemSnapshot.getHeight()));
|
||||||
conversationBubble.setBackground(new BitmapDrawable(getResources(), conversationItemSnapshot));
|
conversationBubble.setBackground(new BitmapDrawable(getResources(), conversationItemSnapshot));
|
||||||
TextView conversationTimestamp = conversationItem.findViewById(R.id.conversation_item_timestamp);
|
|
||||||
conversationTimestamp.setText(DateUtils.getDisplayFormattedTimeSpanString(getContext(), Locale.getDefault(), messageRecord.getTimestamp()));
|
conversationTimestamp.setText(DateUtils.getDisplayFormattedTimeSpanString(getContext(), Locale.getDefault(), messageRecord.getTimestamp()));
|
||||||
|
|
||||||
updateConversationTimestamp(messageRecord);
|
updateConversationTimestamp(messageRecord);
|
||||||
@ -191,12 +192,8 @@ public final class ConversationReactionOverlay extends FrameLayout {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void updateConversationTimestamp(MessageRecord message) {
|
private void updateConversationTimestamp(MessageRecord message) {
|
||||||
View bubble = conversationItem.findViewById(R.id.conversation_item_bubble);
|
if (message.isOutgoing()) conversationBubble.bringToFront();
|
||||||
View timestamp = conversationItem.findViewById(R.id.conversation_item_timestamp);
|
else conversationTimestamp.bringToFront();
|
||||||
conversationItem.removeAllViewsInLayout();
|
|
||||||
conversationItem.addView(message.isOutgoing() ? timestamp : bubble);
|
|
||||||
conversationItem.addView(message.isOutgoing() ? bubble : timestamp);
|
|
||||||
conversationItem.requestLayout();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showAfterLayout(@NonNull MessageRecord messageRecord,
|
private void showAfterLayout(@NonNull MessageRecord messageRecord,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user