Added info button / expression conditions

pull/217/head
M66B 8 months ago
parent a8e8045505
commit 7eeb67f873

@ -135,6 +135,7 @@ public class FragmentRule extends FragmentBase {
private CheckBox cbEveryDay; private CheckBox cbEveryDay;
private EditText etYounger; private EditText etYounger;
private ImageButton ibExpression;
private EditText etExpression; private EditText etExpression;
private Spinner spAction; private Spinner spAction;
@ -343,6 +344,7 @@ public class FragmentRule extends FragmentBase {
cbEveryDay = view.findViewById(R.id.cbEveryDay); cbEveryDay = view.findViewById(R.id.cbEveryDay);
etYounger = view.findViewById(R.id.etYounger); etYounger = view.findViewById(R.id.etYounger);
ibExpression = view.findViewById(R.id.ibExpression);
etExpression = view.findViewById(R.id.etExpression); etExpression = view.findViewById(R.id.etExpression);
spAction = view.findViewById(R.id.spAction); spAction = view.findViewById(R.id.spAction);
@ -683,6 +685,13 @@ public class FragmentRule extends FragmentBase {
} }
}); });
ibExpression.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Helper.viewFAQ(v.getContext(), "expression_conditions");
}
});
List<Action> actions = new ArrayList<>(); List<Action> actions = new ArrayList<>();
actions.add(new Action(EntityRule.TYPE_NOOP, getString(R.string.title_rule_noop), R.drawable.twotone_remove_circle_outline_24)); actions.add(new Action(EntityRule.TYPE_NOOP, getString(R.string.title_rule_noop), R.drawable.twotone_remove_circle_outline_24));
actions.add(new Action(EntityRule.TYPE_SEEN, getString(R.string.title_rule_seen), R.drawable.twotone_drafts_24)); actions.add(new Action(EntityRule.TYPE_SEEN, getString(R.string.title_rule_seen), R.drawable.twotone_drafts_24));

@ -1386,7 +1386,15 @@ public class Helper {
viewFAQ(context, question, true /* Google translate */); viewFAQ(context, question, true /* Google translate */);
} }
static void viewFAQ(Context context, String fragment) {
viewFAQ(context, fragment, true);
}
private static void viewFAQ(Context context, int question, boolean english) { private static void viewFAQ(Context context, int question, boolean english) {
viewFAQ(context, question == 0 ? "top" : "faq" + question, english);
}
private static void viewFAQ(Context context, String fragment, boolean english) {
// Redirection is done to prevent text editors from opening the link // Redirection is done to prevent text editors from opening the link
// https://email.faircode.eu/faq -> https://github.com/M66B/FairEmail/blob/master/FAQ.md // https://email.faircode.eu/faq -> https://github.com/M66B/FairEmail/blob/master/FAQ.md
// https://email.faircode.eu/docs -> https://github.com/M66B/FairEmail/tree/master/docs // https://email.faircode.eu/docs -> https://github.com/M66B/FairEmail/tree/master/docs
@ -1400,10 +1408,7 @@ public class Helper {
else else
base = "https://email.faircode.eu/docs/FAQ-" + locale + ".md"; base = "https://email.faircode.eu/docs/FAQ-" + locale + ".md";
if (question == 0) view(context, Uri.parse(base + "#" + fragment), "text/html", false, false);
view(context, Uri.parse(base + "#top"), "text/html", false, false);
else
view(context, Uri.parse(base + "#faq" + question), "text/html", false, false);
} }
static Uri getPrivacyUri(Context context) { static Uri getPrivacyUri(Context context) {

@ -857,12 +857,25 @@
android:id="@+id/tvExpression" android:id="@+id/tvExpression"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_rule_expression" android:text="@string/title_rule_expression"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintBottom_toBottomOf="@+id/ibExpression"
app:layout_constraintEnd_toStartOf="@id/ibExpression"
app:layout_constraintStart_toStartOf="parent" />
<ImageButton
android:id="@+id/ibExpression"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_marginStart="6dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="6dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_info"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toEndOf="@id/tvExpression"
app:layout_constraintTop_toBottomOf="@+id/vSeparatorExpression" /> app:layout_constraintTop_toBottomOf="@+id/vSeparatorExpression"
app:srcCompat="@drawable/twotone_info_24" />
<eu.faircode.email.EditTextPlain <eu.faircode.email.EditTextPlain
android:id="@+id/etExpression" android:id="@+id/etExpression"

Loading…
Cancel
Save