Info button for cert chain

pull/178/head
M66B 5 years ago
parent e5751f365f
commit cc36db3bb1

@ -5786,6 +5786,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
TextView tvEmail = dview.findViewById(R.id.tvEmail); TextView tvEmail = dview.findViewById(R.id.tvEmail);
TextView tvEmailInvalid = dview.findViewById(R.id.tvEmailInvalid); TextView tvEmailInvalid = dview.findViewById(R.id.tvEmailInvalid);
TextView tvSubject = dview.findViewById(R.id.tvSubject); TextView tvSubject = dview.findViewById(R.id.tvSubject);
ImageButton ibInfo = dview.findViewById(R.id.ibInfo);
TextView tvAfter = dview.findViewById(R.id.tvAfter); TextView tvAfter = dview.findViewById(R.id.tvAfter);
TextView tvBefore = dview.findViewById(R.id.tvBefore); TextView tvBefore = dview.findViewById(R.id.tvBefore);
TextView tvExpired = dview.findViewById(R.id.tvExpired); 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)); tvBefore.setText(record.before == null ? null : TF.format(record.before));
tvExpired.setVisibility(record.isExpired(time) ? View.VISIBLE : View.GONE); tvExpired.setVisibility(record.isExpired(time) ? View.VISIBLE : View.GONE);
if (trace != null && trace.size() > 0) ibInfo.setOnClickListener(new View.OnClickListener() {
tvSubject.setOnClickListener(new View.OnClickListener() { @Override
@Override public void onClick(View v) {
public void onClick(View v) { StringBuilder sb = new StringBuilder();
StringBuilder sb = new StringBuilder(); for (int i = 0; i < trace.size(); i++) {
for (int i = 0; i < trace.size(); i++) { if (i > 0)
if (i > 0) sb.append("\n\n");
sb.append("\n\n"); sb.append(i + 1).append(") ").append(trace.get(i));
sb.append(i + 1).append(") ").append(trace.get(i));
}
new AlertDialog.Builder(getContext())
.setMessage(sb.toString())
.show();
} }
});
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()) AlertDialog.Builder builder = new AlertDialog.Builder(getContext())
.setView(dview) .setView(dview)

@ -89,14 +89,27 @@
<eu.faircode.email.FixedTextView <eu.faircode.email.FixedTextView
android:id="@+id/tvSubjectTitle" android:id="@+id/tvSubjectTitle"
android:layout_width="wrap_content" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="24dp" android:layout_marginTop="24dp"
android:layout_marginEnd="12dp"
android:text="@string/title_signature_subject" android:text="@string/title_signature_subject"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toStartOf="@+id/ibInfo"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvEmailInvalid" /> app:layout_constraintTop_toBottomOf="@id/tvEmailInvalid" />
<ImageButton
android:id="@+id/ibInfo"
android:layout_width="24dp"
android:layout_height="24dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_info"
android:tooltipText="@string/title_info"
app:layout_constraintBottom_toBottomOf="@id/tvSubjectTitle"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/baseline_info_24" />
<eu.faircode.email.FixedTextView <eu.faircode.email.FixedTextView
android:id="@+id/tvSubject" android:id="@+id/tvSubject"
android:layout_width="wrap_content" android:layout_width="wrap_content"

Loading…
Cancel
Save