Implement UX design for inviting new members to a group

This commit is contained in:
Torsten Grote
2016-10-27 16:36:03 -02:00
parent 47d6fc526f
commit 8448d27d20
8 changed files with 190 additions and 81 deletions

View File

@@ -0,0 +1,50 @@
package org.briarproject.android.privategroup.creation;
import android.content.Intent;
import android.os.Bundle;
import org.briarproject.R;
import org.briarproject.android.ActivityComponent;
import org.briarproject.android.sharing.BaseMessageFragment.MessageFragmentListener;
import org.briarproject.android.sharing.ContactSelectorFragment;
import org.briarproject.api.contact.Contact;
import org.briarproject.api.db.DatabaseExecutor;
import org.briarproject.api.db.DbException;
import org.briarproject.api.sync.GroupId;
public class GroupInviteActivity extends BaseGroupInviteActivity
implements MessageFragmentListener {
@Override
public void injectActivity(ActivityComponent component) {
component.inject(this);
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
// Initialise the group ID,
// it will be saved and restored by the superclass
Intent i = getIntent();
byte[] g = i.getByteArrayExtra(GROUP_ID);
if (g == null) throw new IllegalStateException("No GroupId in intent.");
groupId = new GroupId(g);
if (bundle == null) {
ContactSelectorFragment fragment =
ContactSelectorFragment.newInstance(groupId);
getSupportFragmentManager().beginTransaction()
.replace(R.id.fragmentContainer, fragment)
.commit();
}
}
@Override
@DatabaseExecutor
public boolean isDisabled(GroupId groupId, Contact c) throws DbException {
// TODO disable contacts that can not be invited
return false;
}
}