mirror of
https://github.com/TeamNewPipe/NewPipe
synced 2024-12-23 00:20:32 +00:00
Merge pull request #8961 from dhruvpatidar359/Toast-Popup
Remove the redundant/overlapping toast "Copied to clipboard" for Android 13+
This commit is contained in:
commit
6b89b44dcd
@ -314,7 +314,10 @@ public final class ShareUtils {
|
||||
}
|
||||
|
||||
clipboardManager.setPrimaryClip(ClipData.newPlainText(null, text));
|
||||
Toast.makeText(context, R.string.msg_copied, Toast.LENGTH_SHORT).show();
|
||||
if (Build.VERSION.SDK_INT < 33) {
|
||||
// Android 13 has its own "copied to clipboard" dialog
|
||||
Toast.makeText(context, R.string.msg_copied, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -693,7 +693,7 @@ public class MissionAdapter extends Adapter<ViewHolder> implements Handler.Callb
|
||||
.subscribeOn(Schedulers.computation())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(result -> {
|
||||
Utility.copyToClipboard(mContext, result);
|
||||
ShareUtils.copyToClipboard(mContext, result);
|
||||
notificationManager.cancel(HASH_NOTIFICATION_ID);
|
||||
})
|
||||
);
|
||||
|
@ -192,18 +192,6 @@ public class Utility {
|
||||
}
|
||||
}
|
||||
|
||||
public static void copyToClipboard(Context context, String str) {
|
||||
ClipboardManager cm = ContextCompat.getSystemService(context, ClipboardManager.class);
|
||||
|
||||
if (cm == null) {
|
||||
Toast.makeText(context, R.string.permission_denied, Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
}
|
||||
|
||||
cm.setPrimaryClip(ClipData.newPlainText("text", str));
|
||||
Toast.makeText(context, R.string.msg_copied, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
public static String checksum(final StoredFileHelper source, final int algorithmId)
|
||||
throws IOException {
|
||||
ByteString byteString;
|
||||
|
Loading…
Reference in New Issue
Block a user