Merge branch '461-forum-invitation-can-not-be-accepted-if-forum-already-added' into 'master'

Show all Forum Invitations, not only the first one to prevent cut-offs and forks

This MR solves the problems outlined in #461 by always showing forum invitations, even if the user already subscribed to the forum.

Available Forums have been renamed to Forum Invitations in the UI:

![device-2016-07-07-144141](/uploads/9c8d06decdd19117250e3faca0c38192/device-2016-07-07-144141.png)
![device-2016-07-07-144150](/uploads/9803f567c962a721b24d79359974a29f/device-2016-07-07-144150.png)

Closes #461

See merge request !241
This commit is contained in:
str4d
2016-07-12 23:34:22 +00:00
21 changed files with 333 additions and 162 deletions

View File

@@ -6,8 +6,8 @@
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/listitem_horizontal_margin"
android:layout_marginStart="@dimen/listitem_horizontal_margin"
android:paddingTop="@dimen/listitem_horizontal_margin"
android:background="?attr/selectableItemBackground">
android:background="?attr/selectableItemBackground"
android:paddingTop="@dimen/listitem_horizontal_margin">
<org.briarproject.android.util.TextAvatarView
android:id="@+id/avatarView"
@@ -22,10 +22,12 @@
android:id="@+id/forumNameView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/listitem_horizontal_margin"
android:layout_marginRight="@dimen/listitem_horizontal_margin"
android:layout_toEndOf="@+id/avatarView"
android:layout_toRightOf="@+id/avatarView"
android:maxLines="2"
android:textColor="@android:color/primary_text_light"
android:textColor="@color/briar_primary"
android:textSize="@dimen/text_size_medium"
tools:text="This is a name of a forum that is available"/>
@@ -34,38 +36,55 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/forumNameView"
android:layout_marginBottom="-8dp"
android:layout_marginEnd="@dimen/listitem_horizontal_margin"
android:layout_marginRight="@dimen/listitem_horizontal_margin"
android:layout_toEndOf="@+id/avatarView"
android:layout_toRightOf="@+id/avatarView"
android:paddingTop="@dimen/margin_medium"
android:textColor="@android:color/secondary_text_light"
android:textColor="@color/briar_text_secondary"
android:textSize="@dimen/text_size_small"
tools:text="Shared by Megalox"/>
<TextView
android:id="@+id/forumSubscribedView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/sharedByView"
android:layout_marginEnd="@dimen/listitem_horizontal_margin"
android:layout_marginRight="@dimen/listitem_horizontal_margin"
android:paddingTop="@dimen/margin_medium"
android:text="@string/forum_invitation_exists"
android:textColor="@color/briar_text_tertiary"
android:textSize="@dimen/text_size_small"
tools:visibility="visible"/>
<Button
android:id="@+id/acceptButton"
style="@style/BriarButtonFlat.Positive"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/dialog_button_accept"
android:layout_below="@+id/sharedByView"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true"/>
android:layout_below="@+id/forumSubscribedView"
android:layout_marginTop="-8dp"
android:text="@string/dialog_button_accept"/>
<Button
android:id="@+id/declineButton"
style="@style/BriarButtonFlat.Negative"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/dialog_button_decline"
android:layout_below="@+id/sharedByView"
android:layout_below="@+id/forumSubscribedView"
android:layout_marginTop="-8dp"
android:layout_toLeftOf="@+id/acceptButton"
android:layout_toStartOf="@+id/acceptButton"/>
android:layout_toStartOf="@+id/acceptButton"
android:text="@string/dialog_button_decline"/>
<View style="@style/Divider.ForumList"
android:layout_below="@+id/acceptButton"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"/>
<View
style="@style/Divider.ForumList"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_below="@+id/acceptButton"/>
</RelativeLayout>

View File

@@ -51,7 +51,7 @@
android:layout_alignEnd="@+id/introductionText"
android:layout_alignRight="@+id/introductionText"
android:layout_below="@+id/introductionText"
android:text="@string/forum_show_available"/>
android:text="@string/forum_show_invitations"/>
</RelativeLayout>

View File

@@ -98,7 +98,7 @@
<string name="forum_share_message">Você pode escrever um convite que será enviado aos contatos selecionados.</string>
<string name="forum_invitation_received">%1$s compartilhou o fórum \"%2$s\" com você.</string>
<string name="forum_invitation_sent">Você compartilhou o fórum \"%1$s\" com %2$s.</string>
<string name="forum_show_available">Mostrar fóruns disponíveis</string>
<string name="forum_show_invitations">Mostrar fóruns disponíveis</string>
<string name="forum_compose_post">Nova postagem em fórum</string>
<string name="from">De:</string>
<string name="anonymous">Anônimo</string>

View File

@@ -103,7 +103,7 @@
<string name="forum_share_message">You may compose an optional invitation message that will be sent to the selected contacts.</string>
<string name="forum_invitation_received">%1$s has shared the forum \"%2$s\" with you.</string>
<string name="forum_invitation_sent">You have shared the forum \"%1$s\" with %2$s.</string>
<string name="forum_show_available">Show Available Forums</string>
<string name="forum_show_invitations">Show Forum Invitations</string>
<string name="forum_compose_post">New Forum Post</string>
<string name="from">From:</string>
<string name="anonymous">Anonymous</string>
@@ -112,7 +112,8 @@
<string name="create_identity_button">Create Identity</string>
<string name="identity_created_toast">Identity created</string>
<string name="forum_post_hint">Type forum post</string>
<string name="available_forums_title">Available Forums</string>
<string name="forum_invitations_title">Forum Invitations</string>
<string name="forum_invitation_exists">You accepted an invitation to this forum already. Accepting more invitations will grow and strengthen the communication in the forum.</string>
<string name="forum_joined_toast">Joined Forum</string>
<string name="forum_declined_toast">Forum Invitation Declined</string>
<string name="shared_by_format">Shared by %s</string>