mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-21 21:57:19 +00:00
Small improvement
This commit is contained in:
parent
fe2ee9d68c
commit
d7039673be
1 changed files with 5 additions and 1 deletions
|
@ -2296,6 +2296,7 @@ public class FragmentCompose extends FragmentBase {
|
|||
|
||||
new SimpleTask<DeepL.Translation>() {
|
||||
private Object highlightSpan;
|
||||
private Toast toast;
|
||||
|
||||
@Override
|
||||
protected void onPreExecute(Bundle args) {
|
||||
|
@ -2303,13 +2304,16 @@ public class FragmentCompose extends FragmentBase {
|
|||
highlightSpan = new BackgroundColorSpan(textColorHighlight);
|
||||
etBody.getText().setSpan(highlightSpan, paragraph.first, paragraph.second,
|
||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE | Spanned.SPAN_COMPOSING);
|
||||
ToastEx.makeText(context, R.string.title_translating, Toast.LENGTH_SHORT).show();
|
||||
toast = ToastEx.makeText(context, R.string.title_translating, Toast.LENGTH_SHORT);
|
||||
toast.show();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(Bundle args) {
|
||||
if (highlightSpan != null)
|
||||
etBody.getText().removeSpan(highlightSpan);
|
||||
if (toast != null)
|
||||
toast.cancel();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue