From f4f16e62a200e8ac051a69a5810cf34a4940776f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Thu, 16 Oct 2014 14:47:36 +0200 Subject: [PATCH] consistency for import UI --- .../ui/adapter/ImportKeysAdapter.java | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java index aabb310d0..a9795cdd1 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/ImportKeysAdapter.java @@ -169,18 +169,27 @@ public class ImportKeysAdapter extends ArrayAdapter { } if (entry.isRevoked()) { - holder.status.setVisibility(View.VISIBLE); - KeyFormattingUtils.setStatusImage(getContext(), holder.status, KeyFormattingUtils.STATE_REVOKED); - // no more space for algorithm display - holder.algorithm.setVisibility(View.GONE); + KeyFormattingUtils.setStatusImage(getContext(), holder.status, null, KeyFormattingUtils.STATE_REVOKED, true); } else if (entry.isExpired()) { + KeyFormattingUtils.setStatusImage(getContext(), holder.status, null, KeyFormattingUtils.STATE_EXPIRED, true); + } + + if (entry.isRevoked() || entry.isExpired()) { holder.status.setVisibility(View.VISIBLE); - KeyFormattingUtils.setStatusImage(getContext(), holder.status, KeyFormattingUtils.STATE_EXPIRED); + // no more space for algorithm display holder.algorithm.setVisibility(View.GONE); + + holder.mainUserId.setTextColor(getContext().getResources().getColor(R.color.bg_gray)); + holder.mainUserIdRest.setTextColor(getContext().getResources().getColor(R.color.bg_gray)); + holder.keyId.setTextColor(getContext().getResources().getColor(R.color.bg_gray)); } else { holder.status.setVisibility(View.GONE); holder.algorithm.setVisibility(View.VISIBLE); + + holder.mainUserId.setTextColor(getContext().getResources().getColor(R.color.black)); + holder.mainUserIdRest.setTextColor(getContext().getResources().getColor(R.color.black)); + holder.keyId.setTextColor(getContext().getResources().getColor(R.color.black)); } if (entry.getUserIds().size() == 1) { @@ -203,6 +212,12 @@ public class ImportKeysAdapter extends ArrayAdapter { uidView.setText(highlighter.highlight(cUserId)); uidView.setPadding(0, 0, FormattingUtils.dpToPx(getContext(), 8), 0); + if (entry.isRevoked() || entry.isExpired()) { + uidView.setTextColor(getContext().getResources().getColor(R.color.bg_gray)); + } else { + uidView.setTextColor(getContext().getResources().getColor(R.color.black)); + } + holder.userIdsList.addView(uidView); for (String email : cEmails) { @@ -212,6 +227,13 @@ public class ImportKeysAdapter extends ArrayAdapter { FormattingUtils.dpToPx(getContext(), 16), 0, FormattingUtils.dpToPx(getContext(), 8), 0); emailView.setText(highlighter.highlight(email)); + + if (entry.isRevoked() || entry.isExpired()) { + emailView.setTextColor(getContext().getResources().getColor(R.color.bg_gray)); + } else { + emailView.setTextColor(getContext().getResources().getColor(R.color.black)); + } + holder.userIdsList.addView(emailView); } }