mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 11:55:20 +01:00
Experiment: answer/label
This commit is contained in:
@@ -63,6 +63,7 @@ import java.util.List;
|
||||
public class FragmentAnswer extends FragmentBase {
|
||||
private ViewGroup view;
|
||||
private EditText etName;
|
||||
private EditText etLabel;
|
||||
private EditText etGroup;
|
||||
private CheckBox cbStandard;
|
||||
private CheckBox cbReceipt;
|
||||
@@ -115,6 +116,7 @@ public class FragmentAnswer extends FragmentBase {
|
||||
|
||||
// Get controls
|
||||
etName = view.findViewById(R.id.etName);
|
||||
etLabel = view.findViewById(R.id.etLabel);
|
||||
etGroup = view.findViewById(R.id.etGroup);
|
||||
cbStandard = view.findViewById(R.id.cbStandard);
|
||||
cbReceipt = view.findViewById(R.id.cbReceipt);
|
||||
@@ -187,6 +189,7 @@ public class FragmentAnswer extends FragmentBase {
|
||||
// Initialize
|
||||
FragmentDialogTheme.setBackground(context, view, true);
|
||||
|
||||
etLabel.setVisibility(BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
|
||||
cbExternal.setVisibility(View.GONE);
|
||||
cbSnippet.setVisibility(View.GONE);
|
||||
grpReady.setVisibility(View.GONE);
|
||||
@@ -259,6 +262,7 @@ public class FragmentAnswer extends FragmentBase {
|
||||
|
||||
if (savedInstanceState == null) {
|
||||
etName.setText(answer == null ? args.getString("subject") : answer.name);
|
||||
etLabel.setText(answer == null ? null : answer.label);
|
||||
etGroup.setText(answer == null ? null : answer.group);
|
||||
cbStandard.setChecked(answer == null ? false : answer.standard);
|
||||
cbReceipt.setChecked(answer == null ? false : answer.receipt);
|
||||
@@ -417,6 +421,7 @@ public class FragmentAnswer extends FragmentBase {
|
||||
Bundle args = new Bundle();
|
||||
args.putLong("id", id);
|
||||
args.putString("name", etName.getText().toString().trim());
|
||||
args.putString("label", etLabel.getText().toString().trim());
|
||||
args.putString("group", etGroup.getText().toString().trim());
|
||||
args.putBoolean("standard", cbStandard.isChecked());
|
||||
args.putBoolean("receipt", cbReceipt.isChecked());
|
||||
@@ -442,6 +447,7 @@ public class FragmentAnswer extends FragmentBase {
|
||||
protected Void onExecute(Context context, Bundle args) {
|
||||
long id = args.getLong("id");
|
||||
String name = args.getString("name");
|
||||
String label = args.getString("label");
|
||||
String group = args.getString("group");
|
||||
boolean standard = args.getBoolean("standard");
|
||||
boolean receipt = args.getBoolean("receipt");
|
||||
@@ -454,6 +460,8 @@ public class FragmentAnswer extends FragmentBase {
|
||||
|
||||
if (TextUtils.isEmpty(name))
|
||||
throw new IllegalArgumentException(context.getString(R.string.title_no_name));
|
||||
if (TextUtils.isEmpty(label))
|
||||
label = null;
|
||||
if (TextUtils.isEmpty(group))
|
||||
group = null;
|
||||
if (color == Color.TRANSPARENT)
|
||||
@@ -477,6 +485,7 @@ public class FragmentAnswer extends FragmentBase {
|
||||
answer = db.answer().getAnswer(id);
|
||||
|
||||
answer.name = name;
|
||||
answer.label = label;
|
||||
answer.group = group;
|
||||
answer.standard = standard;
|
||||
answer.receipt = receipt;
|
||||
|
||||
Reference in New Issue
Block a user