Added HTML signature remark

pull/206/head
M66B 3 years ago
parent 574d521592
commit 1c01bb980d

@ -59,6 +59,7 @@ import java.util.Objects;
public class ActivitySignature extends ActivityBase { public class ActivitySignature extends ActivityBase {
private ViewGroup view; private ViewGroup view;
private TextView tvHtmlRemark;
private EditTextCompose etText; private EditTextCompose etText;
private BottomNavigationView style_bar; private BottomNavigationView style_bar;
private BottomNavigationView bottom_navigation; private BottomNavigationView bottom_navigation;
@ -81,6 +82,7 @@ public class ActivitySignature extends ActivityBase {
view = (ViewGroup) inflater.inflate(R.layout.activity_signature, null, false); view = (ViewGroup) inflater.inflate(R.layout.activity_signature, null, false);
setContentView(view); setContentView(view);
tvHtmlRemark = findViewById(R.id.tvHtmlRemark);
etText = findViewById(R.id.etText); etText = findViewById(R.id.etText);
style_bar = findViewById(R.id.style_bar); style_bar = findViewById(R.id.style_bar);
bottom_navigation = findViewById(R.id.bottom_navigation); bottom_navigation = findViewById(R.id.bottom_navigation);
@ -176,6 +178,7 @@ public class ActivitySignature extends ActivityBase {
// Initialize // Initialize
FragmentDialogTheme.setBackground(this, view, true); FragmentDialogTheme.setBackground(this, view, true);
tvHtmlRemark.setVisibility(View.GONE);
style_bar.setVisibility(View.GONE); style_bar.setVisibility(View.GONE);
setResult(RESULT_CANCELED, new Intent()); setResult(RESULT_CANCELED, new Intent());
@ -279,6 +282,7 @@ public class ActivitySignature extends ActivityBase {
String html = (dirty String html = (dirty
? getHtml() ? getHtml()
: getIntent().getStringExtra("html")); : getIntent().getStringExtra("html"));
tvHtmlRemark.setVisibility(raw ? View.VISIBLE : View.GONE);
etText.setRaw(raw); etText.setRaw(raw);
etText.setTypeface(raw ? Typeface.MONOSPACE : Typeface.DEFAULT); etText.setTypeface(raw ? Typeface.MONOSPACE : Typeface.DEFAULT);
load(html); load(html);

@ -11,6 +11,17 @@
android:layout_height="match_parent" android:layout_height="match_parent"
app:layout_behavior="eu.faircode.email.BehaviorBottomPadding"> app:layout_behavior="eu.faircode.email.BehaviorBottomPadding">
<eu.faircode.email.FixedTextView
android:id="@+id/tvHtmlRemark"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:padding="6dp"
android:text="@string/title_edit_signature_remark"
android:textStyle="italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<eu.faircode.email.EditTextCompose <eu.faircode.email.EditTextCompose
android:id="@+id/etText" android:id="@+id/etText"
android:layout_width="0dp" android:layout_width="0dp"
@ -26,7 +37,7 @@
app:layout_constraintBottom_toTopOf="@+id/style_bar" app:layout_constraintBottom_toTopOf="@+id/style_bar"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toBottomOf="@id/tvHtmlRemark" />
<com.google.android.material.bottomnavigation.BottomNavigationView <com.google.android.material.bottomnavigation.BottomNavigationView
android:id="@+id/style_bar" android:id="@+id/style_bar"

@ -1359,6 +1359,7 @@
<string name="title_next">Next</string> <string name="title_next">Next</string>
<string name="title_edit_signature">Edit signature</string> <string name="title_edit_signature">Edit signature</string>
<string name="title_edit_signature_remark">Although Android cannot display all HTML, it will be sent as-is</string>
<string name="title_edit_signature_text">Signature text</string> <string name="title_edit_signature_text">Signature text</string>
<string name="title_edit_signature_image">Insert image</string> <string name="title_edit_signature_image">Insert image</string>

Loading…
Cancel
Save