Skip to content

Share note via system share sheet instead of custom app grid - #1848

Open
joashrajin wants to merge 1 commit into
trunkfrom
fix/share-sheet-system-chooser
Open

Share note via system share sheet instead of custom app grid#1848
joashrajin wants to merge 1 commit into
trunkfrom
fix/share-sheet-system-chooser

Conversation

@joashrajin

Copy link
Copy Markdown
Contributor

Fix

Fixes #1578

Problem

The note share bottom sheet builds its own grid of share-target apps using PackageManager.queryIntentActivities() for ACTION_SEND / text/plain. Since Android 11, that query is subject to package visibility filtering: an app targeting API 30+ can only see packages it declares in a <queries> manifest block. Our manifest only declares https VIEW intents (browsers), so the grid was reduced to browsers plus the handful of apps that are automatically visible (Bluetooth, Drive, Nearby Share, WordPress, Simplenote itself). Gmail, WhatsApp, Twitter, etc. never appeared.

Solution

Replace the app grid with a Share button in the custom bottom sheet that launches the system share sheet via ShareCompat (same pattern already used by NoteEditorFragment#showShare). The system chooser is not affected by visibility filtering, so it always lists every installed app that can handle the note text — including everything the old grid showed (Bluetooth, Drive, Nearby Share, WordPress, …).

The Simplenote-specific actions (Collaborate, Publish/Unpublish, WordPress Post) are unchanged.

Also removes the now-unused ShareButtonAdapter, IconResizer, and share_button_item.xml.

Test

  1. Open a note
  2. Tap the ⋮ overflow menu → Share
  3. The bottom sheet shows Collaborate / Publish / WordPress Post / Share
  4. Tap Share → the Android system share sheet opens listing all installed share targets (Gmail, WhatsApp, Bluetooth, Drive, Nearby Share, etc.)
  5. Pick an app and confirm the note content is shared
  6. Also verify Publish/Unpublish and WordPress Post still work

Review

(fill in)

Release

These changes do not require release notes beyond the RELEASE-NOTES.txt entry added here.

The share bottom sheet built its own app grid from
PackageManager.queryIntentActivities(), which is subject to package
visibility filtering on Android 11+. Since the manifest only declares
https VIEW intents in <queries>, most share targets (Gmail, WhatsApp,
etc.) were invisible and missing from the grid.

Replace the grid with a Share button that launches the system share
sheet via ShareCompat, which is not affected by visibility filtering
and always lists every app that can handle the note text.

Fixes #1578
@dangermattic

dangermattic commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator
2 Warnings
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

@wpmobilebot

Copy link
Copy Markdown
Collaborator

📲 You can test the changes from this Pull Request in Simplenote Android by scanning the QR code below to install the corresponding build.

App NameSimplenote Android
Build TypeDebug
Commit78546b5
Direct Downloadsimplenote-android-prototype-build-pr1848-78546b5-019f48d6-5952-4052-a18f-a366c5247595.apk

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes missing share targets on Android 11+ by removing the custom “share app grid” (which is affected by package visibility filtering) and routing sharing through the Android system share sheet instead, while keeping Simplenote-specific share actions (Collaborate / Publish / WordPress Post) intact.

Changes:

  • Replaced the custom share-target grid with a Share action that launches the system chooser via ShareCompat.
  • Removed now-unused share-grid UI/resources (ShareButtonAdapter, IconResizer, and share_button_item.xml).
  • Added a release note entry documenting the fix for issue #1578.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Simplenote/src/main/res/layout/share_button_item.xml Removed obsolete layout previously used for the custom share-target grid.
Simplenote/src/main/res/layout/bottom_sheet_share.xml Replaced the RecyclerView-based app grid with a new “Share” button in the bottom sheet.
Simplenote/src/main/res/drawable/ic_share_other_48dp.xml Added icon for the new “Share” action in the bottom sheet.
Simplenote/src/main/java/com/automattic/simplenote/utils/ShareButtonAdapter.java Removed adapter for the deprecated custom share-target grid.
Simplenote/src/main/java/com/automattic/simplenote/utils/IconResizer.java Removed icon resizing utility previously used by the custom grid.
Simplenote/src/main/java/com/automattic/simplenote/ShareBottomSheetDialog.java Wired the new “Share” button callback (onShareOtherClicked) and removed grid-related logic.
Simplenote/src/main/java/com/automattic/simplenote/NoteEditorFragment.java Implemented onShareOtherClicked() to launch the system share sheet via existing showShare().
RELEASE-NOTES.txt Added release note entry for the share sheet fix (#1578).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@joashrajin joashrajin added the [feature] sharing Anything related to sharing notes. label Jul 9, 2026
@joashrajin
joashrajin marked this pull request as ready for review July 23, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[feature] sharing Anything related to sharing notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Share button no longer including all options

4 participants