mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-04 16:16:33 +02:00
Added option to disable highlighting translated text
This commit is contained in:
@@ -2783,10 +2783,14 @@ public class FragmentCompose extends FragmentBase {
|
||||
|
||||
@Override
|
||||
protected void onPreExecute(Bundle args) {
|
||||
int textColorHighlight = Helper.resolveColor(getContext(), android.R.attr.textColorHighlight);
|
||||
highlightSpan = new BackgroundColorSpan(textColorHighlight);
|
||||
etBody.getText().setSpan(highlightSpan, paragraph.first, paragraph.second,
|
||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE | Spanned.SPAN_COMPOSING);
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
boolean deepl_highlight = prefs.getBoolean("deepl_highlight", true);
|
||||
if (deepl_highlight) {
|
||||
int textColorHighlight = Helper.resolveColor(getContext(), android.R.attr.textColorHighlight);
|
||||
highlightSpan = new BackgroundColorSpan(textColorHighlight);
|
||||
etBody.getText().setSpan(highlightSpan, paragraph.first, paragraph.second,
|
||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE | Spanned.SPAN_COMPOSING);
|
||||
}
|
||||
toast = ToastEx.makeText(context, R.string.title_translating, Toast.LENGTH_SHORT);
|
||||
toast.show();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user