Clear the ime suggestions/ underline for suggestion when saving.
Otherwise, we save with an underline if the user hasn't committed
an autocomplete
Executive decision: we use to only auto clear it if the user tapped
back and we-auto saved, but if the user taps "save", they probably don't
want the underline either...so I'm clearing it in response to save draft
as well.
I also remove the underline from text in the subject, as that would
be equally annoying to save.
Change-Id: If5e2a09bf0028e54cc7763463dcd5dcf75369361
diff --git a/src/com/android/mail/compose/ComposeActivity.java b/src/com/android/mail/compose/ComposeActivity.java
index 149d8d7..b26e05e 100644
--- a/src/com/android/mail/compose/ComposeActivity.java
+++ b/src/com/android/mail/compose/ComposeActivity.java
@@ -1367,7 +1367,7 @@
showCcBccViews();
break;
case R.id.save:
- doSave(true, false);
+ doSave(true);
break;
case R.id.send:
doSend();
@@ -1399,12 +1399,16 @@
sendOrSaveWithSanityChecks(false, true, false);
}
- private void doSave(boolean showToast, boolean resetIME) {
+ private void doSave(boolean showToast) {
+ // Clear the IME composing suggestions from the body and subject before saving.
+ clearImeText(mBodyView);
+ clearImeText(mSubject);
sendOrSaveWithSanityChecks(true, showToast, false);
- if (resetIME) {
- // Clear the IME composing suggestions from the body.
- BaseInputConnection.removeComposingSpans(mBodyView.getEditableText());
- }
+ }
+
+ private void clearImeText(TextView v) {
+ v.clearComposingText();
+ BaseInputConnection.removeComposingSpans(v.getEditableText());
}
/*package*/ interface SendOrSaveCallback {
@@ -2288,7 +2292,7 @@
}
if (shouldSave()) {
- doSave(!mAddingAttachment /* show toast */, true /* reset IME */);
+ doSave(!mAddingAttachment /* show toast */);
}
}