Switched Roboguice/Guice out for Dagger 2

This commit is contained in:
Ernir Erlingsson
2016-03-03 10:24:40 +01:00
parent e5d7038195
commit 1be400eb84
89 changed files with 1640 additions and 802 deletions

View File

@@ -17,6 +17,7 @@ import android.widget.ImageButton;
import android.widget.Toast;
import org.briarproject.R;
import org.briarproject.android.AndroidComponent;
import org.briarproject.android.BriarActivity;
import org.briarproject.android.util.BriarRecyclerView;
import org.briarproject.api.FormatException;
@@ -71,10 +72,10 @@ public class ConversationActivity extends BriarActivity
private static final Logger LOG =
Logger.getLogger(ConversationActivity.class.getName());
@Inject private CryptoComponent crypto;
@Inject private AndroidNotificationManager notificationManager;
@Inject private ConnectionRegistry connectionRegistry;
@Inject @CryptoExecutor private Executor cryptoExecutor;
@Inject protected CryptoComponent crypto;
@Inject protected AndroidNotificationManager notificationManager;
@Inject protected ConnectionRegistry connectionRegistry;
@Inject @CryptoExecutor protected Executor cryptoExecutor;
private Map<MessageId, byte[]> bodyCache = new HashMap<MessageId, byte[]>();
private ConversationAdapter adapter = null;
private BriarRecyclerView list = null;
@@ -82,10 +83,10 @@ public class ConversationActivity extends BriarActivity
private ImageButton sendButton = null;
// Fields that are accessed from background threads must be volatile
@Inject private volatile ContactManager contactManager;
@Inject private volatile MessagingManager messagingManager;
@Inject private volatile EventBus eventBus;
@Inject private volatile PrivateMessageFactory privateMessageFactory;
@Inject protected volatile ContactManager contactManager;
@Inject protected volatile MessagingManager messagingManager;
@Inject protected volatile EventBus eventBus;
@Inject protected volatile PrivateMessageFactory privateMessageFactory;
private volatile GroupId groupId = null;
private volatile ContactId contactId = null;
private volatile String contactName = null;
@@ -115,6 +116,11 @@ public class ConversationActivity extends BriarActivity
sendButton.setOnClickListener(this);
}
@Override
public void injectActivity(AndroidComponent component) {
component.inject(this);
}
@Override
public void onResume() {
super.onResume();