mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-05-25 11:22:20 +00:00
Only add text clips to clipboard history (#711)
Co-authored-by: codokie <@>
This commit is contained in:
parent
382bdb6ff6
commit
300cb6e184
1 changed files with 1 additions and 1 deletions
|
@ -50,7 +50,7 @@ class ClipboardHistoryManager(
|
|||
|
||||
private fun fetchPrimaryClip() {
|
||||
val clipData = clipboardManager.primaryClip ?: return
|
||||
if (clipData.itemCount == 0) return
|
||||
if (clipData.itemCount == 0 || clipData.description?.hasMimeType("text/*") == false) return
|
||||
clipData.getItemAt(0)?.let { clipItem ->
|
||||
val timeStamp = ClipboardManagerCompat.getClipTimestamp(clipData) ?: System.currentTimeMillis()
|
||||
val content = clipItem.coerceToText(latinIME)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue