Android 13: native clipboard message

This commit is contained in:
M66B
2022-06-12 09:27:19 +02:00
parent 01dd66eccb
commit dd0afc5e22
6 changed files with 27 additions and 10 deletions

View File

@@ -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();
}
});