New Conversation View in XML
It now uses conversation bubbles in alternating colors and vector drawables to indicate message state. The conversation bubbles have been taken from Telegram and can be replaced by a UX designer later. This commit also addresses #9, because message text can now be selected and copied. This is done by using android:textIsSelectable="true" which only works for API level 11 or higher. If we want copy and paste on lower API levels, additional measures have to be implemented.
|
Before Width: | Height: | Size: 479 B |
|
Before Width: | Height: | Size: 284 B |
|
Before Width: | Height: | Size: 323 B |
BIN
briar-android/res/drawable-hdpi/msg_in.9.png
Normal file
|
After Width: | Height: | Size: 957 B |
BIN
briar-android/res/drawable-hdpi/msg_out.9.png
Normal file
|
After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 313 B |
|
Before Width: | Height: | Size: 238 B |
|
Before Width: | Height: | Size: 237 B |
BIN
briar-android/res/drawable-mdpi/msg_in.9.png
Normal file
|
After Width: | Height: | Size: 669 B |
BIN
briar-android/res/drawable-mdpi/msg_out.9.png
Normal file
|
After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 627 B |
|
Before Width: | Height: | Size: 392 B |
|
Before Width: | Height: | Size: 443 B |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 683 B |
BIN
briar-android/res/drawable-xxhdpi/msg_in.9.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
briar-android/res/drawable-xxhdpi/msg_out.9.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 969 B |
5
briar-android/res/drawable/message_delivered.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector android:alpha="0.56" android:height="16dp"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="16dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M18,7l-1.41,-1.41 -6.34,6.34 1.41,1.41L18,7zm4.24,-1.41L11.66,16.17 7.48,12l-1.41,1.41L11.66,19l12,-12 -1.42,-1.41zM0.41,13.41L6,19l1.41,-1.41L1.83,12 0.41,13.41z"/>
|
||||
</vector>
|
||||
5
briar-android/res/drawable/message_sent.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector android:alpha="0.56" android:height="16dp"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="16dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M9,16.17L4.83,12l-1.42,1.41L9,19 21,7l-1.41,-1.41z"/>
|
||||
</vector>
|
||||
5
briar-android/res/drawable/message_stored.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector android:alpha="0.56" android:height="16dp"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="16dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillAlpha=".9" android:fillColor="#FF000000" android:pathData="M11.99,2C6.47,2 2,6.48 2,12s4.47,10 9.99,10C17.52,22 22,17.52 22,12S17.52,2 11.99,2zM12,20c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8zM12.5,7H11v6l5.25,3.15 0.75,-1.23 -4.5,-2.67z"/>
|
||||
</vector>
|
||||
5
briar-android/res/drawable/social_send_now.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<vector android:alpha="0.56" android:height="24dp"
|
||||
android:viewportHeight="24.0" android:viewportWidth="24.0"
|
||||
android:width="24dp" xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<path android:fillColor="#FF000000" android:pathData="M2.01,21L23,12 2.01,3 2,10l15,2 -15,2z"/>
|
||||
</vector>
|
||||
@@ -39,9 +39,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/button_bar_background"
|
||||
android:paddingLeft="@dimen/margin_medium"
|
||||
android:paddingStart="@dimen/margin_medium"
|
||||
android:paddingRight="@dimen/margin_medium"
|
||||
android:paddingEnd="@dimen/margin_medium">
|
||||
android:paddingStart="@dimen/margin_medium">
|
||||
|
||||
<EditText
|
||||
android:id="@+id/contentView"
|
||||
@@ -53,12 +51,16 @@
|
||||
|
||||
<ImageButton
|
||||
android:id="@+id/sendButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="38dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:src="@drawable/social_send_now"
|
||||
android:background="@color/button_bar_background"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:scaleType="fitEnd"
|
||||
android:contentDescription="@string/send"
|
||||
android:layout_gravity="center"/>
|
||||
android:paddingRight="@dimen/margin_medium"
|
||||
android:paddingEnd="@dimen/margin_medium"
|
||||
android:paddingBottom="@dimen/margin_medium"/>
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
42
briar-android/res/layout/list_item_msg_in.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingRight="@dimen/margin_medium"
|
||||
android:paddingEnd="@dimen/margin_medium"
|
||||
android:paddingTop="@dimen/margin_small"
|
||||
android:paddingBottom="@dimen/margin_small">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="left|start"
|
||||
android:background="@drawable/msg_in"
|
||||
android:paddingLeft="17dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingRight="7dp"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/msgBody"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:minWidth="80dp"
|
||||
android:textIsSelectable="true"
|
||||
tools:text="Short message"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/msgTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="10sp"
|
||||
android:textColor="@color/private_message_date"
|
||||
android:layout_below="@+id/msgBody"
|
||||
tools:text="Dec 24, 13:37"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
54
briar-android/res/layout/list_item_msg_out.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/margin_medium"
|
||||
android:paddingStart="@dimen/margin_medium"
|
||||
android:paddingTop="@dimen/margin_small"
|
||||
android:paddingBottom="@dimen/margin_small">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="right|end"
|
||||
android:background="@drawable/msg_out"
|
||||
android:paddingLeft="7dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingRight="17dp"
|
||||
android:paddingBottom="5dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/msgBody"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textIsSelectable="true"
|
||||
android:minWidth="80dp"
|
||||
tools:text="This is a long long long message that spans over several lines.\n\nIt ends here."/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/msgTime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/msgBody"
|
||||
android:layout_toLeftOf="@+id/msgStatus"
|
||||
android:textSize="10sp"
|
||||
android:textColor="@color/private_message_date"
|
||||
android:singleLine="true"
|
||||
tools:text="Dec 24, 13:37"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/msgStatus"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignBottom="@+id/msgTime"
|
||||
android:layout_alignRight="@+id/msgBody"
|
||||
android:layout_alignEnd="@+id/msgBody"
|
||||
android:layout_marginLeft="3dp"
|
||||
tools:src="@drawable/message_delivered"/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -5,7 +5,6 @@
|
||||
<color name="action_bar_background">#2D3E50</color>
|
||||
<color name="button_bar_background">#FFFFFF</color>
|
||||
<color name="dashboard_background">#FFFFFF</color>
|
||||
<color name="private_message_background">#FFFFFF</color>
|
||||
<color name="private_message_date">#AAAAAA</color>
|
||||
<color name="unread_background">#FFFFFF</color>
|
||||
<color name="horizontal_border">#CCCCCC</color>
|
||||
|
||||