mirror of
https://github.com/ArcaneChat/android.git
synced 2026-07-03 14:05:24 +02:00
show display name of sender in info window
This commit is contained in:
@@ -17,33 +17,6 @@
|
||||
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>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
@@ -79,19 +52,44 @@
|
||||
tools:text="Mango pickle lorem ipsum"/>
|
||||
</LinearLayout>
|
||||
|
||||
<org.thoughtcrime.securesms.components.ConversationItemFooter
|
||||
android:id="@+id/conversation_item_footer"
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="-4dp"
|
||||
android:layout_marginLeft="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginRight="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginBottom="@dimen/message_bubble_bottom_padding"
|
||||
android:layout_gravity="end"
|
||||
android:gravity="end"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:visibility="gone"
|
||||
app:footer_text_color="?attr/conversation_item_outgoing_text_secondary_color"/>
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/message_sender"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="-4dp"
|
||||
android:layout_marginLeft="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginRight="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginBottom="@dimen/message_bubble_bottom_padding"
|
||||
android:layout_gravity="start"
|
||||
android:gravity="start"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
tools:visibility="visible"
|
||||
tools:text="Bob"/>
|
||||
|
||||
<org.thoughtcrime.securesms.components.ConversationItemFooter
|
||||
android:id="@+id/conversation_item_footer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="-4dp"
|
||||
android:layout_marginLeft="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginRight="@dimen/message_bubble_horizontal_padding"
|
||||
android:layout_marginBottom="@dimen/message_bubble_bottom_padding"
|
||||
android:layout_gravity="end"
|
||||
android:gravity="end"
|
||||
android:clipChildren="false"
|
||||
android:clipToPadding="false"
|
||||
android:visibility="gone"
|
||||
app:footer_text_color="?attr/conversation_item_outgoing_text_secondary_color"/>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@@ -14,6 +14,7 @@ import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.b44t.messenger.DcContact;
|
||||
import com.b44t.messenger.DcContext;
|
||||
import com.b44t.messenger.DcMsg;
|
||||
import com.mapbox.geojson.Feature;
|
||||
@@ -32,6 +33,7 @@ import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
|
||||
import static android.view.View.GONE;
|
||||
import static org.thoughtcrime.securesms.map.MapDataManager.CONTACT_ID;
|
||||
import static org.thoughtcrime.securesms.map.MapDataManager.INFO_WINDOW_ID;
|
||||
import static org.thoughtcrime.securesms.map.MapDataManager.MESSAGE_ID;
|
||||
import static org.thoughtcrime.securesms.map.MapDataManager.TIMESTAMP;
|
||||
@@ -78,6 +80,12 @@ public class GenerateInfoWindowTask extends AsyncTask<ArrayList<Feature>, HashMa
|
||||
TextView conversationItemBody = bubbleLayout.findViewById(R.id.conversation_item_body);
|
||||
Locale locale = DynamicLanguage.getSelectedLocale(callbackRef.get().getContext());
|
||||
int messageId = (int) feature.getNumberProperty(MESSAGE_ID);
|
||||
int contactId = (int) feature.getNumberProperty(CONTACT_ID);
|
||||
|
||||
DcContact contact = DcHelper.getContext(callbackRef.get().getContext()).getContact(contactId);
|
||||
TextView contactTextView = bubbleLayout.findViewById(R.id.message_sender);
|
||||
contactTextView.setText(contact.getDisplayName());
|
||||
|
||||
String msgText;
|
||||
if (messageId != 0) {
|
||||
DcContext dcContext = DcHelper.getContext(callbackRef.get().getContext());
|
||||
|
||||
Reference in New Issue
Block a user