mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 06:39:54 +01:00
Merge branch '9-conversation-view' into 'master'
Overhauled Conversation View with Message Bubbles The Conversation View now uses a RecyclerView with 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. There's also a special bubble for unread messages, so they are not overlooked when they come in delayed. 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. See merge request !36
This commit is contained in:
@@ -1,12 +1,18 @@
|
||||
<?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:id="@+id/layout"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<!-- ListView will get inserted here -->
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/conversationView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:scrollbars="vertical"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/listLoadingProgressBar"
|
||||
@@ -15,7 +21,8 @@
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
android:layout_weight="1"
|
||||
android:indeterminate="true"/>
|
||||
android:indeterminate="true"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/emptyView"
|
||||
@@ -26,7 +33,8 @@
|
||||
android:gravity="center"
|
||||
android:padding="@dimen/margin_large"
|
||||
android:textSize="@dimen/text_size_large"
|
||||
android:text="@string/no_private_messages"/>
|
||||
android:text="@string/no_private_messages"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
@@ -39,9 +47,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 +59,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>
|
||||
43
briar-android/res/layout/list_item_msg_in.xml
Normal file
43
briar-android/res/layout/list_item_msg_in.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?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:id="@+id/msgLayout"
|
||||
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>
|
||||
55
briar-android/res/layout/list_item_msg_out.xml
Normal file
55
briar-android/res/layout/list_item_msg_out.xml
Normal file
@@ -0,0 +1,55 @@
|
||||
<?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:id="@+id/msgLayout"
|
||||
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>
|
||||
Reference in New Issue
Block a user