aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/res/layout
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-09-24 20:36:42 +0200
committerChristian Schneppe <christian@pix-art.de>2017-09-24 20:36:42 +0200
commit1f91140e949bfe3d1c7a053527b76a30d24ac294 (patch)
tree0b2d22e49d457d66a294472da3cba8b03642f909 /src/main/res/layout
parent7cf31ad64589d956e02a1c751192d583fd5c8cc4 (diff)
removed duplicate code from message bubble layouts
Diffstat (limited to 'src/main/res/layout')
-rw-r--r--src/main/res/layout/message_content.xml38
-rw-r--r--src/main/res/layout/message_received.xml34
-rw-r--r--src/main/res/layout/message_sent.xml34
3 files changed, 40 insertions, 66 deletions
diff --git a/src/main/res/layout/message_content.xml b/src/main/res/layout/message_content.xml
new file mode 100644
index 000000000..b073868ad
--- /dev/null
+++ b/src/main/res/layout/message_content.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<merge xmlns:android="http://schemas.android.com/apk/res/android"
+xmlns:app="http://schemas.android.com/apk/res-auto">
+
+<com.makeramen.roundedimageview.RoundedImageView
+ android:id="@+id/message_image"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginBottom="4dp"
+ android:layout_marginTop="2dp"
+ android:adjustViewBounds="true"
+ android:longClickable="true"
+ android:maxHeight="500dp"
+ android:maxWidth="500dp"
+ android:scaleType="centerCrop"
+ app:riv_border_color="@color/grey500"
+ app:riv_border_width="1dp"
+ app:riv_corner_radius="5dp" />
+
+<de.pixart.messenger.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="@color/dark"
+ android:textColorHighlight="@color/grey800"
+ android:textColorLink="@color/dark"
+ android:textSize="?attr/TextSizeBody"
+ app:emojiSize="28sp" />
+
+<Button
+ android:id="@+id/download_button"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:longClickable="true"
+ android:visibility="gone" />
+</merge> \ No newline at end of file
diff --git a/src/main/res/layout/message_received.xml b/src/main/res/layout/message_received.xml
index 3704395a4..099448a74 100644
--- a/src/main/res/layout/message_received.xml
+++ b/src/main/res/layout/message_received.xml
@@ -40,39 +40,7 @@
android:orientation="vertical"
android:padding="2dp">
- <com.makeramen.roundedimageview.RoundedImageView
- android:id="@+id/message_image"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="2dp"
- android:layout_marginBottom="4dp"
- android:adjustViewBounds="true"
- app:riv_border_width="1dp"
- app:riv_border_color="@color/grey500"
- app:riv_corner_radius="5dp"
- android:scaleType="centerCrop"
- android:longClickable="true"
- android:maxHeight="500dp"
- android:maxWidth="500dp" />
-
- <de.pixart.messenger.ui.widget.CopyTextView
- android:id="@+id/message_body"
- app:emojiSize="28sp"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:autoLink="web"
- android:longClickable="true"
- android:textColorLink="@color/dark"
- android:textColor="@color/dark"
- android:textColorHighlight="@color/grey800"
- android:textSize="?attr/TextSizeBody" />
-
- <Button
- android:id="@+id/download_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:longClickable="true"
- android:visibility="gone" />
+ <include layout="@layout/message_content"/>
<RelativeLayout
android:id="@+id/aw_player"
diff --git a/src/main/res/layout/message_sent.xml b/src/main/res/layout/message_sent.xml
index 80fae0d02..b19765e79 100644
--- a/src/main/res/layout/message_sent.xml
+++ b/src/main/res/layout/message_sent.xml
@@ -42,39 +42,7 @@
android:orientation="vertical"
android:padding="2dp">
- <com.makeramen.roundedimageview.RoundedImageView
- android:id="@+id/message_image"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_marginTop="2dp"
- android:layout_marginBottom="4dp"
- android:adjustViewBounds="true"
- android:longClickable="true"
- app:riv_border_width="1dp"
- app:riv_border_color="@color/grey500"
- app:riv_corner_radius="5dp"
- android:scaleType="centerCrop"
- android:maxHeight="500dp"
- android:maxWidth="500dp" />
-
- <de.pixart.messenger.ui.widget.CopyTextView
- android:id="@+id/message_body"
- app:emojiSize="28sp"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:autoLink="web"
- android:longClickable="true"
- android:textColorLink="@color/black54"
- android:textColor="@color/black54"
- android:textColorHighlight="@color/grey500"
- android:textSize="?attr/TextSizeBody" />
-
- <Button
- android:id="@+id/download_button"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:longClickable="true"
- android:visibility="gone" />
+ <include layout="@layout/message_content"/>
<Button
android:id="@+id/resend_button"