-
Notifications
You must be signed in to change notification settings - Fork 912
Direct share support #2244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Direct share support #2244
Changes from 2 commits
0ae7242
7e5ee8f
741f3f4
c0a5402
7bee558
afe55ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,7 @@ import javax.inject.Inject | |
| private val useAdaptiveIcon = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O | ||
| private const val adaptiveIconSizeDp = 108 | ||
| private const val adaptiveIconOuterSidesDp = 18 | ||
| private const val directShareCategory = "im.vector.app.SHORTCUT_SHARE" | ||
|
|
||
| class ShortcutCreator @Inject constructor( | ||
| private val context: Context, | ||
|
|
@@ -65,6 +66,10 @@ class ShortcutCreator @Inject constructor( | |
| .setShortLabel(roomSummary.displayName) | ||
| .setIcon(bitmap?.toProfileImageIcon()) | ||
| .setIntent(intent) | ||
|
|
||
| // Make it show up in the direct share menu | ||
| .setCategories(setOf(directShareCategory)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is maybe not the ideal place to add this code. I think other apps create direct share shortcut once something has been shared, for a quicker future sharing to the same target.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, maybe I have misunderstood this. I think it is OK actuallly
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Such a ranking is still done on the android side (of course only with the shortcuts published to them).
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, my remark was just about what will be the rooms exposed here |
||
|
|
||
| .build() | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <shortcuts xmlns:android="http://schemas.android.com/apk/res/android"> | ||
| <share-target android:targetClass="im.vector.app.features.share.IncomingShareActivity"> | ||
| <data android:mimeType="*/*" /> | ||
| <category android:name="im.vector.app.SHORTCUT_SHARE" /> | ||
| </share-target> | ||
| </shortcuts> |
Uh oh!
There was an error while loading. Please reload this page.