mirror of https://github.com/M66B/FairEmail.git
Added from/subject to summarize dialog
This commit is contained in:
parent
90e527cb60
commit
f7148dad57
|
@ -7280,6 +7280,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
private void onActionSummarize(TupleMessageEx message) {
|
private void onActionSummarize(TupleMessageEx message) {
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putLong("id", message.id);
|
args.putLong("id", message.id);
|
||||||
|
args.putString("from", MessageHelper.formatAddresses(message.from));
|
||||||
|
args.putString("subject", message.subject);
|
||||||
|
|
||||||
FragmentDialogSummarize fragment = new FragmentDialogSummarize();
|
FragmentDialogSummarize fragment = new FragmentDialogSummarize();
|
||||||
fragment.setArguments(args);
|
fragment.setArguments(args);
|
||||||
|
|
|
@ -48,6 +48,8 @@ public class FragmentDialogSummarize extends FragmentDialogBase {
|
||||||
final Context context = getContext();
|
final Context context = getContext();
|
||||||
final View view = LayoutInflater.from(context).inflate(R.layout.dialog_summarize, null);
|
final View view = LayoutInflater.from(context).inflate(R.layout.dialog_summarize, null);
|
||||||
final TextView tvCaption = view.findViewById(R.id.tvCaption);
|
final TextView tvCaption = view.findViewById(R.id.tvCaption);
|
||||||
|
final TextView tvFrom = view.findViewById(R.id.tvFrom);
|
||||||
|
final TextView tvSubject = view.findViewById(R.id.tvSubject);
|
||||||
final TextView tvSummary = view.findViewById(R.id.tvSummary);
|
final TextView tvSummary = view.findViewById(R.id.tvSummary);
|
||||||
final TextView tvElapsed = view.findViewById(R.id.tvElapsed);
|
final TextView tvElapsed = view.findViewById(R.id.tvElapsed);
|
||||||
final ContentLoadingProgressBar pbWait = view.findViewById(R.id.pbWait);
|
final ContentLoadingProgressBar pbWait = view.findViewById(R.id.pbWait);
|
||||||
|
@ -67,8 +69,11 @@ public class FragmentDialogSummarize extends FragmentDialogBase {
|
||||||
float textSize = Helper.getTextSize(context, zoom) * message_zoom / 100f;
|
float textSize = Helper.getTextSize(context, zoom) * message_zoom / 100f;
|
||||||
tvSummary.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
|
tvSummary.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
|
||||||
|
|
||||||
|
Bundle args = getArguments();
|
||||||
|
|
||||||
tvCaption.setText(prompt);
|
tvCaption.setText(prompt);
|
||||||
tvSummary.setText(null);
|
tvFrom.setText(args.getString("from"));
|
||||||
|
tvSubject.setText(args.getString("subject"));
|
||||||
|
|
||||||
new SimpleTask<String>() {
|
new SimpleTask<String>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -152,7 +157,7 @@ public class FragmentDialogSummarize extends FragmentDialogBase {
|
||||||
tvSummary.setText(new ThrowableWrapper(ex).toSafeString());
|
tvSummary.setText(new ThrowableWrapper(ex).toSafeString());
|
||||||
tvSummary.setVisibility(View.VISIBLE);
|
tvSummary.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}.execute(this, getArguments(), "message:summarize");
|
}.execute(this, args, "message:summarize");
|
||||||
|
|
||||||
AlertDialog.Builder builder = new AlertDialog.Builder(context)
|
AlertDialog.Builder builder = new AlertDialog.Builder(context)
|
||||||
.setView(view)
|
.setView(view)
|
||||||
|
|
|
@ -1637,6 +1637,8 @@ public class FragmentMessages extends FragmentBase
|
||||||
|
|
||||||
Bundle args = new Bundle();
|
Bundle args = new Bundle();
|
||||||
args.putLong("id", result.single.id);
|
args.putLong("id", result.single.id);
|
||||||
|
args.putString("from", MessageHelper.formatAddresses(result.single.from));
|
||||||
|
args.putString("subject", result.single.subject);
|
||||||
|
|
||||||
FragmentDialogSummarize fragment = new FragmentDialogSummarize();
|
FragmentDialogSummarize fragment = new FragmentDialogSummarize();
|
||||||
fragment.setArguments(args);
|
fragment.setArguments(args);
|
||||||
|
|
|
@ -23,17 +23,41 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvFrom"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="12dp"
|
||||||
|
android:text="From"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tvCaption" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvSubject"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="6dp"
|
||||||
|
android:text="Subject"
|
||||||
|
android:textAppearance="@style/TextAppearance.AppCompat.Small"
|
||||||
|
android:textIsSelectable="true"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/tvFrom" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvSummary"
|
android:id="@+id/tvSummary"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="24dp"
|
android:layout_marginTop="12dp"
|
||||||
android:text="Text"
|
android:text="Text"
|
||||||
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
|
||||||
android:textIsSelectable="true"
|
android:textIsSelectable="true"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/tvCaption" />
|
app:layout_constraintTop_toBottomOf="@id/tvSubject" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvElapsed"
|
android:id="@+id/tvElapsed"
|
||||||
|
|
Loading…
Reference in New Issue