From cc36db3bb15e10f2a5edbad4a87f6b9aa591b464 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 24 May 2020 13:23:18 +0200 Subject: [PATCH] Info button for cert chain --- .../eu/faircode/email/FragmentMessages.java | 31 ++++++++++--------- .../main/res/layout/dialog_certificate.xml | 15 ++++++++- 2 files changed, 30 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 990ac4144b..195bf7e0e0 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -5786,6 +5786,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. TextView tvEmail = dview.findViewById(R.id.tvEmail); TextView tvEmailInvalid = dview.findViewById(R.id.tvEmailInvalid); TextView tvSubject = dview.findViewById(R.id.tvSubject); + ImageButton ibInfo = dview.findViewById(R.id.ibInfo); TextView tvAfter = dview.findViewById(R.id.tvAfter); TextView tvBefore = dview.findViewById(R.id.tvBefore); TextView tvExpired = dview.findViewById(R.id.tvExpired); @@ -5803,22 +5804,22 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. tvBefore.setText(record.before == null ? null : TF.format(record.before)); tvExpired.setVisibility(record.isExpired(time) ? View.VISIBLE : View.GONE); - if (trace != null && trace.size() > 0) - tvSubject.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < trace.size(); i++) { - if (i > 0) - sb.append("\n\n"); - sb.append(i + 1).append(") ").append(trace.get(i)); - } - - new AlertDialog.Builder(getContext()) - .setMessage(sb.toString()) - .show(); + ibInfo.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < trace.size(); i++) { + if (i > 0) + sb.append("\n\n"); + sb.append(i + 1).append(") ").append(trace.get(i)); } - }); + + new AlertDialog.Builder(getContext()) + .setMessage(sb.toString()) + .show(); + } + }); + ibInfo.setVisibility(trace != null && trace.size() > 0 ? View.VISIBLE : View.GONE); AlertDialog.Builder builder = new AlertDialog.Builder(getContext()) .setView(dview) diff --git a/app/src/main/res/layout/dialog_certificate.xml b/app/src/main/res/layout/dialog_certificate.xml index 3b430ef36c..6305fc66a0 100644 --- a/app/src/main/res/layout/dialog_certificate.xml +++ b/app/src/main/res/layout/dialog_certificate.xml @@ -89,14 +89,27 @@ + +