linphone-android/app/src/main/res/layout/chat_message_reply.xml
2021-07-08 12:58:10 +02:00

83 lines
No EOL
3.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<data>
<import type="android.view.View"/>
<variable
name="cancelClickListener"
type="android.view.View.OnClickListener" />
<variable
name="data"
type="org.linphone.activities.main.chat.data.ChatMessageData" />
</data>
<RelativeLayout
android:background="@{data.chatMessage.isOutgoing ? @color/chat_bubble_outgoing_color : @color/chat_bubble_incoming_color, default=@color/chat_bubble_incoming_color}"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/reply_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:paddingBottom="10dp"
android:layout_marginLeft="10dp"
android:orientation="vertical"
android:layout_toLeftOf="@id/clear_reply">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/chat_message_reply_sender_font"
android:text="@{data.contact.fullName ?? data.displayName, default=Tintin}"/>
<HorizontalScrollView
android:visibility="@{data.contents.size() == 0 ? View.GONE : View.VISIBLE}"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center_vertical"
app:entries="@{data.contents}"
app:layout="@{@layout/chat_message_reply_preview_content_cell}"/>
</HorizontalScrollView>
<TextView
android:visibility="@{data.text.length() == 0 ? View.GONE : View.VISIBLE}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
style="@style/chat_message_reply_font"
android:text="@{data.text, default=`Lorem Ipsum`}"/>
</LinearLayout>
<ImageView
android:id="@+id/clear_reply"
android:onClick="@{cancelClickListener}"
android:contentDescription="@string/content_description_cancel_reply"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="10dp"
android:padding="5dp"
android:src="@drawable/field_clean" />
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="?attr/dividerColor"
android:layout_below="@id/reply_layout"/>
</RelativeLayout>
</layout>