mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
mark forwarded messages as such, closes #74
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
android:clipToPadding="false"
|
||||
android:clipChildren="false"
|
||||
android:background="@color/white"
|
||||
tools:backgroundTint="@color/conversation_blue">
|
||||
tools:backgroundTint="@color/core_light_10">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/group_sender_holder"
|
||||
@@ -80,11 +80,10 @@
|
||||
android:layout_marginEnd="4sp"
|
||||
style="@style/Signal.Text.Preview"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:textColor="?conversation_item_incoming_text_primary_color"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
tools:visibility="visible"
|
||||
tools:text="+14152222222"/>
|
||||
tools:text="Alice"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -38,6 +38,33 @@
|
||||
android:background="@color/white"
|
||||
tools:backgroundTint="@color/core_light_10">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/group_sender_holder"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/message_bubble_top_padding"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginLeft="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginRight="@dimen/message_bubble_horizontal_padding"
|
||||
android:orientation="horizontal"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/group_message_sender"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginRight="4sp"
|
||||
android:layout_marginEnd="4sp"
|
||||
style="@style/Signal.Text.Preview"
|
||||
android:fontFamily="sans-serif-medium"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
tools:visibility="visible"
|
||||
tools:text="Bob"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<org.thoughtcrime.securesms.components.QuoteView
|
||||
android:id="@+id/quote_view"
|
||||
android:layout_width="wrap_content"
|
||||
@@ -90,18 +117,6 @@
|
||||
app:scaleEmojis="true"
|
||||
tools:text="Mango pickle lorem ipsum"/>
|
||||
|
||||
<View
|
||||
android:id="@+id/group_sender_holder"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/group_message_sender"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
<string name="gif">Gif</string>
|
||||
<string name="audio">Audio</string>
|
||||
<string name="voice_message">Voice message</string>
|
||||
<string name="forwarded_message">Forwarded message</string>
|
||||
<string name="video">Video</string>
|
||||
<string name="contact">Contact</string>
|
||||
<string name="camera">Camera</string>
|
||||
@@ -428,7 +429,7 @@
|
||||
<string name="qrshow_join_verified_group_hint">Scan this to join the verified group \"%1$s\".</string>
|
||||
<string name="qrshow_join_verified_group_title">QR invite code</string>
|
||||
<string name="qrshow_join_contact_title">QR verify code</string>
|
||||
<string name="qrshow_join_contact_hint">\"%1$s\" Scan this to set up a verified contact.</string>
|
||||
<string name="qrshow_join_contact_hint">\"%1$s\" Scan this to set up a vefrified contact.</string>
|
||||
|
||||
|
||||
<!-- notifications -->
|
||||
|
||||
@@ -110,7 +110,7 @@ public class ConversationItem extends LinearLayout
|
||||
|
||||
private int incomingBubbleColor;
|
||||
private int outgoingBubbleColor;
|
||||
//private int measureCalls;
|
||||
private int forwardedTitleColor;
|
||||
|
||||
private final PassthroughClickListener passthroughClickListener = new PassthroughClickListener();
|
||||
|
||||
@@ -181,7 +181,7 @@ public class ConversationItem extends LinearLayout
|
||||
}
|
||||
|
||||
setGutterSizes(messageRecord, groupThread);
|
||||
setMessageShape(messageRecord, groupThread);
|
||||
setMessageShape(messageRecord);
|
||||
setMediaAttributes(messageRecord, conversationRecipient, groupThread);
|
||||
setInteractionState(messageRecord, pulseHighlight);
|
||||
setBodyText(messageRecord);
|
||||
@@ -260,12 +260,14 @@ public class ConversationItem extends LinearLayout
|
||||
private void initializeAttributes() {
|
||||
final int[] attributes = new int[] {
|
||||
R.attr.conversation_item_incoming_bubble_color,
|
||||
R.attr.conversation_item_outgoing_bubble_color
|
||||
R.attr.conversation_item_outgoing_bubble_color,
|
||||
R.attr.conversation_item_incoming_text_secondary_color
|
||||
};
|
||||
final TypedArray attrs = context.obtainStyledAttributes(attributes);
|
||||
|
||||
incomingBubbleColor = attrs.getColor(0, Color.WHITE);
|
||||
outgoingBubbleColor = attrs.getColor(1, Color.WHITE);
|
||||
forwardedTitleColor = attrs.getColor(2, Color.BLACK);
|
||||
attrs.recycle();
|
||||
}
|
||||
|
||||
@@ -600,7 +602,11 @@ public class ConversationItem extends LinearLayout
|
||||
}
|
||||
|
||||
private void setGroupMessageStatus() {
|
||||
if (groupThread && !messageRecord.isOutgoing() && dcContact !=null) {
|
||||
if (messageRecord.isForwarded()) {
|
||||
this.groupSender.setText(context.getString(R.string.forwarded_message));
|
||||
this.groupSender.setTextColor(forwardedTitleColor);
|
||||
}
|
||||
else if (groupThread && !messageRecord.isOutgoing() && dcContact !=null) {
|
||||
this.groupSender.setText(dcContact.getDisplayName());
|
||||
|
||||
int rgb = dcContact.getColor();
|
||||
@@ -610,21 +616,27 @@ public class ConversationItem extends LinearLayout
|
||||
}
|
||||
|
||||
private void setAuthor(@NonNull DcMsg current, boolean isGroupThread) {
|
||||
int groupSenderHolderVisibility = GONE;
|
||||
if (isGroupThread && !current.isOutgoing()) {
|
||||
if (contactPhotoHolder != null) {
|
||||
contactPhotoHolder.setVisibility(VISIBLE);
|
||||
}
|
||||
groupSenderHolder.setVisibility(VISIBLE);
|
||||
groupSenderHolderVisibility = VISIBLE;
|
||||
contactPhoto.setVisibility(VISIBLE);
|
||||
} else {
|
||||
groupSenderHolder.setVisibility(GONE);
|
||||
if (contactPhotoHolder != null) {
|
||||
contactPhotoHolder.setVisibility(GONE);
|
||||
}
|
||||
}
|
||||
|
||||
if(current.isForwarded()) {
|
||||
groupSenderHolderVisibility = VISIBLE;
|
||||
}
|
||||
|
||||
groupSenderHolder.setVisibility(groupSenderHolderVisibility);
|
||||
}
|
||||
|
||||
private void setMessageShape(@NonNull DcMsg current, boolean isGroupThread) {
|
||||
private void setMessageShape(@NonNull DcMsg current) {
|
||||
int background;
|
||||
background = current.isOutgoing() ? R.drawable.message_bubble_background_sent_alone
|
||||
: R.drawable.message_bubble_background_received_alone;
|
||||
|
||||
Reference in New Issue
Block a user