diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index aa5cc2d1bb..a4ed173d31 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -92,6 +92,7 @@ import android.widget.CompoundButton; import android.widget.EditText; import android.widget.ImageButton; import android.widget.ImageView; +import android.widget.Spinner; import android.widget.TextView; import android.widget.Toast; @@ -3303,6 +3304,9 @@ public class AdapterMessage extends RecyclerView.Adapter() { + @Override + protected Void onExecute(Context context, Bundle args) throws Throwable { + long id = args.getLong("id"); + Integer importance = args.getInt("importance"); + if (EntityMessage.PRIORITIY_NORMAL.equals(importance)) + importance = null; + + DB db = DB.getInstance(context); + db.message().setMessageImportance(id, importance); + + return null; + } + + @Override + protected void onException(Bundle args, Throwable ex) { + Log.unexpectedError(getParentFragmentManager(), ex); + } + }.execute(getContext(), getViewLifecycleOwner(), args, "importance: set"); + } + }) + .setNegativeButton(android.R.string.cancel, null) + .create(); + } + } + public static class FragmentDialogKeywordManage extends FragmentDialogBase { @NonNull @Override diff --git a/app/src/main/res/layout/dialog_importance.xml b/app/src/main/res/layout/dialog_importance.xml new file mode 100644 index 0000000000..f6e4e667ca --- /dev/null +++ b/app/src/main/res/layout/dialog_importance.xml @@ -0,0 +1,33 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/popup_message_more.xml b/app/src/main/res/menu/popup_message_more.xml index a25953c197..535fbcee31 100644 --- a/app/src/main/res/menu/popup_message_more.xml +++ b/app/src/main/res/menu/popup_message_more.xml @@ -32,6 +32,10 @@ android:id="@+id/menu_create_rule" android:title="@string/title_create_rule" /> + +