diff --git a/app/src/main/java/eu/faircode/email/FragmentIdentity.java b/app/src/main/java/eu/faircode/email/FragmentIdentity.java
index 07256c6844..26b2d992ef 100644
--- a/app/src/main/java/eu/faircode/email/FragmentIdentity.java
+++ b/app/src/main/java/eu/faircode/email/FragmentIdentity.java
@@ -33,6 +33,7 @@ import android.os.Handler;
import android.provider.ContactsContract;
import android.text.Editable;
import android.text.Html;
+import android.text.Spanned;
import android.text.TextUtils;
import android.text.TextWatcher;
import android.util.Patterns;
@@ -88,6 +89,7 @@ public class FragmentIdentity extends FragmentEx {
private ImageView ibColorDefault;
private EditText etSignature;
private ImageButton ibPro;
+ private Button btnHtml;
private Button btnAdvanced;
private Spinner spProvider;
@@ -149,6 +151,7 @@ public class FragmentIdentity extends FragmentEx {
ibColorDefault = view.findViewById(R.id.ibColorDefault);
etSignature = view.findViewById(R.id.etSignature);
ibPro = view.findViewById(R.id.ibPro);
+ btnHtml = view.findViewById(R.id.btnHtml);
btnAdvanced = view.findViewById(R.id.btnAdvanced);
spProvider = view.findViewById(R.id.spProvider);
@@ -304,6 +307,26 @@ public class FragmentIdentity extends FragmentEx {
}
});
+ btnHtml.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ View dview = LayoutInflater.from(getContext()).inflate(R.layout.dialog_html, null);
+ final EditText etHtml = dview.findViewById(R.id.etHtml);
+ etHtml.setText(Html.toHtml(etSignature.getText()));
+
+ new DialogBuilderLifecycle(getContext(), getViewLifecycleOwner())
+ .setView(dview)
+ .setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
+ @Override
+ public void onClick(DialogInterface dialog, int which) {
+ Spanned html = Html.fromHtml(etHtml.getText().toString());
+ etSignature.setText(html);
+ }
+ })
+ .show();
+ }
+ });
+
btnAdvanced.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@@ -736,6 +759,7 @@ public class FragmentIdentity extends FragmentEx {
lp.width = 0;
ibPro.setLayoutParams(lp);
}
+ btnHtml.setEnabled(pro);
cbPrimary.setEnabled(cbSynchronize.isChecked());
diff --git a/app/src/main/res/layout/dialog_html.xml b/app/src/main/res/layout/dialog_html.xml
new file mode 100644
index 0000000000..5c9ccd56d1
--- /dev/null
+++ b/app/src/main/res/layout/dialog_html.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/fragment_identity.xml b/app/src/main/res/layout/fragment_identity.xml
index 67f19b87a3..7181b5e85f 100644
--- a/app/src/main/res/layout/fragment_identity.xml
+++ b/app/src/main/res/layout/fragment_identity.xml
@@ -161,6 +161,17 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/etSignature" />
+
+
+ app:layout_constraintTop_toBottomOf="@id/btnHtml" />
@@ -529,7 +540,7 @@
android:id="@+id/grpAuthorize"
android:layout_width="0dp"
android:layout_height="0dp"
- app:constraint_referenced_ids="tvName,etName,tvEmail,etEmail,tvDisplay,etDisplay,btnColor,vwColor,ibColorDefault,tvSignature,etSignature,ibPro,btnAdvanced,btnSave" />
+ app:constraint_referenced_ids="tvName,etName,tvEmail,etEmail,tvDisplay,etDisplay,btnColor,vwColor,ibColorDefault,tvSignature,etSignature,ibPro,btnHtml,btnAdvanced,btnSave" />
Delete this identity permanently?
POP is not supported
Sent messages will automatically be stored in the sent folder already in most cases
+ Edit as HTML
%1$s (%2$d)