Show return path in addresses section / experiments

pull/209/head
M66B 2 years ago
parent e6f2e30149
commit 4b1cb2d840

@ -301,6 +301,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private boolean language_detection;
private List<String> languages;
private boolean experiments;
private static boolean debug;
private int level;
private boolean canDarken;
@ -389,6 +390,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private TextView tvSubmitterTitle;
private TextView tvDeliveredToTitle;
private TextView tvReturnPathTitle;
private TextView tvFromExTitle;
private TextView tvToTitle;
private TextView tvReplyToTitle;
@ -404,6 +406,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private TextView tvSubmitter;
private TextView tvDeliveredTo;
private TextView tvReturnPath;
private TextView tvFromEx;
private TextView tvTo;
private TextView tvReplyTo;
@ -788,6 +791,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvSubmitterTitle = vsBody.findViewById(R.id.tvSubmitterTitle);
tvDeliveredToTitle = vsBody.findViewById(R.id.tvDeliveredToTitle);
tvReturnPathTitle = vsBody.findViewById(R.id.tvReturnPathTitle);
tvFromExTitle = vsBody.findViewById(R.id.tvFromExTitle);
tvToTitle = vsBody.findViewById(R.id.tvToTitle);
tvReplyToTitle = vsBody.findViewById(R.id.tvReplyToTitle);
@ -803,6 +807,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvSubmitter = vsBody.findViewById(R.id.tvSubmitter);
tvDeliveredTo = vsBody.findViewById(R.id.tvDeliveredTo);
tvReturnPath = vsBody.findViewById(R.id.tvReturnPath);
tvFromEx = vsBody.findViewById(R.id.tvFromEx);
tvTo = vsBody.findViewById(R.id.tvTo);
tvReplyTo = vsBody.findViewById(R.id.tvReplyTo);
@ -1655,6 +1660,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvSubmitterTitle.setVisibility(View.GONE);
tvDeliveredToTitle.setVisibility(View.GONE);
tvReturnPathTitle.setVisibility(View.GONE);
tvFromExTitle.setVisibility(View.GONE);
tvToTitle.setVisibility(View.GONE);
tvReplyToTitle.setVisibility(View.GONE);
@ -1670,6 +1676,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvSubmitter.setVisibility(View.GONE);
tvDeliveredTo.setVisibility(View.GONE);
tvReturnPath.setVisibility(View.GONE);
tvFromEx.setVisibility(View.GONE);
tvTo.setVisibility(View.GONE);
tvReplyTo.setVisibility(View.GONE);
@ -2456,6 +2463,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvDeliveredTo.setVisibility(show_addresses && !TextUtils.isEmpty(message.deliveredto) ? View.VISIBLE : View.GONE);
tvDeliveredTo.setText(formatAddresses(new Address[]{deliveredto}, true));
tvReturnPathTitle.setVisibility(show_addresses && experiments && message.return_path != null && message.return_path.length > 0 ? View.VISIBLE : View.GONE);
tvReturnPath.setVisibility(show_addresses && experiments && message.return_path != null && message.return_path.length > 0 ? View.VISIBLE : View.GONE);
tvReturnPath.setText(formatAddresses(message.return_path, true));
tvFromExTitle.setVisibility((froms > 1 || show_addresses) && !TextUtils.isEmpty(from) ? View.VISIBLE : View.GONE);
tvFromEx.setVisibility((froms > 1 || show_addresses) && !TextUtils.isEmpty(from) ? View.VISIBLE : View.GONE);
tvFromEx.setText(from);
@ -7268,6 +7279,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
} else
languages = null;
this.experiments = prefs.getBoolean("experiments", false);
debug = prefs.getBoolean("debug", false);
level = prefs.getInt("log_level", Log.getDefaultLogLevel());

@ -181,6 +181,31 @@
app:layout_constraintStart_toEndOf="@+id/barrier_addresses"
app:layout_constraintTop_toBottomOf="@id/tvSubmitter" />
<TextView
android:id="@+id/tvReturnPathTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:labelFor="@+id/tvFromEx"
android:text="@string/title_return_path"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDeliveredToTitle" />
<TextView
android:id="@+id/tvReturnPath"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:layout_marginEnd="6dp"
android:text="Return path"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textIsSelectable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/barrier_addresses"
app:layout_constraintTop_toBottomOf="@id/tvDeliveredTo" />
<TextView
android:id="@+id/tvFromExTitle"
android:layout_width="wrap_content"
@ -191,7 +216,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDeliveredTo" />
app:layout_constraintTop_toBottomOf="@id/tvReturnPathTitle" />
<TextView
android:id="@+id/tvFromEx"
@ -204,7 +229,7 @@
android:textIsSelectable="true"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@+id/barrier_addresses"
app:layout_constraintTop_toBottomOf="@id/tvDeliveredTo" />
app:layout_constraintTop_toBottomOf="@id/tvReturnPath" />
<TextView
android:id="@+id/tvToTitle"
@ -487,7 +512,7 @@
android:layout_height="wrap_content"
app:barrierDirection="end"
app:constraint_referenced_ids="
tvSubmitterTitle,tvDeliveredToTitle,
tvSubmitterTitle,tvDeliveredToTitle,tvReturnPathTitle,
tvFromExTitle,tvToTitle,tvReplyToTitle,
tvCcTitle,tvBccTitle,
tvIdentityTitle,

@ -1372,6 +1372,7 @@
<string name="title_compose">Compose</string>
<string name="title_submitter">Sent by:</string>
<string name="title_delivered_to">Delivered to:</string>
<string name="title_return_path">Return path:</string>
<string name="title_from">From:</string>
<string name="title_to">To:</string>
<string name="title_reply_to">Reply to:</string>

Loading…
Cancel
Save