diff --git a/app/src/main/java/eu/faircode/email/EditTextCompose.java b/app/src/main/java/eu/faircode/email/EditTextCompose.java new file mode 100644 index 0000000000..e0c9749e41 --- /dev/null +++ b/app/src/main/java/eu/faircode/email/EditTextCompose.java @@ -0,0 +1,29 @@ +package eu.faircode.email; + +import android.content.Context; +import android.os.Build; +import android.util.AttributeSet; + +import androidx.appcompat.widget.AppCompatEditText; + +public class EditTextCompose extends AppCompatEditText { + public EditTextCompose(Context context) { + super(context); + } + + public EditTextCompose(Context context, AttributeSet attrs) { + super(context, attrs); + } + + public EditTextCompose(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + @Override + public boolean onTextContextMenuItem(int id) { + if (id == android.R.id.paste && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) + return super.onTextContextMenuItem(android.R.id.pasteAsPlainText); + else + return super.onTextContextMenuItem(id); + } +} diff --git a/app/src/main/res/layout/fragment_compose.xml b/app/src/main/res/layout/fragment_compose.xml index 692c0a85e8..a94eb3065b 100644 --- a/app/src/main/res/layout/fragment_compose.xml +++ b/app/src/main/res/layout/fragment_compose.xml @@ -176,7 +176,7 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/tvNoInternetAttachments" /> -