mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Fixes after comments, also removed the CryptoComoponent from the IdentIcons
This commit is contained in:
@@ -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 + ")");
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -124,7 +124,7 @@ implements OnItemSelectedListener, OnClickListener {
|
||||
left.addRule(CENTER_VERTICAL);
|
||||
header.addView(from, left);
|
||||
|
||||
adapter = new LocalAuthorSpinnerAdapter(this, crypto, true);
|
||||
adapter = new LocalAuthorSpinnerAdapter(this, true);
|
||||
spinner = new Spinner(this);
|
||||
spinner.setId(2);
|
||||
spinner.setAdapter(adapter);
|
||||
|
||||
@@ -23,17 +23,14 @@ import static org.briarproject.android.identity.LocalAuthorItem.ANONYMOUS;
|
||||
import static org.briarproject.android.identity.LocalAuthorItem.NEW;
|
||||
|
||||
public class LocalAuthorSpinnerAdapter extends BaseAdapter
|
||||
implements SpinnerAdapter {
|
||||
implements SpinnerAdapter {
|
||||
|
||||
private final Context ctx;
|
||||
private final CryptoComponent crypto;
|
||||
private final boolean includeAnonymous;
|
||||
private final List<LocalAuthorItem> list = new ArrayList<LocalAuthorItem>();
|
||||
|
||||
public LocalAuthorSpinnerAdapter(Context ctx,
|
||||
CryptoComponent crypto, boolean includeAnonymous) {
|
||||
public LocalAuthorSpinnerAdapter(Context ctx, boolean includeAnonymous) {
|
||||
this.ctx = ctx;
|
||||
this.crypto = crypto;
|
||||
this.includeAnonymous = includeAnonymous;
|
||||
}
|
||||
|
||||
@@ -78,7 +75,7 @@ implements SpinnerAdapter {
|
||||
} else {
|
||||
name.setText(item.getLocalAuthor().getName());
|
||||
avatar.setVisibility(View.VISIBLE);
|
||||
avatar.setImageDrawable(new IdenticonDrawable(crypto,
|
||||
avatar.setImageDrawable(new IdenticonDrawable(
|
||||
item.getLocalAuthor().getId().getBytes()));
|
||||
}
|
||||
return view;
|
||||
|
||||
@@ -56,7 +56,7 @@ implements OnItemSelectedListener, OnClickListener {
|
||||
TextView step = (TextView) view.findViewById(R.id.stepView);
|
||||
step.setText(String.format(ctx.getString(R.string.step), 1, 3));
|
||||
|
||||
adapter = new LocalAuthorSpinnerAdapter(ctx, crypto, false);
|
||||
adapter = new LocalAuthorSpinnerAdapter(ctx, false);
|
||||
spinner = (Spinner) view.findViewById(R.id.spinner);
|
||||
spinner.setAdapter(adapter);
|
||||
spinner.setOnItemSelectedListener(this);
|
||||
|
||||
@@ -19,7 +19,6 @@ import im.delight.android.identicons.IdenticonDrawable;
|
||||
|
||||
public class AuthorView extends FrameLayout {
|
||||
|
||||
@Inject protected CryptoComponent crypto;
|
||||
private ImageView avatarView;
|
||||
private TextView nameView;
|
||||
private ImageView statusView;
|
||||
@@ -61,7 +60,7 @@ public class AuthorView extends FrameLayout {
|
||||
} else {
|
||||
nameView.setText(name);
|
||||
avatarView.setImageDrawable(
|
||||
new IdenticonDrawable(crypto, id.getBytes()));
|
||||
new IdenticonDrawable(id.getBytes()));
|
||||
}
|
||||
|
||||
switch(status) {
|
||||
|
||||
Reference in New Issue
Block a user