Moved receipt missing message to send dialog

pull/172/head
M66B 6 years ago
parent fec1e8dfcc
commit bcd2c41b28

@ -3590,7 +3590,7 @@ public class FragmentCompose extends FragmentBase {
throw new IllegalArgumentException(context.getString(R.string.title_from_missing)); throw new IllegalArgumentException(context.getString(R.string.title_from_missing));
if (draft.to == null && draft.cc == null && draft.bcc == null) if (draft.to == null && draft.cc == null && draft.bcc == null)
throw new IllegalArgumentException(context.getString(R.string.title_to_missing)); args.putBoolean("remind_to", true);
if (TextUtils.isEmpty(draft.subject)) if (TextUtils.isEmpty(draft.subject))
args.putBoolean("remind_subject", true); args.putBoolean("remind_subject", true);
@ -4143,6 +4143,7 @@ public class FragmentCompose extends FragmentBase {
Bundle args = getArguments(); Bundle args = getArguments();
boolean dialog = args.getBundle("extras").getBoolean("dialog"); boolean dialog = args.getBundle("extras").getBoolean("dialog");
boolean remind_to = args.getBoolean("remind_to", false);
boolean remind_subject = args.getBoolean("remind_subject", false); boolean remind_subject = args.getBoolean("remind_subject", false);
boolean remind_text = args.getBoolean("remind_text", false); boolean remind_text = args.getBoolean("remind_text", false);
boolean remind_attachment = args.getBoolean("remind_attachment", false); boolean remind_attachment = args.getBoolean("remind_attachment", false);
@ -4156,6 +4157,7 @@ public class FragmentCompose extends FragmentBase {
final String[] sendDelayedNames = getResources().getStringArray(R.array.sendDelayedNames); final String[] sendDelayedNames = getResources().getStringArray(R.array.sendDelayedNames);
final ViewGroup dview = (ViewGroup) LayoutInflater.from(getContext()).inflate(R.layout.dialog_send, null); final ViewGroup dview = (ViewGroup) LayoutInflater.from(getContext()).inflate(R.layout.dialog_send, null);
final TextView tvRemindTo = dview.findViewById(R.id.tvRemindTo);
final TextView tvRemindSubject = dview.findViewById(R.id.tvRemindSubject); final TextView tvRemindSubject = dview.findViewById(R.id.tvRemindSubject);
final TextView tvRemindText = dview.findViewById(R.id.tvRemindText); final TextView tvRemindText = dview.findViewById(R.id.tvRemindText);
final TextView tvRemindAttachment = dview.findViewById(R.id.tvRemindAttachment); final TextView tvRemindAttachment = dview.findViewById(R.id.tvRemindAttachment);
@ -4171,6 +4173,7 @@ public class FragmentCompose extends FragmentBase {
final CheckBox cbNotAgain = dview.findViewById(R.id.cbNotAgain); final CheckBox cbNotAgain = dview.findViewById(R.id.cbNotAgain);
final TextView tvNotAgain = dview.findViewById(R.id.tvNotAgain); final TextView tvNotAgain = dview.findViewById(R.id.tvNotAgain);
tvRemindTo.setVisibility(remind_to ? View.VISIBLE : View.GONE);
tvRemindSubject.setVisibility(remind_subject ? View.VISIBLE : View.GONE); tvRemindSubject.setVisibility(remind_subject ? View.VISIBLE : View.GONE);
tvRemindText.setVisibility(remind_text ? View.VISIBLE : View.GONE); tvRemindText.setVisibility(remind_text ? View.VISIBLE : View.GONE);
tvRemindAttachment.setVisibility(remind_attachment ? View.VISIBLE : View.GONE); tvRemindAttachment.setVisibility(remind_attachment ? View.VISIBLE : View.GONE);
@ -4402,16 +4405,19 @@ public class FragmentCompose extends FragmentBase {
} }
}); });
return new AlertDialog.Builder(getContext()) AlertDialog.Builder builder = new AlertDialog.Builder(getContext())
.setView(dview) .setView(dview)
.setPositiveButton(R.string.title_send, new DialogInterface.OnClickListener() { .setNegativeButton(android.R.string.cancel, null);
@Override
public void onClick(DialogInterface dialog, int which) { if (!remind_to)
sendResult(Activity.RESULT_OK); builder.setPositiveButton(R.string.title_send, new DialogInterface.OnClickListener() {
} @Override
}) public void onClick(DialogInterface dialog, int which) {
.setNegativeButton(android.R.string.cancel, null) sendResult(Activity.RESULT_OK);
.create(); }
});
return builder.create();
} }
@Override @Override

@ -19,6 +19,17 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tvRemindTo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_to_missing"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="?attr/colorWarning"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvMessage" />
<TextView <TextView
android:id="@+id/tvRemindSubject" android:id="@+id/tvRemindSubject"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -28,7 +39,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="?attr/colorWarning" android:textColor="?attr/colorWarning"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvMessage" /> app:layout_constraintTop_toBottomOf="@id/tvRemindTo" />
<TextView <TextView
android:id="@+id/tvRemindText" android:id="@+id/tvRemindText"

Loading…
Cancel
Save