Skip to content

Releases: Sushant-Hande/Kclipboard

1.0.0

07 Jun 14:50
b95c814

Choose a tag to compare

Description

Copy & Read Feature

The library leverages Jetpack/Compose Multiplatform's Clipboard interface to provide a unified API. The core flow is:

  1. Common API: KclipboardManager defines suspend fun copy(String) and suspend fun getCopiedText(): String?.

  2. Implementation: KclipboardManagerImpl captures the platform's Clipboard (provided via LocalClipboard) and delegates operations.

  3. Platform Interop (expect/actual):

  • Android:

    • Converts String to ClipEntry using ClipData.newPlainText(label, text).
    • Reading extracts the first item from ClipData.
  • iOS:

    • Uses Compose's ClipEntry.withPlainText(text) which internally interacts with UIPasteboard.
    • Reading uses hasPlainText() and getPlainText().
  1. 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

06 Jun 15:05
35ac21c

Choose a tag to compare

1.0.0-alpha.1 Pre-release
Pre-release

Releasing 1.0.0-alpha.1 version of the library for testing purposes.