[Feature]: Add share button to bottom sheet
czlucius opened this issue · 13 comments
Is your feature request related to a problem? Please describe.
Users cannot share the scanned text and have to copy and paste in their desired app
Describe the solution you'd like
Add a share chip to the action bar on the bottom sheet dialog.
Describe alternatives you've considered
Copy and paste the text scanned.
Additional context
can we add a share button in the bottom dialog and pass the text fields to that and share them using intent.
We can add a chip to the current Actions pane.
Currently, the architecture of this app is built such that the buttons shown on the bottom dialog are created for each Action
supplied. An Action
(https://github.com/czlucius/code-scanner/blob/main/app/src/main/java/com/czlucius/scan/objects/actions/Action.java) is supplied to a predefined Type
(https://github.com/czlucius/code-scanner/blob/main/app/src/main/java/com/czlucius/scan/objects/Type.java), which will be used by the bottom dialog to show the buttons
Currently, I have a Share Action ready, but the implementation is not quite polished:
It calls data.constructShareIntent for the data type. https://github.com/czlucius/code-scanner/blob/main/app/src/main/java/com/czlucius/scan/objects/actions/ShareAction.java#L42
So for the data types in https://github.com/czlucius/code-scanner/tree/main/app/src/main/java/com/czlucius/scan/objects/data, you have to override the constructShareIntent
here (if a custom intent is needed, else it will just share text)
Especially for the contact, Wi-Fi, geolocation intents, they are not just simple plain text intents
so we have to create intents for special cases and override the custom intent.
Yes
For contacts you have to create a VCF file and share via the content provider
An example
Hello @czlucius can you assign this project to me so that I will try to add share button at bottom sheet.
You can come out with the code changes first, and make a PR. Afterwards, I will assign the issue.
barcode library from android is deprecated. and it is giving some error in my studio.
Can I have a screenshot? ML Kit is not deprecated, its still supported by Google.
I am still figuring it out. Will contact you if doesn't find anything.