Releases: Sushant-Hande/Kclipboard
Releases · Sushant-Hande/Kclipboard
1.0.0
Description
Copy & Read Feature
The library leverages Jetpack/Compose Multiplatform's Clipboard interface to provide a unified API. The core flow is:
-
Common API: KclipboardManager defines suspend fun
copy(String)and suspend fungetCopiedText(): String?. -
Implementation: KclipboardManagerImpl captures the platform's Clipboard (provided via LocalClipboard) and delegates operations.
-
Platform Interop (expect/actual):
-
Android:
- Converts String to
ClipEntryusingClipData.newPlainText(label, text). - Reading extracts the first item from ClipData.
- Converts String to
-
iOS:
- Uses Compose's
ClipEntry.withPlainText(text)which internally interacts with UIPasteboard. - Reading uses hasPlainText() and getPlainText().
- Uses Compose's
- Composition Safety: The
rememberKclipboardManager()factory ensures the manager is scoped to the composition lifecycle and correctly captures the LocalClipboard instance.
1.0.0-alpha.1
Releasing 1.0.0-alpha.1 version of the library for testing purposes.