Forum Sharing Client UI

This changes `ShareForumActivity` to use two fragments to facilitate
forum sharing with the new Forum Sharing Client backend.

The `ContactSelectorFragment` allows the user to select a
number of contacts. If there is an ongoing sharing session or the forum
is already shared with the contact, it is disabled in the list. If there
is at least one contact selected, a button appears in the toolbar that
brings the user to the `ShareForumMessageFragment` where the user can
write an optional message to be send along with the invitation.

After sending an invitation, the user is brought back to the forum that
she shared and there is a snackbar showing up briefly to indicate the
successful invitation.

The invitation is shown along with the message within the private
conversation of each contact. The person who shares the forum also sees
the invitation and the message as outgoing messages that also display
the current status of the messages.

A notification is shown like for other private messages as well.

Please note that this commit does not include a way for users to respond
to invitations.
This commit is contained in:
Torsten Grote
2016-04-26 20:27:03 -03:00
parent 2cc621ed1b
commit 3a9d66a85f
24 changed files with 1039 additions and 181 deletions

View File

@@ -3,6 +3,7 @@ package org.briarproject.android.contact;
import android.content.Context;
import org.briarproject.R;
import org.briarproject.api.forum.ForumInvitationMessage;
import org.briarproject.api.introduction.IntroductionMessage;
import org.briarproject.api.introduction.IntroductionRequest;
import org.briarproject.api.introduction.IntroductionResponse;
@@ -20,6 +21,8 @@ public abstract class ConversationItem {
final static int INTRODUCTION_OUT = 4;
final static int NOTICE_IN = 5;
final static int NOTICE_OUT = 6;
final static int FORUM_INVITATION_IN = 7;
final static int FORUM_INVITATION_OUT = 8;
private MessageId id;
private long time;
@@ -92,6 +95,14 @@ public abstract class ConversationItem {
}
}
public static ConversationItem from(ForumInvitationMessage fim) {
if (fim.isLocal()) {
return new ConversationForumInvitationOutItem(fim);
} else {
return new ConversationForumInvitationInItem(fim);
}
}
/** This method should not be used to get user-facing objects,
* Its purpose is to provider data for the contact list.
*/