Skip to content
Snippets Groups Projects
Commit 83a2552a authored by Torsten Grote's avatar Torsten Grote
Browse files

Merge branch 'contact-list-activity' into 'master'

Use a RecyclerView for the Contact List

This is the first RecyclerView in the project. I am using a SortedList to keep the contacts sorted by latest activity.

Also, I removed the icon footer and moved the icon into ActionBar. I did the same with the long-press contact deletion action which eventually will move to the new contact details activity.

Several icons have been replaced by vector drawables and all the views are now defined in XML.

See merge request !38
parents d46ad6cc 6a954021
No related branches found
No related tags found
No related merge requests found
Showing
with 153 additions and 4 deletions
......@@ -7,6 +7,7 @@ dependencies {
compile project(':briar-core')
compile fileTree(dir: 'libs', include: '*.jar')
compile "com.android.support:appcompat-v7:23.1.1"
compile 'com.android.support:recyclerview-v7:23.1.1'
}
android {
......
briar-android/res/drawable-hdpi/contact_connected.png

1.29 KiB

briar-android/res/drawable-hdpi/contact_disconnected.png

1.11 KiB

briar-android/res/drawable-hdpi/social_add_person.png

1.74 KiB

briar-android/res/drawable-mdpi/contact_connected.png

1 KiB

briar-android/res/drawable-mdpi/contact_disconnected.png

484 B

briar-android/res/drawable-mdpi/social_add_person.png

1.46 KiB

briar-android/res/drawable-xhdpi/contact_connected.png

1.07 KiB

briar-android/res/drawable-xhdpi/contact_disconnected.png

1.14 KiB

briar-android/res/drawable-xhdpi/social_add_person.png

2.05 KiB

<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:alpha="0.56">
<path
android:fillColor="#FF000000"
android:pathData="M12,2 C6.48,2,2,6.48,2,12 S6.48,22,12,22 S22,17.52,22,12 S17.52,2,12,2 Z M12,20
C7.58,20,4,16.42,4,12 S7.58,4,12,4 S20,7.58,20,12 S16.42,20,12,20 Z" />
<path
android:pathData="M0,0 L24,0 L24,24 L0,24 Z" />
<path
android:fillColor="#95d220"
android:strokeWidth="0.76779664"
android:strokeLineJoin="round"
android:strokeLineCap="round"
android:pathData="M10.8972,19.9503 C6.5514,19.3493,3.43091,15.2154,4.0625,10.896
C4.55452,7.53099,7.09451,4.8236,10.394,4.14714
C14.2569,3.35517,18.1698,5.54347,19.5236,9.25295
C20.0698,10.7495,20.1616,12.4612,19.777,13.9758
C19.5457,14.8864,18.8106,16.3388,18.2072,17.0771
C16.4904,19.1779,13.581,20.3215,10.8973,19.9503 Z" />
</vector>
\ No newline at end of file
<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="M12,2C6.48,2 2,6.48 2,12s4.48,10 10,10 10,-4.48 10,-10S17.52,2 12,2zm0,18c-4.42,0 -8,-3.58 -8,-8s3.58,-8 8,-8 8,3.58 8,8 -3.58,8 -8,8z"/>
</vector>
<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="M15,12c2.21,0 4,-1.79 4,-4s-1.79,-4 -4,-4 -4,1.79 -4,4 1.79,4 4,4zm-9,-2V7H4v3H1v2h3v3h2v-3h3v-2H6zm9,4c-2.67,0 -8,1.34 -8,4v2h16v-2c0,-2.66 -5.33,-4 -8,-4z"/>
</vector>
<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="M6,19c0,1.1 0.9,2 2,2h8c1.1,0 2,-0.9 2,-2V7H6v12zM19,4h-3.5l-1,-1h-5l-1,1H5v2h14V4z"/>
</vector>
<?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="match_parent"
android:orientation="vertical"
android:gravity="center">
<android.support.v7.widget.RecyclerView
android:id="@+id/contactList"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:listitem="@layout/list_item_contact"/>
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleLarge"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:indeterminate="true"
android:visibility="gone"/>
<TextView
android:id="@+id/emptyView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/text_size_large"
android:text="@string/no_contacts"
android:visibility="gone"/>
</LinearLayout>
\ No newline at end of file
<?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:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:padding="12dp">
<ImageView
android:id="@+id/bulbView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="@dimen/margin_medium"
android:layout_marginEnd="@dimen/margin_medium"
android:layout_gravity="center_vertical"
tools:src="@drawable/contact_disconnected"/>
<TextView
android:id="@+id/nameView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:layout_marginRight="@dimen/margin_small"
android:layout_marginEnd="@dimen/margin_small"
android:textSize="@dimen/text_size_medium"
android:gravity="center_vertical"
tools:text="This is a name of a contact. It can be quite long."/>
<TextView
android:id="@+id/dateView"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginRight="@dimen/margin_small"
android:layout_marginEnd="@dimen/margin_small"
android:gravity="center_vertical"
android:textColor="@color/no_private_messages"
tools:text="Dec 24"/>
</LinearLayout>
<View style="@style/Divider.Horizontal"/>
</LinearLayout>
\ No newline at end of file
......@@ -5,10 +5,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View
android:layout_width="match_parent"
android:layout_height="1px"
android:background="@color/horizontal_border"/>
<View style="@style/Divider.Horizontal"/>
<GridView
android:id="@+id/transportsView"
......
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_social_remove_person"
android:icon="@drawable/social_remove_person"
app:showAsAction="always"
android:title="@string/delete_contact"/>
</menu>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/action_social_add_person"
android:icon="@drawable/social_add_person"
app:showAsAction="always"
android:title="@string/add_contact_title"/>
</menu>
\ No newline at end of file
......@@ -126,4 +126,6 @@
<!-- Dialogs -->
<string name="dialog_title_lost_password">Lost password</string>
<string name="dialog_message_lost_password">Password recovery is not possible. Do you wish to delete your user, all contacts, and re-register ?</string>
<string name="dialog_title_delete_contact">Confirm Contact Deletion</string>
<string name="dialog_message_delete_contact">Are you sure that you want to remove this contact and all messages exchanged with this contact?</string>
</resources>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment