Android 13: native clipboard message

pull/208/head
M66B 2 years ago
parent 01dd66eccb
commit dd0afc5e22

@ -88,7 +88,9 @@ public class ActivityAnswer extends ActivityBase {
ClipboardManager cbm = Helper.getSystemService(ActivityAnswer.this, ClipboardManager.class);
cbm.setPrimaryClip(ClipData.newHtmlText(getString(R.string.app_name), text, html));
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU)
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
if (!readonly) {
Intent result = new Intent();

@ -3109,7 +3109,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ClipData clip = ClipData.newPlainText(title, text);
clipboard.setPrimaryClip(clip);
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU)
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
}
});
@ -4508,7 +4510,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ClipData clip = ClipData.newPlainText(context.getString(R.string.app_name), tvError.getText());
clipboard.setPrimaryClip(clip);
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU)
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
}
});
@ -4780,7 +4783,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ClipData clip = ClipData.newPlainText(context.getString(R.string.app_name), message.notes);
clipboard.setPrimaryClip(clip);
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU)
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
}
private void onShow(final TupleMessageEx message, boolean full) {
@ -6423,7 +6428,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ClipData clip = ClipData.newPlainText(context.getString(R.string.title_show_headers), message.headers);
clipboard.setPrimaryClip(clip);
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU)
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
}
private void onMenuShowHeaders(TupleMessageEx message) {

@ -875,7 +875,8 @@ public class FragmentCompose extends FragmentBase {
identity.signature);
clipboard.setPrimaryClip(clip);
ToastEx.makeText(v.getContext(), R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU)
ToastEx.makeText(v.getContext(), R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
}
});
@ -1547,7 +1548,9 @@ public class FragmentCompose extends FragmentBase {
HtmlHelper.getText(getContext(), html),
html);
clipboard.setPrimaryClip(clip);
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU)
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
}
private void deleteRef() {

@ -261,7 +261,8 @@ public class FragmentDialogOpenLink extends FragmentDialogBase {
ClipData clip = ClipData.newPlainText(title, etLink.getText().toString());
clipboard.setPrimaryClip(clip);
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU)
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
}
});

@ -27,6 +27,7 @@ import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.text.Spannable;
import android.text.SpannableStringBuilder;
@ -331,7 +332,9 @@ public class FragmentDialogTranslate extends FragmentDialogBase {
String text = HtmlHelper.getText(context, html);
ClipboardManager cbm = Helper.getSystemService(context, ClipboardManager.class);
cbm.setPrimaryClip(ClipData.newHtmlText(getString(R.string.app_name), text, html));
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU)
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
}
});

@ -483,7 +483,9 @@ public class FragmentOptionsPrivacy extends FragmentBase implements SharedPrefer
ClipData clip = ClipData.newPlainText(getString(R.string.app_name), mnemonic);
cbm.setPrimaryClip(clip);
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU)
ToastEx.makeText(context, R.string.title_clipboard_copied, Toast.LENGTH_LONG).show();
} else {
prefs.edit().remove("wipe_mnemonic").apply();

Loading…
Cancel
Save