From 271e390b9d7469c89b132b8fe04d39b268177956 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Tue, 3 May 2016 18:09:01 -0300 Subject: [PATCH] New List of Forums The adapter of the `ForumListFragment` has been changed into a `BriarRecyclerView` and all its code has been adapted and simplified accordingly. All UI of the forum list is now defined in XML layouts. --- .../res/layout/briar_recycler_view.xml | 1 + .../res/layout/fragment_forum_list.xml | 6 + briar-android/res/layout/list_item_forum.xml | 56 +++++ briar-android/res/values/strings.xml | 7 +- briar-android/res/values/styles.xml | 5 + .../android/forum/ForumListAdapter.java | 213 ++++++++++++---- .../android/forum/ForumListFragment.java | 231 ++++++------------ .../forum/ForumListItemComparator.java | 21 -- 8 files changed, 316 insertions(+), 224 deletions(-) create mode 100644 briar-android/res/layout/fragment_forum_list.xml create mode 100644 briar-android/res/layout/list_item_forum.xml delete mode 100644 briar-android/src/org/briarproject/android/forum/ForumListItemComparator.java diff --git a/briar-android/res/layout/briar_recycler_view.xml b/briar-android/res/layout/briar_recycler_view.xml index 255cbe663..2f3d6fc5a 100644 --- a/briar-android/res/layout/briar_recycler_view.xml +++ b/briar-android/res/layout/briar_recycler_view.xml @@ -24,6 +24,7 @@ android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" + android:padding="@dimen/margin_activity_horizontal" android:textSize="@dimen/text_size_large" android:text="@string/no_data"/> diff --git a/briar-android/res/layout/fragment_forum_list.xml b/briar-android/res/layout/fragment_forum_list.xml new file mode 100644 index 000000000..c823c26c1 --- /dev/null +++ b/briar-android/res/layout/fragment_forum_list.xml @@ -0,0 +1,6 @@ + + diff --git a/briar-android/res/layout/list_item_forum.xml b/briar-android/res/layout/list_item_forum.xml new file mode 100644 index 000000000..8462c1cd6 --- /dev/null +++ b/briar-android/res/layout/list_item_forum.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + diff --git a/briar-android/res/values/strings.xml b/briar-android/res/values/strings.xml index c2ed50e24..e5d21dec3 100644 --- a/briar-android/res/values/strings.xml +++ b/briar-android/res/values/strings.xml @@ -72,7 +72,7 @@ Type message Message sent Forums - No forums + You don\'t have any forums.\n\nWhy don\'t you create a new one yourself or ask your contacts to share one with you? %d forum shared by contacts %d forums shared by contacts @@ -81,6 +81,11 @@ Leave Forum Left Forum No posts + no unread posts + + %d unread post + %d unread posts + New Forum Choose a name for your forum: Create Forum diff --git a/briar-android/res/values/styles.xml b/briar-android/res/values/styles.xml index 22ad6a119..7b328e17f 100644 --- a/briar-android/res/values/styles.xml +++ b/briar-android/res/values/styles.xml @@ -107,6 +107,11 @@ @dimen/margin_large + +