mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Switched Roboguice/Guice out for Dagger 2
This commit is contained in:
@@ -5,6 +5,7 @@ import android.os.Bundle;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.briarproject.R;
|
||||
import org.briarproject.android.AndroidComponent;
|
||||
import org.briarproject.android.BriarActivity;
|
||||
import org.briarproject.api.android.ReferenceManager;
|
||||
import org.briarproject.api.crypto.CryptoComponent;
|
||||
@@ -38,9 +39,9 @@ implements InvitationListener {
|
||||
private static final Logger LOG =
|
||||
Logger.getLogger(AddContactActivity.class.getName());
|
||||
|
||||
@Inject private CryptoComponent crypto;
|
||||
@Inject private InvitationTaskFactory invitationTaskFactory;
|
||||
@Inject private ReferenceManager referenceManager;
|
||||
@Inject protected CryptoComponent crypto;
|
||||
@Inject protected InvitationTaskFactory invitationTaskFactory;
|
||||
@Inject protected ReferenceManager referenceManager;
|
||||
private AddContactView view = null;
|
||||
private InvitationTask task = null;
|
||||
private long taskHandle = -1;
|
||||
@@ -53,7 +54,7 @@ implements InvitationListener {
|
||||
private String contactName = null;
|
||||
|
||||
// Fields that are accessed from background threads must be volatile
|
||||
@Inject private volatile IdentityManager identityManager;
|
||||
@Inject protected volatile IdentityManager identityManager;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle state) {
|
||||
@@ -138,6 +139,11 @@ implements InvitationListener {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void injectActivity(AndroidComponent component) {
|
||||
component.inject(this);
|
||||
}
|
||||
|
||||
private void showToastAndFinish() {
|
||||
String format = getString(R.string.contact_added_toast);
|
||||
String text = String.format(format, contactName);
|
||||
|
||||
@@ -24,8 +24,6 @@ import java.util.Collection;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
||||
import roboguice.RoboGuice;
|
||||
|
||||
import static android.bluetooth.BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE;
|
||||
import static android.bluetooth.BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION;
|
||||
import static org.briarproject.android.identity.LocalAuthorItem.NEW;
|
||||
@@ -35,7 +33,7 @@ import static org.briarproject.android.invitation.AddContactActivity.REQUEST_CRE
|
||||
class ChooseIdentityView extends AddContactView
|
||||
implements OnItemSelectedListener, OnClickListener {
|
||||
|
||||
@Inject private CryptoComponent crypto;
|
||||
@Inject protected CryptoComponent crypto;
|
||||
private LocalAuthorSpinnerAdapter adapter = null;
|
||||
private Spinner spinner = null;
|
||||
|
||||
@@ -46,7 +44,8 @@ implements OnItemSelectedListener, OnClickListener {
|
||||
void populate() {
|
||||
removeAllViews();
|
||||
Context ctx = getContext();
|
||||
RoboGuice.injectMembers(ctx, this);
|
||||
// TODO
|
||||
// RoboGuice.injectMembers(ctx, this);
|
||||
|
||||
LayoutInflater inflater = (LayoutInflater) ctx.getSystemService
|
||||
(Context.LAYOUT_INFLATER_SERVICE);
|
||||
|
||||
Reference in New Issue
Block a user