Skip to content
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

feat: share image directly via share menu item #35

Closed
wants to merge 3 commits into from

Commits on Apr 6, 2017

  1. feat: share image directly via share menu item

    Solves issue murraycu#30.
    
    Previously, there were permission problems from trying to share the image to image sharing apps, according to the issue tracker. The following changes were made:
    FileProvider class is defined in AndroidManifest, along with the required meta-data and associated files (a string was added to strings.xml for the provider authority). This is apparently required for sharing streams in Android M and above.
    Temporary file of the image is written to keep track of exact file location, as well as have a temporary cache of previously shared images. This is done in an AsyncTask that is defined at the bottom of SubjectFragment and executed in the updateShareIntent method.
    In devices with Android M or above, explicit permission to write and read images is obtained if not already provided.
    The FileProvider class is used to create the URI that will eventually be sent in the intent.
    An intent flag is added for purposes of magic (I'm not really sure what it does, but it works).
    
    In the limited use case of trying to share images, this code works. Additional changes might be required to distinguish text from image intents to share, because the code right now will set the share intent to an image type if mUriImageRemote is not null.
    avitaker committed Apr 6, 2017
    Configuration menu
    Copy the full SHA
    6c52efc View commit details
    Browse the repository at this point in the history

Commits on Apr 7, 2017

  1. feat: share image directly via share menu item

    Solves issue murraycu#30. Now added some documentation, removed some generated files and hardcoded strings.
    
    Previously, there were permission problems from trying to share the image to image sharing apps, according to the issue tracker. The following changes were made:
    FileProvider class is defined in AndroidManifest, along with the required meta-data and associated files (a string was added to strings.xml for the provider authority). This is apparently required for sharing streams in Android M and above.
    Temporary file of the image is written to keep track of exact file location, as well as have a temporary cache of previously shared images. This is done in an AsyncTask that is defined at the bottom of SubjectFragment and executed in the updateShareIntent method.
    In devices with Android M or above, explicit permission to write and read images is obtained if not already provided.
    The FileProvider class is used to create the URI that will eventually be sent in the intent.
    An intent flag is added for purposes of magic (I'm not really sure what it does, but it works).
    
    In the limited use case of trying to share images, this code works. Additional changes might be required to distinguish text from image intents to share, because the code right now will set the share intent to an image type if mUriImageRemote is not null.
    avitaker committed Apr 7, 2017
    Configuration menu
    Copy the full SHA
    8d31c99 View commit details
    Browse the repository at this point in the history

Commits on Apr 10, 2017

  1. feat: share image directly via share menu item

    Solves issue murraycu#30. Now added some documentation, removed some generated files and hardcoded strings.
    
    Previously, there were permission problems from trying to share the image to image sharing apps, according to the issue tracker. The following changes were made:
    FileProvider class is defined in AndroidManifest, along with the required meta-data and associated files (a string was added to strings.xml for the provider authority). This is apparently required for sharing streams in Android M and above.
    Temporary file of the image is written to keep track of exact file location, as well as have a temporary cache of previously shared images. This is done in an AsyncTask that is defined at the bottom of SubjectFragment and executed in the updateShareIntent method.
    In devices with Android M or above, explicit permission to write and read images is obtained if not already provided.
    The FileProvider class is used to create the URI that will eventually be sent in the intent.
    An intent flag is added for purposes of magic (I'm not really sure what it does, but it works).
    
    In the limited use case of trying to share images, this code works. Additional changes might be required to distinguish text from image intents to share, because the code right now will set the share intent to an image type if mUriImageRemote is not null.
    avitaker committed Apr 10, 2017
    Configuration menu
    Copy the full SHA
    88c6d4d View commit details
    Browse the repository at this point in the history