From 5ceeae833d2e47f10ccc95ea1d9f70637e378302 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 25 Dec 2019 09:16:36 +0100 Subject: [PATCH] User interaction on compose keyboard --- .../eu/faircode/email/FragmentCompose.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index bc9f8e1abc..8730e20d03 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -53,10 +53,12 @@ import android.os.OperationCanceledException; import android.provider.ContactsContract; import android.provider.MediaStore; import android.security.KeyChain; +import android.text.Editable; import android.text.Html; import android.text.SpannableStringBuilder; import android.text.Spanned; import android.text.TextUtils; +import android.text.TextWatcher; import android.text.style.ImageSpan; import android.text.style.QuoteSpan; import android.util.TypedValue; @@ -447,6 +449,25 @@ public class FragmentCompose extends FragmentBase { } }); + etBody.addTextChangedListener(new TextWatcher() { + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + // Do nothing + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + Activity activity = getActivity(); + if (activity != null) + activity.onUserInteraction(); + } + + @Override + public void afterTextChanged(Editable s) { + // Do nothing + } + }); + cbSignature.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {