ui: use primary icon color for certification status

This commit is contained in:
Vincent Breitmoser 2014-05-06 00:39:09 +02:00
parent d31ae89824
commit 8564c4aca1
10 changed files with 8 additions and 17 deletions

View File

@ -111,7 +111,6 @@ public class ViewKeyUserIdsAdapter extends CursorAdapter implements AdapterView.
TextView vAddress = (TextView) view.findViewById(R.id.address); TextView vAddress = (TextView) view.findViewById(R.id.address);
TextView vComment = (TextView) view.findViewById(R.id.comment); TextView vComment = (TextView) view.findViewById(R.id.comment);
ImageView vVerified = (ImageView) view.findViewById(R.id.certified); ImageView vVerified = (ImageView) view.findViewById(R.id.certified);
ImageView vPrimaryUserIdIcon = (ImageView) view.findViewById(R.id.primary_user_id_icon);
String[] userId = PgpKeyHelper.splitUserId(cursor.getString(mIndexUserId)); String[] userId = PgpKeyHelper.splitUserId(cursor.getString(mIndexUserId));
if (userId[0] != null) { if (userId[0] != null) {
@ -133,17 +132,11 @@ public class ViewKeyUserIdsAdapter extends CursorAdapter implements AdapterView.
} }
// show small star icon for primary user ids // show small star icon for primary user ids
if (cursor.getInt(mIsPrimary) > 0) { boolean isPrimary = cursor.getInt(mIsPrimary) != 0;
vPrimaryUserIdIcon.setVisibility(View.VISIBLE);
} else {
vPrimaryUserIdIcon.setVisibility(View.GONE);
}
if (cursor.getInt(mIsRevoked) > 0) { if (cursor.getInt(mIsRevoked) > 0) {
// no star icon for revoked user ids!
vPrimaryUserIdIcon.setVisibility(View.GONE);
// set revocation icon // set revocation icon (can this even be primary?)
vVerified.setImageResource(R.drawable.key_certify_revoke); vVerified.setImageResource(R.drawable.key_certify_revoke);
// disable and strike through text for revoked user ids // disable and strike through text for revoked user ids
@ -158,10 +151,14 @@ public class ViewKeyUserIdsAdapter extends CursorAdapter implements AdapterView.
int verified = cursor.getInt(mVerifiedId); int verified = cursor.getInt(mVerifiedId);
switch (verified) { switch (verified) {
case Certs.VERIFIED_SECRET: case Certs.VERIFIED_SECRET:
vVerified.setImageResource(R.drawable.key_certify_ok_depth0); vVerified.setImageResource(isPrimary
? R.drawable.key_certify_primary_ok_depth0
: R.drawable.key_certify_ok_depth0);
break; break;
case Certs.VERIFIED_SELF: case Certs.VERIFIED_SELF:
vVerified.setImageResource(R.drawable.key_certify_ok_self); vVerified.setImageResource(isPrimary
? R.drawable.key_certify_primary_ok_self
: R.drawable.key_certify_ok_self);
break; break;
default: default:
vVerified.setImageResource(R.drawable.key_certify_error); vVerified.setImageResource(R.drawable.key_certify_error);

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 473 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 722 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 889 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 890 B

View File

@ -27,12 +27,6 @@
android:id="@+id/certified" android:id="@+id/certified"
android:src="@drawable/key_certify_ok_self" /> android:src="@drawable/key_certify_ok_self" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:id="@+id/primary_user_id_icon"
android:src="@drawable/ic_action_important_small" />
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout