Fixes after comments, also removed the CryptoComoponent from the IdentIcons

This commit is contained in:
Ernir Erlingsson
2016-03-03 23:00:57 +01:00
parent 95d89553d5
commit 5aba1d79f1
16 changed files with 21 additions and 209 deletions

View File

@@ -87,11 +87,9 @@ public class ContactListAdapter
}
});
private Context ctx;
private CryptoComponent crypto;
public ContactListAdapter(Context context, CryptoComponent cryptoComponent) {
public ContactListAdapter(Context context) {
ctx = context;
crypto = cryptoComponent;
}
@Override
@@ -121,7 +119,7 @@ public class ContactListAdapter
Author author = item.getContact().getAuthor();
ui.avatar.setImageDrawable(
new IdenticonDrawable(crypto, author.getId().getBytes()));
new IdenticonDrawable(author.getId().getBytes()));
String contactName = author.getName();
if (unread > 0) {
ui.name.setText(contactName + " (" + unread + ")");

View File

@@ -65,8 +65,6 @@ public class ContactListFragment extends BaseEventFragment {
return TAG;
}
@Inject
protected CryptoComponent crypto;
@Inject
protected ConnectionRegistry connectionRegistry;
private ContactListAdapter adapter = null;
@@ -80,11 +78,6 @@ public class ContactListFragment extends BaseEventFragment {
@Inject
protected volatile EventBus eventBus;
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
}
@Override
public void injectActivity(AndroidComponent component) {
component.inject(this);
@@ -98,7 +91,7 @@ public class ContactListFragment extends BaseEventFragment {
inflater.inflate(R.layout.activity_contact_list, container,
false);
adapter = new ContactListAdapter(getContext(), crypto);
adapter = new ContactListAdapter(getContext());
list = (BriarRecyclerView) contentView.findViewById(R.id.contactList);
list.setLayoutManager(new LinearLayoutManager(getContext()));
list.setAdapter(adapter);

View File

@@ -72,7 +72,6 @@ public class ConversationActivity extends BriarActivity
private static final Logger LOG =
Logger.getLogger(ConversationActivity.class.getName());
@Inject protected CryptoComponent crypto;
@Inject protected AndroidNotificationManager notificationManager;
@Inject protected ConnectionRegistry connectionRegistry;
@Inject @CryptoExecutor protected Executor cryptoExecutor;
@@ -104,7 +103,7 @@ public class ConversationActivity extends BriarActivity
setContentView(R.layout.activity_conversation);
adapter = new ConversationAdapter(this, crypto);
adapter = new ConversationAdapter(this);
list = (BriarRecyclerView) findViewById(R.id.conversationView);
list.setLayoutManager(new LinearLayoutManager(this));
list.setAdapter(adapter);

View File

@@ -73,12 +73,10 @@ class ConversationAdapter extends
}
});
private Context ctx;
private CryptoComponent crypto;
private byte[] identiconKey;
public ConversationAdapter(Context context, CryptoComponent cryptoComponent) {
public ConversationAdapter(Context context) {
ctx = context;
crypto = cryptoComponent;
}
public void setIdenticonKey(byte[] key) {
@@ -133,7 +131,7 @@ class ConversationAdapter extends
} else {
if (identiconKey != null)
ui.avatar.setImageDrawable(
new IdenticonDrawable(crypto, identiconKey));
new IdenticonDrawable(identiconKey));
if (!header.isRead()) {
int left = ui.layout.getPaddingLeft();
int top = ui.layout.getPaddingTop();