diff --git a/FAQ.md b/FAQ.md index d8903f0919..e20c45405f 100644 --- a/FAQ.md +++ b/FAQ.md @@ -2068,7 +2068,8 @@ The following rule conditions are available: * Subject contains * Has attachments * Header contains -* Day/time between +* Absolute time between (since version 1.1540) +* Relative time between All the conditions of a rule need to be true for the rule action to be executed. All conditions are optional, but there needs to be at least one condition, to prevent matching all messages. diff --git a/app/src/main/java/eu/faircode/email/AdapterRule.java b/app/src/main/java/eu/faircode/email/AdapterRule.java index 0769fbb13f..60040f8e8b 100644 --- a/app/src/main/java/eu/faircode/email/AdapterRule.java +++ b/app/src/main/java/eu/faircode/email/AdapterRule.java @@ -128,8 +128,10 @@ public class AdapterRule extends RecyclerView.Adapter { condition.add(context.getString(R.string.title_rule_subject)); if (jcondition.has("header")) condition.add(context.getString(R.string.title_rule_header)); + if (jcondition.has("date")) + condition.add(context.getString(R.string.title_rule_time_abs)); if (jcondition.has("schedule")) - condition.add(context.getString(R.string.title_rule_time)); + condition.add(context.getString(R.string.title_rule_time_rel)); tvCondition.setText(TextUtils.join(" & ", condition)); } catch (Throwable ex) { tvCondition.setText(ex.getMessage()); diff --git a/app/src/main/java/eu/faircode/email/FragmentRule.java b/app/src/main/java/eu/faircode/email/FragmentRule.java index de19d69018..28e5286247 100644 --- a/app/src/main/java/eu/faircode/email/FragmentRule.java +++ b/app/src/main/java/eu/faircode/email/FragmentRule.java @@ -332,7 +332,7 @@ public class FragmentRule extends FragmentBase { @Override public void onClick(View v) { Bundle args = new Bundle(); - args.putString("title", getString(R.string.title_rule_date_after)); + args.putString("title", getString(R.string.title_rule_time_after)); args.putBoolean("day", true); Object time = tvDateAfter.getTag(); @@ -350,7 +350,7 @@ public class FragmentRule extends FragmentBase { @Override public void onClick(View v) { Bundle args = new Bundle(); - args.putString("title", getString(R.string.title_rule_date_before)); + args.putString("title", getString(R.string.title_rule_time_before)); args.putBoolean("day", true); Object time = tvDateBefore.getTag(); diff --git a/app/src/main/res/layout/fragment_rule.xml b/app/src/main/res/layout/fragment_rule.xml index 2d91af94bb..c838807eac 100644 --- a/app/src/main/res/layout/fragment_rule.xml +++ b/app/src/main/res/layout/fragment_rule.xml @@ -421,7 +421,7 @@ android:layout_height="wrap_content" android:ellipsize="end" android:singleLine="true" - android:text="@string/title_rule_date" + android:text="@string/title_rule_time_abs" android:textAppearance="@style/TextAppearance.AppCompat.Small" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" @@ -503,7 +503,7 @@ android:layout_height="wrap_content" android:ellipsize="end" android:singleLine="true" - android:text="@string/title_rule_time" + android:text="@string/title_rule_time_rel" android:textAppearance="@style/TextAppearance.AppCompat.Small" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toStartOf="parent" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cd8426c227..1975647cec 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1239,10 +1239,10 @@ Has attachments Mime type Header contains - Date range - Date after - Date before - Time between + Absolute time between + After + Before + Relative time between Regex AND Action