Create topic-based share targets for quicker sharing#164
Conversation
This commit updates MainActivity to create dynamic shortcuts as the subscriptions are observed. These shortcuts are shown in the share sheet whenever the user shares content with the supported mime types (text, images, audio, video). Relevant notes: - The subscription shortcuts use the display name of the subscription (if set) or the topic name - The subscription shortcuts use the subscription icon if set - When deleting a subscription, the dynamic shortcut is removed immediately - When the user shares through a dynamic shortcut, ShareActivity is pre-filled with the topic name
531d876 to
c79e205
Compare
The dynamic shortcuts that were added for the share sheet also appear when long-pressing on the app in the launcher. These launcher shortcuts start ShareActivity as well, but with the ACTION_VIEW action instead of ACTION_SEND. Since it does not make sense to start a sharing activity from a launcher-level shortcut, this case is handled gracefully by re-routing ShareActivity to DetailActivity.
51e5b16 to
93019b2
Compare
This change introduces a new boolean preference in the global app settings, which allows users to automatically publish the shared content when it's shared directly to a topic from the share sheet. It's false by default. When the setting is true and there is valid content to share (text or file), ShareActivity automatically calls the publish API without the user having to tap the publish button.
93019b2 to
ac20b31
Compare
|
I dislike new settings, because I don't want ntfy to be an app with 800,000 toggles and options. What would be the downsides of just enabling this by default for everyone? |
|
The Android share sheet allows up to 8 direct share targets per app, so the downside would be that users who have multiple topics will have their share sheets potentially flooded with these share targets. Maybe that's not a big deal though. I'm happy to turn it on by default. |
Instead of creating a new preference, auto send will be enabled by default. Whenever the user taps on a dynamic target in the share sheet, it will be automatically sent without the user having to tap the send button.
|
@binwiederhier I removed the new settings. Now auto send is enabled by default for users who tap on the dynamic targets from the share sheet. Please take a look. |
The new settings toggle was just to control whether or not the message auto-sends, right? Since it didn't let you disable the dynamic shortcuts entirely, flooding the share sheet is still a potential concern, right? |
|
Yes, that's correct. Since share targets are ordered by usage frequency, maybe having 8 share targets isn't a concern since users will still see the most frequently used ones first. I can check if we can limit the share targets to a lower number if needed, e.g. only publish the top 3 as dynamic targets. But as far as I know, other apps don't have extra logic for that. |
These changes update MainActivity to create dynamic shortcuts as the subscriptions are observed. These shortcuts are shown in the share sheet whenever the user shares content with the supported mime types (text, images, audio, video).
For reference, shortcuts are shown in 2 main ways:
Relevant notes:
This change was tested in the following configurations:
Here's a screenshot of me sharing a web page. You can see the topic-based share target (I've set the name to "my topic"):
And here is a screenshot of the new preference to allow automatic publishing:
