Add "copy link" to post context menu

This commit is contained in:
Grishka
2023-10-17 04:41:18 +03:00
parent 26b99f5f68
commit 201b72c9c8
6 changed files with 18 additions and 9 deletions

View File

@@ -301,9 +301,7 @@ public class ProfileFragment extends LoaderFragment implements OnBackPressedList
username+="@"+AccountSessionManager.getInstance().getAccount(accountID).domain;
}
getActivity().getSystemService(ClipboardManager.class).setPrimaryClip(ClipData.newPlainText(null, "@"+username));
if(Build.VERSION.SDK_INT<Build.VERSION_CODES.TIRAMISU || UiUtils.isMIUI()){ // Android 13+ SystemUI shows its own thing when you put things into the clipboard
Toast.makeText(getActivity(), R.string.text_copied, Toast.LENGTH_SHORT).show();
}
UiUtils.maybeShowTextCopiedToast(getActivity());
return true;
});