Make identicons round

This commit renames identicons to avatars in field names, and uses an ImageView
derivative to show the identicons, which should make implementing #214 easier.
This commit is contained in:
str4d
2016-01-26 20:21:35 +00:00
parent 9749eefb90
commit 90eded1421
14 changed files with 78 additions and 34 deletions

View File

@@ -16,11 +16,16 @@ import org.briarproject.android.identity.CreateIdentityActivity;
import org.briarproject.android.identity.LocalAuthorItem;
import org.briarproject.android.identity.LocalAuthorItemComparator;
import org.briarproject.android.identity.LocalAuthorSpinnerAdapter;
import org.briarproject.api.crypto.CryptoComponent;
import org.briarproject.api.identity.AuthorId;
import org.briarproject.api.identity.LocalAuthor;
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;
@@ -30,6 +35,7 @@ import static org.briarproject.android.invitation.AddContactActivity.REQUEST_CRE
class ChooseIdentityView extends AddContactView
implements OnItemSelectedListener, OnClickListener {
@Inject private CryptoComponent crypto;
private LocalAuthorSpinnerAdapter adapter = null;
private Spinner spinner = null;
@@ -40,6 +46,7 @@ implements OnItemSelectedListener, OnClickListener {
void populate() {
removeAllViews();
Context ctx = getContext();
RoboGuice.injectMembers(ctx, this);
LayoutInflater inflater = (LayoutInflater) ctx.getSystemService
(Context.LAYOUT_INFLATER_SERVICE);
@@ -50,7 +57,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, false);
adapter = new LocalAuthorSpinnerAdapter(ctx, crypto, false);
spinner = (Spinner) view.findViewById(R.id.spinner);
spinner.setAdapter(adapter);
spinner.setOnItemSelectedListener(this);