Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 12, 2025

This PR adds documentation about the automatic clipboard notifications (toasts) introduced in Android 13 and provides guidance for developers on how to handle this platform-specific behavior.

Changes Made

Starting with Android 13 (API level 33), the system automatically displays a toast notification whenever an app copies text to the clipboard. This behavior was not documented in the existing clipboard documentation, leaving developers unaware of this platform-specific change.

Documentation Updates

  • Added "Platform-specific behaviors" section to clipboard.md explaining the Android 13+ automatic toast behavior
  • Provided code example showing how to conditionally display custom toast notifications on Android 12 and lower for consistent user experience
  • Included important warning about avoiding duplicate notifications on Android 13+

Code Example

The new documentation includes a practical code snippet that demonstrates:

private async void SetClipboardWithToastButton_Clicked(object sender, EventArgs e) { await Clipboard.Default.SetTextAsync("TestValue"); #if ANDROID // Show toast notification only on Android 12 and lower // Android 13+ automatically shows system notifications if (Android.OS.Build.VERSION.SdkInt < Android.OS.BuildVersionCodes.Tiramisu) { Android.Widget.Toast.MakeText( Microsoft.Maui.ApplicationModel.Platform.CurrentActivity ?? Android.App.Application.Context, "Copied to clipboard", Android.Widget.ToastLength.Short)?.Show(); } #endif }

Benefits

  • Clarifies platform behavior: Developers now understand when automatic notifications occur
  • Provides best practices: Shows how to create consistent UX across Android versions
  • Prevents duplicate notifications: Warns against showing custom toasts on Android 13+
  • Follows existing patterns: Uses the same documentation style as other platform-specific behaviors in the repository

Fixes #3021.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Internal previews

📄 File 🔗 Preview link
docs/platform-integration/data/clipboard.md docs/platform-integration/data/clipboard
@learn-build-service-prod
Copy link

Learn Build status updates of commit d3656af:

✅ Validation status: passed

For more details, please refer to the build report.

Co-authored-by: jfversluis <939291+jfversluis@users.noreply.github.com>
Copilot AI changed the title [WIP] Clipboard - Add documentation about clipboard notifications (toasts) on Android 13+ Add documentation for Android clipboard notifications on Android 13+ Sep 12, 2025
Copilot finished work on behalf of jfversluis September 12, 2025 11:46
Copilot AI requested a review from jfversluis September 12, 2025 11:46
@learn-build-service-prod
Copy link

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 issues. Other issues are also a high priority. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@learn-build-service-prod
Copy link

Learn Build status updates of commit e48ef67:

✅ Validation status: passed

File Status Preview URL Details
docs/platform-integration/data/clipboard.md ✅Succeeded View (>=net-maui-8.0)
docs/platform-integration/snippets/shared_1/DataPage.xaml.cs ✅Succeeded View (>=net-maui-8.0)

For more details, please refer to the build report.

@jfversluis jfversluis marked this pull request as ready for review September 12, 2025 11:53
@jfversluis jfversluis requested a review from a team as a code owner September 12, 2025 11:53
@learn-build-service-prod
Copy link

PoliCheck Scan Report

The following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 issues. Other issues are also a high priority. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans.

✅ No issues found

More information about PoliCheck

Information: PoliCheck | Severity Guidance | Term
For any questions: Try searching the learn.microsoft.com contributor guides or post your question in the Learn support channel.

@learn-build-service-prod
Copy link

Learn Build status updates of commit c864c72:

✅ Validation status: passed

File Status Preview URL Details
docs/platform-integration/data/clipboard.md ✅Succeeded View (>=net-maui-8.0)
docs/platform-integration/snippets/shared_1/DataPage.xaml.cs ✅Succeeded View (>=net-maui-8.0)

For more details, please refer to the build report.

@jfversluis jfversluis merged commit e4ceab1 into main Sep 12, 2025
5 checks passed
@jfversluis jfversluis deleted the copilot/fix-3021 branch September 12, 2025 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants