diff --git a/app/src/main/java/eu/faircode/email/StyleHelper.java b/app/src/main/java/eu/faircode/email/StyleHelper.java index dbbad5f82c..1a588289ed 100644 --- a/app/src/main/java/eu/faircode/email/StyleHelper.java +++ b/app/src/main/java/eu/faircode/email/StyleHelper.java @@ -198,6 +198,7 @@ public class StyleHelper { IndentSpan[] indents = edit.getSpans(start, end, IndentSpan.class); popupMenu.getMenu().findItem(R.id.menu_style_indentation_decrease).setEnabled(indents.length > 0); + popupMenu.getMenu().findItem(R.id.menu_style_parenthesis).setEnabled(BuildConfig.DEBUG); popupMenu.getMenu().findItem(R.id.menu_style_code).setEnabled(BuildConfig.DEBUG); popupMenu.insertIcons(context); @@ -233,6 +234,8 @@ public class StyleHelper { return setMark(item); } else if (groupId == R.id.group_style_strikethrough) { return setStrikeThrough(item); + } else if (groupId == R.id.group_style_parenthesis) { + return setParenthesis(item); } else if (groupId == R.id.group_style_code) { return setCode(item); } else if (groupId == R.id.group_style_clear) { @@ -662,7 +665,15 @@ public class StyleHelper { return true; } + private boolean setParenthesis(MenuItem item) { + Log.breadcrumb("style", "action", "parenthesis"); + edit.insert(end, ")"); + edit.insert(start, "("); + return true; + } + private boolean setCode(MenuItem item) { + Log.breadcrumb("style", "action", "code"); _setSize(HtmlHelper.FONT_SMALL); _setFont("monospace"); return true; diff --git a/app/src/main/res/drawable/attachment_disposition.xml b/app/src/main/res/drawable/attachment_disposition.xml index 753634757a..2a72d34409 100644 --- a/app/src/main/res/drawable/attachment_disposition.xml +++ b/app/src/main/res/drawable/attachment_disposition.xml @@ -4,6 +4,6 @@ android:drawable="@drawable/twotone_attachment_24" android:maxLevel="0" /> diff --git a/app/src/main/res/drawable/baseline_code_24.xml b/app/src/main/res/drawable/twotone_code_24.xml similarity index 100% rename from app/src/main/res/drawable/baseline_code_24.xml rename to app/src/main/res/drawable/twotone_code_24.xml diff --git a/app/src/main/res/drawable/twotone_data_object_24.xml b/app/src/main/res/drawable/twotone_data_object_24.xml new file mode 100644 index 0000000000..a924fe6090 --- /dev/null +++ b/app/src/main/res/drawable/twotone_data_object_24.xml @@ -0,0 +1,13 @@ + + + + diff --git a/app/src/main/res/layout/activity_eml.xml b/app/src/main/res/layout/activity_eml.xml index 6c2c026239..e5cefae078 100644 --- a/app/src/main/res/layout/activity_eml.xml +++ b/app/src/main/res/layout/activity_eml.xml @@ -302,7 +302,7 @@ android:padding="3dp" app:layout_constraintBottom_toBottomOf="@id/tvStructure" app:layout_constraintEnd_toEndOf="parent" - app:srcCompat="@drawable/baseline_code_24" /> + app:srcCompat="@drawable/twotone_code_24" /> diff --git a/app/src/main/res/layout/dialog_buttons.xml b/app/src/main/res/layout/dialog_buttons.xml index 7b08d89856..c22848b86e 100644 --- a/app/src/main/res/layout/dialog_buttons.xml +++ b/app/src/main/res/layout/dialog_buttons.xml @@ -283,7 +283,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginTop="12dp" - android:drawableEnd="@drawable/baseline_code_24" + android:drawableEnd="@drawable/twotone_code_24" android:drawablePadding="6dp" android:text="@string/title_show_headers" android:textAppearance="@style/TextAppearance.AppCompat.Small" diff --git a/app/src/main/res/layout/include_message_navigation.xml b/app/src/main/res/layout/include_message_navigation.xml index 3ebc916fe6..81e36e76a9 100644 --- a/app/src/main/res/layout/include_message_navigation.xml +++ b/app/src/main/res/layout/include_message_navigation.xml @@ -344,7 +344,7 @@ android:padding="6dp" android:scaleType="fitCenter" android:tooltipText="@string/title_show_headers" - app:srcCompat="@drawable/baseline_code_24" + app:srcCompat="@drawable/twotone_code_24" tools:ignore="MissingConstraints" /> + + + + diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index a721bb0263..4aa96ac605 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1394,6 +1394,7 @@ Indentation Highlight Strikethrough + Parenthesis Code Clear formatting Insert link