removed duplicate code from message bubble layouts

This commit is contained in:
Daniel Gultsch 2017-09-19 19:02:35 +02:00
parent acc78145db
commit 9733003d0f
3 changed files with 35 additions and 58 deletions

View file

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<ImageView
android:id="@+id/message_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="4dp"
android:layout_marginTop="8dp"
android:adjustViewBounds="true"
android:background="@color/black87"
android:longClickable="true"
android:scaleType="centerCrop"/>
<eu.siacs.conversations.ui.widget.CopyTextView
android:id="@+id/message_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:longClickable="true"
android:textColor="?attr/color_text_primary"
android:textColorHighlight="@color/grey500"
android:textColorLink="@color/black87"
android:textSize="?attr/TextSizeBody"/>
<Button
android:id="@+id/download_button"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:longClickable="true"
android:visibility="gone"/>
</merge>

View file

@ -38,35 +38,7 @@
android:orientation="vertical"
android:padding="2dp">
<ImageView
android:id="@+id/message_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="4dp"
android:adjustViewBounds="true"
android:longClickable="true"
android:background="@color/black87"
android:scaleType="centerCrop" />
<eu.siacs.conversations.ui.widget.CopyTextView
android:id="@+id/message_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:longClickable="true"
android:textColorLink="@color/white"
android:textColor="@color/white"
android:textColorHighlight="@color/grey800"
android:textSize="?attr/TextSizeBody" />
<Button
android:id="@+id/download_button"
style="?android:attr/buttonStyleSmall"
android:longClickable="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
<include layout="@layout/message_content"/>
<LinearLayout
android:layout_width="wrap_content"

View file

@ -39,35 +39,7 @@
android:orientation="vertical"
android:padding="2dp">
<ImageView
android:id="@+id/message_image"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginBottom="4dp"
android:adjustViewBounds="true"
android:background="@color/black87"
android:longClickable="true"
android:scaleType="centerCrop" />
<eu.siacs.conversations.ui.widget.CopyTextView
android:id="@+id/message_body"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:autoLink="web"
android:longClickable="true"
android:textColorLink="@color/black87"
android:textColor="?attr/color_text_primary"
android:textColorHighlight="@color/grey500"
android:textSize="?attr/TextSizeBody" />
<Button
android:id="@+id/download_button"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:longClickable="true"
android:visibility="gone" />
<include layout="@layout/message_content"/>
<LinearLayout
android:layout_width="wrap_content"