Closed avitaker closed 7 years ago
Thanks. Could you squash these commits into one, please? It looks great.
Is https://github.com/murraycu/android-galaxyzoo/pull/36 the new version of this?
Yes, #36 is the new version of this. I fixed the issues you brought up on that one
OK. Next time, you don't need to create a new issue. You can just force push your changes to your existing branch and they will show up in the existing issue. At least that's how I usually do it.
Solves issue #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 mUriStandardRemote is not null.