mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 03:39:05 +01:00
rebased with master
This commit is contained in:
@@ -13,7 +13,6 @@ import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import org.briarproject.R;
|
||||
import org.briarproject.android.AndroidComponent;
|
||||
import org.briarproject.android.contact.BaseContactListAdapter;
|
||||
import org.briarproject.android.contact.ContactListItem;
|
||||
import org.briarproject.android.fragment.BaseFragment;
|
||||
@@ -63,13 +62,15 @@ public class ContactSelectorFragment extends BaseFragment implements
|
||||
@Inject
|
||||
protected volatile ForumSharingManager forumSharingManager;
|
||||
|
||||
public static ContactSelectorFragment newInstance(GroupId groupId) {
|
||||
Bundle args = new Bundle();
|
||||
args.putByteArray(GROUP_ID, groupId.getBytes());
|
||||
public void initBundle(GroupId groupId) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putByteArray(GROUP_ID, groupId.getBytes());
|
||||
setArguments(bundle);
|
||||
}
|
||||
|
||||
@Inject
|
||||
public ContactSelectorFragment() {
|
||||
|
||||
ContactSelectorFragment fragment = new ContactSelectorFragment();
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -83,11 +84,6 @@ public class ContactSelectorFragment extends BaseFragment implements
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void injectActivity(AndroidComponent component) {
|
||||
component.inject(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
|
||||
@@ -6,7 +6,6 @@ import android.view.View;
|
||||
|
||||
import org.briarproject.R;
|
||||
import org.briarproject.android.ActivityComponent;
|
||||
import org.briarproject.android.AndroidComponent;
|
||||
import org.briarproject.android.BriarActivity;
|
||||
import org.briarproject.android.fragment.BaseFragment;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
@@ -34,7 +33,8 @@ public class ShareForumActivity extends BriarActivity implements
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
ContactSelectorFragment contactSelectorFragment =
|
||||
ContactSelectorFragment.newInstance(groupId);
|
||||
activityComponent.newContactSelectorFragment();
|
||||
contactSelectorFragment.initBundle(groupId);
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.add(R.id.shareForumContainer, contactSelectorFragment)
|
||||
.commit();
|
||||
@@ -42,7 +42,7 @@ public class ShareForumActivity extends BriarActivity implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public void injectActivity(AndroidComponent component) {
|
||||
public void injectActivity(ActivityComponent component) {
|
||||
component.inject(this);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,8 @@ public class ShareForumActivity extends BriarActivity implements
|
||||
Collection<ContactId> contacts) {
|
||||
|
||||
ShareForumMessageFragment messageFragment =
|
||||
ShareForumMessageFragment.newInstance(groupId, contacts);
|
||||
activityComponent.newShareForumMessageFragment();
|
||||
messageFragment.initBundle(groupId, contacts);
|
||||
|
||||
getSupportFragmentManager().beginTransaction()
|
||||
.setCustomAnimations(android.R.anim.fade_in,
|
||||
|
||||
@@ -13,7 +13,6 @@ import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.briarproject.R;
|
||||
import org.briarproject.android.AndroidComponent;
|
||||
import org.briarproject.android.fragment.BaseFragment;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.db.DbException;
|
||||
@@ -45,17 +44,16 @@ public class ShareForumMessageFragment extends BaseFragment {
|
||||
private volatile GroupId groupId;
|
||||
private volatile Collection<ContactId> contacts;
|
||||
|
||||
public static ShareForumMessageFragment newInstance(GroupId groupId,
|
||||
Collection<ContactId> contacts) {
|
||||
public void initBundle(GroupId groupId, Collection<ContactId> contacts) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putByteArray(GROUP_ID, groupId.getBytes());
|
||||
bundle.putIntegerArrayList(CONTACTS, getContactsFromIds(contacts));
|
||||
setArguments(bundle);
|
||||
}
|
||||
|
||||
ShareForumMessageFragment f = new ShareForumMessageFragment();
|
||||
@Inject
|
||||
public ShareForumMessageFragment() {
|
||||
|
||||
Bundle args = new Bundle();
|
||||
args.putByteArray(GROUP_ID, groupId.getBytes());
|
||||
args.putIntegerArrayList(CONTACTS, getContactsFromIds(contacts));
|
||||
f.setArguments(args);
|
||||
|
||||
return f;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,11 +67,6 @@ public class ShareForumMessageFragment extends BaseFragment {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void injectActivity(AndroidComponent component) {
|
||||
component.inject(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
||||
Bundle savedInstanceState) {
|
||||
|
||||
Reference in New Issue
Block a user