From 8564c4aca15f3dff339063054e137602dff42567 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Tue, 6 May 2014 00:39:09 +0200 Subject: [PATCH] ui: use primary icon color for certification status --- .../ui/adapter/ViewKeyUserIdsAdapter.java | 19 ++++++++---------- .../key_certify_primary_ok_depth0.png | Bin 0 -> 623 bytes .../key_certify_primary_ok_self.png | Bin 0 -> 473 bytes .../key_certify_primary_ok_depth0.png | Bin 0 -> 505 bytes .../key_certify_primary_ok_self.png | Bin 0 -> 361 bytes .../key_certify_primary_ok_depth0.png | Bin 0 -> 722 bytes .../key_certify_primary_ok_self.png | Bin 0 -> 623 bytes .../key_certify_primary_ok_depth0.png | Bin 0 -> 889 bytes .../key_certify_primary_ok_self.png | Bin 0 -> 890 bytes .../main/res/layout/view_key_userids_item.xml | 6 ------ 10 files changed, 8 insertions(+), 17 deletions(-) create mode 100644 OpenKeychain/src/main/res/drawable-hdpi/key_certify_primary_ok_depth0.png create mode 100644 OpenKeychain/src/main/res/drawable-hdpi/key_certify_primary_ok_self.png create mode 100644 OpenKeychain/src/main/res/drawable-mdpi/key_certify_primary_ok_depth0.png create mode 100644 OpenKeychain/src/main/res/drawable-mdpi/key_certify_primary_ok_self.png create mode 100644 OpenKeychain/src/main/res/drawable-xhdpi/key_certify_primary_ok_depth0.png create mode 100644 OpenKeychain/src/main/res/drawable-xhdpi/key_certify_primary_ok_self.png create mode 100644 OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_primary_ok_depth0.png create mode 100644 OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_primary_ok_self.png diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyUserIdsAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyUserIdsAdapter.java index 05f8f8860..64452e8b4 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyUserIdsAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ViewKeyUserIdsAdapter.java @@ -111,7 +111,6 @@ public class ViewKeyUserIdsAdapter extends CursorAdapter implements AdapterView. TextView vAddress = (TextView) view.findViewById(R.id.address); TextView vComment = (TextView) view.findViewById(R.id.comment); 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)); if (userId[0] != null) { @@ -133,17 +132,11 @@ public class ViewKeyUserIdsAdapter extends CursorAdapter implements AdapterView. } // show small star icon for primary user ids - if (cursor.getInt(mIsPrimary) > 0) { - vPrimaryUserIdIcon.setVisibility(View.VISIBLE); - } else { - vPrimaryUserIdIcon.setVisibility(View.GONE); - } + boolean isPrimary = cursor.getInt(mIsPrimary) != 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); // 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); switch (verified) { 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; 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; default: vVerified.setImageResource(R.drawable.key_certify_error); diff --git a/OpenKeychain/src/main/res/drawable-hdpi/key_certify_primary_ok_depth0.png b/OpenKeychain/src/main/res/drawable-hdpi/key_certify_primary_ok_depth0.png new file mode 100644 index 0000000000000000000000000000000000000000..c07b913049ee2c52b68b8ecc075c8e957ae312dc GIT binary patch literal 623 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaAv7|ftIx;Y9?C1WI$O_~$76-XI zF|0c$^AgBWNcITwWnidMV_;}#VPN!=OyQxA|IB+j6C+sEWX;0wlQW(viLACm!9-<_`cOue?j=?gO-~MZRFDf5|n0~KW$X(qsDq; z*V_hxH@8oTJUAZ8cJScT#a{bg-Ie`u-G;%zg6kw}|Ds-?%T-HUBT7;dOH!?pi&B9U zgOP!uiLQYu5QP{SS{WEynObNY7+Dz@q#W9G07XM?eoAIqC2kF(^SNq(8W=oX{an^L HB{Ts5RU_#; literal 0 HcmV?d00001 diff --git a/OpenKeychain/src/main/res/drawable-hdpi/key_certify_primary_ok_self.png b/OpenKeychain/src/main/res/drawable-hdpi/key_certify_primary_ok_self.png new file mode 100644 index 0000000000000000000000000000000000000000..a1804b2c12020a275f5541c43c52902505ba9102 GIT binary patch literal 473 zcmV;~0Ve*5P)`61rVkE)7#>=@9m>EC? zSl7G)T)X>xQlvmN;6+-?5KtGuGW&2ff!7j_ds`9)HtN@!D z*CuS{4Y&uMfLo2vz#Z`5?lzLt2z=Bt4y!q7G089tDb(k$mfl^_4(f zF>v>j5D+09`3}Mk%ZG?=w~LwK?pJA=ZUNgFPLu!GpP$M1+agm)JWbQ0a{QCD-2Gxw z@TqMY0JHRZGUgL?4@wybN;6$FGb;ka3HWiJp|H^>Cj4dSKi4m!ukVJ|a>7Ov>;g@9KL*;Lg$#<>)>>28=%+D>z$dX!>EDre3*~?V$dqz6 P00000NkvXXu0mjfKR>~n literal 0 HcmV?d00001 diff --git a/OpenKeychain/src/main/res/drawable-mdpi/key_certify_primary_ok_depth0.png b/OpenKeychain/src/main/res/drawable-mdpi/key_certify_primary_ok_depth0.png new file mode 100644 index 0000000000000000000000000000000000000000..e61c1bbb290b58150084c1c82332ee1d27350c37 GIT binary patch literal 505 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstU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f~)?Bm|->U%N{vv0=ddVcr?6rjfxHE^}pPGt!y1S@hbbHGBNn<&X zv@K~HI500?DVb%HJ+Pje4RsHj9Z7q+MBM{+d{+0}fn}2cOkz0%b|t;?w40_QpY8fC zMe?8sfUvu_0Od+^R=IksEr%sYp@?Wi#A<^4YD6?He&POU`VCTEuj={Yi#h-R002ov JPDHLkV1kF84le)z literal 0 HcmV?d00001 diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_primary_ok_depth0.png b/OpenKeychain/src/main/res/drawable-xxhdpi/key_certify_primary_ok_depth0.png new file mode 100644 index 0000000000000000000000000000000000000000..a19eeae90f78856ab60e531dfbdfa0c56ffb5731 GIT binary patch literal 889 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA3?vioaBc-sEa{HEjtmSN`?>!lvI6;x#X;^) z4C~IxyaaL-l0AZa85pY67#JE_7#My5g&JNkFq8sKd6mGxU^Rn*LA+qju0R{0#P$H6 z5Z8tc3^NZH4=wcn|Nk|%E*?NH*pvkM1v4;+gwM2@)iy(UUM|=Cz|iT_tY$aMunQ}i zI{GCw=_ORO_AOp8H+_!3IX_cpqK8?0`y!pns;R~`g3>N}J>@@u<}fCCySvyd&q_QG zvL>4nJa0`PlBg3pY5?EKxmnd@AmAq4Y2mWCRpVWkcGvH9Z-4I( z=WdEpFpSy$KX%`HnHfGtjxX%{pA<>5`kvMhnACgzb(P)Z00xbe0~;MV7qW$!cR6r~ zT>UAeY@eu_y3nU7WJ+uQ?u1pJ#P)OF2@+XVAiiMLvFjR~&e=tm)|t;*Teh5gBEwz3 z-B)w2ytTNw`pevd1tw|2>n2B(*d;!`Sn%MB_TG-;8LuX7FI>)H-z!;r{IcY)($Hrj zDHazhYvkFcOC0D;>9+~aXn48QL{xv8QsPdJy)Pv!tEARhdl*PctPQ&LdfkMSN!M)7 zect+|tU^c6!2j4|-%tF~FEjFm*S4Rt-u#6YjHRteAPbHRMMxW2;#guzl?H4B9ldmsWzdfUN_pj26{tq{9{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