mirror of
https://github.com/binwiederhier/ntfy-android.git
synced 2024-06-14 00:24:34 +12:00
fixes binwiederhier/ntfy#471
clicking on a notification from the list will copy the message to the clipboard instead of "message\n\n{timestamp}"
This commit is contained in:
parent
a462d70a49
commit
1ba3168743
|
@ -472,9 +472,8 @@ fun ensureSafeNewFile(dir: File, name: String): File {
|
|||
|
||||
fun copyToClipboard(context: Context, notification: Notification) {
|
||||
val message = decodeMessage(notification)
|
||||
val text = message + "\n\n" + formatDateShort(notification.timestamp)
|
||||
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)
|
||||
Toast
|
||||
.makeText(context, context.getString(R.string.detail_copied_to_clipboard_message), Toast.LENGTH_LONG)
|
||||
|
|
Loading…
Reference in a new issue