Add CopyToClipboard block to Sharing component (Android & iOS)#3741
Open
Akashgite1 wants to merge 8 commits intomit-cml:masterfrom
Open
Add CopyToClipboard block to Sharing component (Android & iOS)#3741Akashgite1 wants to merge 8 commits intomit-cml:masterfrom
Akashgite1 wants to merge 8 commits intomit-cml:masterfrom
Conversation
Collaborator
|
Can one of the admins verify this patch? |
1 similar comment
Collaborator
|
Can one of the admins verify this patch? |
Member
|
@Akashgite1 Make sure to update YoungAndroidFormUpgrader.java, otherwise existing projects with a Sharing component will report an error. |
Akashgite1
commented
Jan 28, 2026
Contributor
Author
Akashgite1
left a comment
There was a problem hiding this comment.
Added Sharing component handling in YoungAndroidFormUpgrader for version 2 (CopyToClipboard).
This is an additive change; no property migrations are required.
ewpatton
requested changes
Feb 1, 2026
Member
ewpatton
left a comment
There was a problem hiding this comment.
Make sure to actually build and test this code as well.
appinventor/components/src/com/google/appinventor/components/runtime/Sharing.java
Outdated
Show resolved
Hide resolved
appinventor/components/src/com/google/appinventor/components/runtime/Sharing.java
Outdated
Show resolved
Hide resolved
...entor/appengine/src/com/google/appinventor/client/youngandroid/YoungAndroidFormUpgrader.java
Outdated
Show resolved
Hide resolved
Akashgite1
commented
Feb 2, 2026
Contributor
Author
There was a problem hiding this comment.
✅ Block Visible in UI
✅ Tested Locally
1️⃣ Custom Companion Build
Verified:
- Clipboard content copies correctly
- Able to paste into other apps successfully
2️⃣ Compiled APK
Tested scenarios:
- Empty string
- Long string
- Unicode strings (emoji & multilingual)
- Multiple rapid invocations
No crashes or permission issues observed.
Contributor
|
@AppInventorWorkerBee ok to test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



General items:
ant testspasses on my machineIf your code changes how something works on the device (i.e., it affects the companion):
ucrucras the baseFurther, if you've changed the blocks language or another user-facing designer/blocks API (added a SimpleProperty, etc.):
For all other changes:
mastermasteras the baseWhat does this PR accomplish?
This PR adds a new
CopyToClipboardmethod to the Sharing component, allowing developers to copy text to the system clipboard without invoking the platform share sheet.The implementation works consistently across platforms:
ClipboardManagerandClipDataUIPasteboard.generalThe change is additive and backward compatible.
Summary
This PR adds a new
CopyToClipboardmethod to the Sharing component, allowing apps to copy text to the system clipboard without invoking the platform share sheet.Platform support
ClipboardManagerandClipDataUIPasteboard.generalVersioning
SHARING_COMPONENT_VERSIONfrom 1 → 2blocklyeditor/src/versioning.js(no upgrade required)Notes
This is an additive, backward-compatible change. No existing blocks or behaviors are modified, and no SCM upgrades are required.
No
YoungAndroidFormUpgraderchanges are required since this PR only adds a new method and does not alter existing properties or block semantics.Resolves #3736