Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit e1277c5

Browse files
committed
Extend side color bar to the end of message when contains an image
1 parent f119e12 commit e1277c5

File tree

1 file changed

+64
-61
lines changed

1 file changed

+64
-61
lines changed

app/src/main/res/layout/message_tile.xml

Lines changed: 64 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -8,82 +8,78 @@
88
android:paddingEnd="8dp"
99
android:paddingRight="8dp">
1010

11-
<View
12-
android:id="@+id/leftBar"
13-
android:layout_width="8dp"
14-
android:layout_height="match_parent"
15-
android:layout_alignBottom="@+id/contentView"
16-
android:layout_alignParentTop="true"
17-
android:background="@android:color/holo_blue_dark" />
1811

1912
<LinearLayout
20-
android:id="@+id/senderTile"
2113
android:layout_width="match_parent"
2214
android:layout_height="wrap_content"
15+
android:orientation="vertical"
2316
android:layout_toEndOf="@+id/gravatar"
2417
android:layout_toRightOf="@+id/gravatar"
25-
android:gravity="center_vertical"
26-
android:orientation="horizontal"
27-
android:paddingLeft="8dp"
28-
android:paddingStart="8dp"
29-
tools:background="#FFF">
18+
android:id="@+id/contentBox"
19+
>
3020

31-
<TextView
32-
android:paddingTop="10dp"
33-
android:id="@+id/senderName"
34-
android:layout_width="0dp"
21+
<LinearLayout
22+
android:id="@+id/senderTile"
23+
android:layout_width="match_parent"
3524
android:layout_height="wrap_content"
36-
android:layout_weight="1"
37-
android:textColor="@color/colorTextPrimary"
38-
android:textStyle="bold"
39-
tools:text="Sender &lt;[email protected]&gt;" />
40-
41-
<TextView
42-
android:id="@+id/timestamp"
43-
android:layout_width="wrap_content"
44-
android:layout_height="wrap_content"
45-
android:textColor="@color/colorTextTertiary"
46-
tools:text="17:45" />
25+
android:gravity="center_vertical"
26+
android:orientation="horizontal"
27+
android:paddingLeft="8dp"
28+
android:paddingStart="8dp"
29+
tools:background="#FFF">
4730

31+
<TextView
32+
android:paddingTop="10dp"
33+
android:id="@+id/senderName"
34+
android:layout_width="0dp"
35+
android:layout_height="wrap_content"
36+
android:layout_weight="1"
37+
android:textColor="@color/colorTextPrimary"
38+
android:textStyle="bold"
39+
tools:text="Sender &lt;[email protected]&gt;" />
4840

49-
</LinearLayout>
41+
<TextView
42+
android:id="@+id/timestamp"
43+
android:layout_width="wrap_content"
44+
android:layout_height="wrap_content"
45+
android:textColor="@color/colorTextTertiary"
46+
tools:text="17:45" />
5047

51-
<TextView
52-
android:id="@+id/contentView"
53-
android:layout_width="match_parent"
54-
android:layout_height="wrap_content"
55-
android:layout_below="@+id/senderTile"
56-
android:layout_marginTop="4dp"
57-
android:layout_toEndOf="@+id/gravatar"
58-
android:layout_toRightOf="@+id/gravatar"
59-
android:paddingEnd="16dp"
60-
android:paddingLeft="8dp"
61-
android:paddingRight="16dp"
62-
android:paddingStart="8dp"
63-
tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam mollis pretium purus, faucibus accumsan enim placerat non. " />
6448

65-
<FrameLayout
66-
android:id="@+id/load_image_container"
67-
android:layout_width="match_parent"
68-
android:layout_height="175dp"
69-
android:layout_below="@id/contentView"
70-
android:layout_centerHorizontal="true"
71-
android:layout_marginLeft="16dp"
72-
android:layout_marginTop="20dp"
73-
android:maxHeight="200dp"
74-
android:visibility="gone"
75-
tools:visibility="visible">
49+
</LinearLayout>
7650

77-
<ImageView
78-
android:id="@+id/load_image"
79-
android:layout_width="wrap_content"
51+
<TextView
52+
android:id="@+id/contentView"
53+
android:layout_width="match_parent"
8054
android:layout_height="wrap_content"
81-
android:layout_gravity="center"
82-
android:background="@color/colorAccent"
83-
android:scaleType="centerInside"
84-
tools:src="@drawable/ic_arrow_back_24dp"/>
55+
android:layout_marginTop="4dp"
56+
android:paddingEnd="16dp"
57+
android:paddingLeft="8dp"
58+
android:paddingRight="16dp"
59+
android:paddingStart="8dp"
60+
tools:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam mollis pretium purus, faucibus accumsan enim placerat non. " />
8561

86-
</FrameLayout>
62+
<FrameLayout
63+
android:id="@+id/load_image_container"
64+
android:layout_width="match_parent"
65+
android:layout_height="175dp"
66+
android:layout_marginTop="20dp"
67+
android:maxHeight="200dp"
68+
android:visibility="gone"
69+
tools:visibility="visible">
70+
71+
<ImageView
72+
android:id="@+id/load_image"
73+
android:layout_width="wrap_content"
74+
android:layout_height="wrap_content"
75+
android:layout_gravity="center"
76+
android:background="@color/colorAccent"
77+
android:scaleType="centerInside"
78+
tools:src="@drawable/ic_arrow_back_24dp"/>
79+
80+
</FrameLayout>
81+
82+
</LinearLayout>
8783

8884
<ImageView
8985
android:paddingTop="10dp"
@@ -97,4 +93,11 @@
9793
android:scaleType="centerInside"
9894
android:src="@android:drawable/presence_online" />
9995

96+
<View
97+
android:id="@+id/leftBar"
98+
android:layout_width="8dp"
99+
android:layout_height="match_parent"
100+
android:layout_alignBottom="@id/contentBox"
101+
android:layout_alignParentTop="true"
102+
android:background="@android:color/holo_blue_dark" />
100103
</RelativeLayout>

0 commit comments

Comments
 (0)