mirror of https://github.com/M66B/FairEmail.git
Small improvements
This commit is contained in:
parent
f03a7d0335
commit
24a6a1fd8e
|
@ -67,9 +67,9 @@ public class EditTextCompose extends AppCompatEditText {
|
||||||
try {
|
try {
|
||||||
if (id == android.R.id.paste) {
|
if (id == android.R.id.paste) {
|
||||||
Context context = getContext();
|
Context context = getContext();
|
||||||
ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
ClipboardManager cbm = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
if (clipboard.hasPrimaryClip()) {
|
if (cbm != null && cbm.hasPrimaryClip()) {
|
||||||
ClipData.Item item = clipboard.getPrimaryClip().getItemAt(0);
|
ClipData.Item item = cbm.getPrimaryClip().getItemAt(0);
|
||||||
|
|
||||||
String html = item.getHtmlText();
|
String html = item.getHtmlText();
|
||||||
if (html == null) {
|
if (html == null) {
|
||||||
|
|
|
@ -332,7 +332,7 @@ public class FragmentAnswer extends FragmentBase {
|
||||||
Uri uri = null;
|
Uri uri = null;
|
||||||
|
|
||||||
ClipboardManager cbm = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
|
ClipboardManager cbm = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
if (cbm.hasPrimaryClip()) {
|
if (cbm != null && cbm.hasPrimaryClip()) {
|
||||||
String link = cbm.getPrimaryClip().getItemAt(0).coerceToText(getContext()).toString();
|
String link = cbm.getPrimaryClip().getItemAt(0).coerceToText(getContext()).toString();
|
||||||
uri = Uri.parse(link);
|
uri = Uri.parse(link);
|
||||||
if (uri.getScheme() == null)
|
if (uri.getScheme() == null)
|
||||||
|
@ -345,7 +345,7 @@ public class FragmentAnswer extends FragmentBase {
|
||||||
FragmentDialogLink fragment = new FragmentDialogLink();
|
FragmentDialogLink fragment = new FragmentDialogLink();
|
||||||
fragment.setArguments(args);
|
fragment.setArguments(args);
|
||||||
fragment.setTargetFragment(this, REQUEST_LINK);
|
fragment.setTargetFragment(this, REQUEST_LINK);
|
||||||
fragment.show(getParentFragmentManager(), "compose:link");
|
fragment.show(getParentFragmentManager(), "answer:link");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else
|
} else
|
||||||
|
|
|
@ -1356,7 +1356,7 @@ public class FragmentCompose extends FragmentBase {
|
||||||
Uri uri = null;
|
Uri uri = null;
|
||||||
|
|
||||||
ClipboardManager cbm = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
|
ClipboardManager cbm = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
|
||||||
if (cbm.hasPrimaryClip()) {
|
if (cbm != null && cbm.hasPrimaryClip()) {
|
||||||
String link = cbm.getPrimaryClip().getItemAt(0).coerceToText(getContext()).toString();
|
String link = cbm.getPrimaryClip().getItemAt(0).coerceToText(getContext()).toString();
|
||||||
uri = Uri.parse(link);
|
uri = Uri.parse(link);
|
||||||
if (uri.getScheme() == null)
|
if (uri.getScheme() == null)
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/action_delete"
|
android:id="@+id/action_delete"
|
||||||
android:icon="@drawable/baseline_delete_24"
|
android:icon="@drawable/baseline_delete_24"
|
||||||
|
|
Loading…
Reference in New Issue