How are we supposed to use the new Clipboard APIs in Compose 1.8?
I feel somewhat dumb but I can't really figure it out.
There's a single clear function to use:
Clipboard.setClipEntry
, but I can't figure out how to create a
ClipEntry
, I get
Expected class 'expect class ClipEntry : Any' does not have default constructor.
, and there seems to be no factory or companion functions to use (at least not from
commonMain
).
My usage with the deprecated APIs was this:
clipboard.setText(AnnotatedString(text))
, any help would be appreciated.
plus one 4
k
Kirill Grouchnikov
02/17/2025, 12:58 AM
Can you use
ClipData.toClipEntry()
function?
s
Skaldebane
02/17/2025, 1:03 AM
I think that's Android-only?
This is a multiplatform project, and it'd be great if there's a simple cross-platform way of copying text at least from common code, like the old API.
Skaldebane
02/17/2025, 1:23 PM
There's an issue for adding a common way to create a