Remove Utility.copyToClipboard and use ShareUtils.copyToClipboard instead

This method is not needed anymore, as ShareUtils.copyToClipboard does
almost the same thing (no label is set on the ClipData used to copy text,
contrary to what Utility did, but using "text" as a ClipData label doesn't seem
useful).

It was used in MissionAdapter.handlePopupItem to copy the SHA1 or the MD5 of a
file.
pull/8961/head
AudricV 2022-11-08 20:40:09 +01:00
rodzic ef35b36eba
commit 7b7ab3f419
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: DA92EC7905614198
2 zmienionych plików z 1 dodań i 13 usunięć

Wyświetl plik

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

Wyświetl plik

@ -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;