Select calendar for event

pull/212/head
M66B 2 years ago
parent 43dedad615
commit 3705f5061a

@ -3727,6 +3727,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
@Override @Override
protected void onExecuted(Bundle args, String calendar) { protected void onExecuted(Bundle args, String calendar) {
args.putString("calendar", calendar); args.putString("calendar", calendar);
args.putBoolean("forevent", true);
FragmentDialogCalendar fragment = new FragmentDialogCalendar(); FragmentDialogCalendar fragment = new FragmentDialogCalendar();
fragment.setArguments(args); fragment.setArguments(args);

@ -47,7 +47,10 @@ public class FragmentDialogCalendar extends FragmentDialogBase {
final Context context = getContext(); final Context context = getContext();
final ContentResolver resolver = context.getContentResolver(); final ContentResolver resolver = context.getContentResolver();
String selectedCalendar = getArguments().getString("calendar"); Bundle args = getArguments();
boolean forevent = args.getBoolean("forevent");
String selectedCalendar = args.getString("calendar");
String selectedAccount; String selectedAccount;
String selectedName; String selectedName;
try { try {
@ -122,15 +125,16 @@ public class FragmentDialogCalendar extends FragmentDialogBase {
} }
}); });
builder.setNegativeButton(R.string.title_reset, new DialogInterface.OnClickListener() { if (!forevent)
@Override builder.setNegativeButton(R.string.title_reset, new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) { @Override
getArguments().putLong("id", -1); public void onClick(DialogInterface dialog, int which) {
getArguments().putString("account", null); getArguments().putLong("id", -1);
getArguments().putString("type", null); getArguments().putString("account", null);
sendResult(RESULT_OK); getArguments().putString("type", null);
} sendResult(RESULT_OK);
}); }
});
builder.setPositiveButton(android.R.string.cancel, null); builder.setPositiveButton(android.R.string.cancel, null);

Loading…
Cancel
Save