diff --git a/briar-android/artwork/empty_state_blog.svg b/briar-android/artwork/empty_state_blog.svg new file mode 100644 index 000000000..eb1cd25c7 --- /dev/null +++ b/briar-android/artwork/empty_state_blog.svg @@ -0,0 +1,91 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/briar-android/artwork/empty_state_contact_list.svg b/briar-android/artwork/empty_state_contact_list.svg new file mode 100644 index 000000000..efc3f10ba --- /dev/null +++ b/briar-android/artwork/empty_state_contact_list.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/briar-android/artwork/empty_state_forum_list.svg b/briar-android/artwork/empty_state_forum_list.svg new file mode 100644 index 000000000..101eca192 --- /dev/null +++ b/briar-android/artwork/empty_state_forum_list.svg @@ -0,0 +1,81 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/briar-android/artwork/empty_state_group_list.svg b/briar-android/artwork/empty_state_group_list.svg new file mode 100644 index 000000000..58e0218d7 --- /dev/null +++ b/briar-android/artwork/empty_state_group_list.svg @@ -0,0 +1,86 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/briar-android/src/main/java/org/briarproject/briar/android/blog/FeedFragment.java b/briar-android/src/main/java/org/briarproject/briar/android/blog/FeedFragment.java index 6d8223681..6c44abbc4 100644 --- a/briar-android/src/main/java/org/briarproject/briar/android/blog/FeedFragment.java +++ b/briar-android/src/main/java/org/briarproject/briar/android/blog/FeedFragment.java @@ -81,7 +81,9 @@ public class FeedFragment extends BaseFragment implements list = v.findViewById(R.id.postList); list.setLayoutManager(layoutManager); list.setAdapter(adapter); + list.setEmptyImage(R.drawable.ic_empty_state_blog); list.setEmptyText(R.string.blogs_feed_empty_state); + list.setEmptyAction(R.string.blogs_feed_empty_state_action); return v; } diff --git a/briar-android/src/main/java/org/briarproject/briar/android/contact/ContactListFragment.java b/briar-android/src/main/java/org/briarproject/briar/android/contact/ContactListFragment.java index 2dc00d67f..5ab78c73c 100644 --- a/briar-android/src/main/java/org/briarproject/briar/android/contact/ContactListFragment.java +++ b/briar-android/src/main/java/org/briarproject/briar/android/contact/ContactListFragment.java @@ -148,7 +148,9 @@ public class ContactListFragment extends BaseFragment implements EventListener { list = contentView.findViewById(R.id.list); list.setLayoutManager(new LinearLayoutManager(getContext())); list.setAdapter(adapter); + list.setEmptyImage(R.drawable.ic_empty_state_contact_list); list.setEmptyText(getString(R.string.no_contacts)); + list.setEmptyAction(getString(R.string.no_contacts_action)); return contentView; } diff --git a/briar-android/src/main/java/org/briarproject/briar/android/contactselection/BaseContactSelectorFragment.java b/briar-android/src/main/java/org/briarproject/briar/android/contactselection/BaseContactSelectorFragment.java index 03e6ff06b..2aaf1cecc 100644 --- a/briar-android/src/main/java/org/briarproject/briar/android/contactselection/BaseContactSelectorFragment.java +++ b/briar-android/src/main/java/org/briarproject/briar/android/contactselection/BaseContactSelectorFragment.java @@ -69,7 +69,9 @@ public abstract class BaseContactSelectorFragment + + + + + + diff --git a/briar-android/src/main/res/drawable/ic_empty_state_contact_list.xml b/briar-android/src/main/res/drawable/ic_empty_state_contact_list.xml new file mode 100644 index 000000000..560b137c5 --- /dev/null +++ b/briar-android/src/main/res/drawable/ic_empty_state_contact_list.xml @@ -0,0 +1,9 @@ + + + diff --git a/briar-android/src/main/res/drawable/ic_empty_state_forum_list.xml b/briar-android/src/main/res/drawable/ic_empty_state_forum_list.xml new file mode 100644 index 000000000..132ec634e --- /dev/null +++ b/briar-android/src/main/res/drawable/ic_empty_state_forum_list.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/briar-android/src/main/res/drawable/ic_empty_state_group_list.xml b/briar-android/src/main/res/drawable/ic_empty_state_group_list.xml new file mode 100644 index 000000000..21f892221 --- /dev/null +++ b/briar-android/src/main/res/drawable/ic_empty_state_group_list.xml @@ -0,0 +1,18 @@ + + + + + + diff --git a/briar-android/src/main/res/layout/briar_recycler_view.xml b/briar-android/src/main/res/layout/briar_recycler_view.xml index ad5012041..b0f9b1b19 100644 --- a/briar-android/src/main/res/layout/briar_recycler_view.xml +++ b/briar-android/src/main/res/layout/briar_recycler_view.xml @@ -1,6 +1,8 @@ - @@ -10,24 +12,77 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:scrollbars="vertical" - tools:listitem="@layout/list_item_contact"/> + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:listitem="@layout/list_item_contact" + tools:visibility="visible"/> + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent" + tools:visibility="invisible"/> - + + + + - \ No newline at end of file + + + \ No newline at end of file diff --git a/briar-android/src/main/res/layout/fragment_forum_list.xml b/briar-android/src/main/res/layout/fragment_forum_list.xml index 6b09a7ff6..2a34c3e78 100644 --- a/briar-android/src/main/res/layout/fragment_forum_list.xml +++ b/briar-android/src/main/res/layout/fragment_forum_list.xml @@ -1,15 +1,11 @@ - - - - - + android:layout_height="match_parent" + app:emptyAction="@string/no_forums_action" + app:emptyImage="@drawable/ic_empty_state_forum_list" + app:emptyText="@string/no_forums" + app:layout_behavior="org.briarproject.briar.android.view.BriarRecyclerViewBehavior"/> diff --git a/briar-android/src/main/res/values/attrs.xml b/briar-android/src/main/res/values/attrs.xml index 8655d2126..d2e212bb7 100644 --- a/briar-android/src/main/res/values/attrs.xml +++ b/briar-android/src/main/res/values/attrs.xml @@ -3,7 +3,9 @@ + + diff --git a/briar-android/src/main/res/values/strings.xml b/briar-android/src/main/res/values/strings.xml index fa73572f3..3b92a01ca 100644 --- a/briar-android/src/main/res/values/strings.xml +++ b/briar-android/src/main/res/values/strings.xml @@ -121,7 +121,8 @@ Sorry - No contacts to show\n\nTap the + icon to add a contact + No contacts to show + Tap the + icon to add a contact No messages. No messages to show Type message @@ -177,7 +178,8 @@ - No groups to show\n\nTap the + icon to create a group, or ask your contacts to share groups with you + No groups to show + Tap the + icon to create a group, or ask your contacts to share groups with you Created by %s %d message @@ -233,7 +235,8 @@ Contact relationship is not visible to the group - No forums to show\n\nTap the + icon to create a forum, or ask your contacts to share forums with you + No forums to show + Tap the + icon to create a forum, or ask your contacts to share forums with you Create Forum Choose a name for your forum Create Forum @@ -258,7 +261,8 @@ Share Forum Contacts selected Choose Contacts - No contacts to show\n\nPlease come back here after adding a contact + No contacts to show + Please come back here after adding a contact Forum shared with chosen contacts Add a message (optional) There was an error sharing this forum. @@ -293,7 +297,8 @@ Blog Post Created New Blog Post Received Scroll To - No posts to show\n\nPosts from your contacts and blogs you subscribe to will appear here\n\nTap the pen icon to write a post + No posts to show + Posts from your contacts and blogs you subscribe to will appear here\n\nTap the pen icon to write a post Remove Blog Are you sure that you want to remove this blog?\n\nPosts will be removed from your device but not from other people\'s devices.\n\nAny contacts you\'ve shared this blog with might stop receiving updates. Remove