Merge branch 'main' of github.com:binwiederhier/ntfy-android

This commit is contained in:
Philipp Heckel 2022-11-13 06:27:41 -05:00
commit 4ead7e28f6

View file

@ -472,9 +472,8 @@ fun ensureSafeNewFile(dir: File, name: String): File {
fun copyToClipboard(context: Context, notification: Notification) { fun copyToClipboard(context: Context, notification: Notification) {
val message = decodeMessage(notification) val message = decodeMessage(notification)
val text = message + "\n\n" + formatDateShort(notification.timestamp)
val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager val clipboard = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
val clip = ClipData.newPlainText("notification message", text) val clip = ClipData.newPlainText("notification message", message)
clipboard.setPrimaryClip(clip) clipboard.setPrimaryClip(clip)
Toast Toast
.makeText(context, context.getString(R.string.detail_copied_to_clipboard_message), Toast.LENGTH_LONG) .makeText(context, context.getString(R.string.detail_copied_to_clipboard_message), Toast.LENGTH_LONG)