-
Notifications
You must be signed in to change notification settings - Fork 6.1k
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
Support contact uris #394
Comments
I'm wondering, What do I need to know about Glide in order to be able to add this feature to Glide? In other words is there some sort of an example to start reading from that could enrich my knowledge about Glide? |
PR or for yourself? |
Yes, a PR, I'd like to send a PR. |
Cool :) 3.8.0 or v4? |
I guess 3.8.0 will be good, as this feature would reach many users who could be afraid of migrating to v4 when it gets released. |
@R4md4c Thank you very much for coming with a request like this, it's awesome! To start dev: first do Build (probably worth doing it on your fork). Then if it works in command line, then Development. This feature needs to be integrated into the leftmost arrow in this flow Once your env is up take a look at A thing to look out for may be that the following needs to continue to work after this new feature is introduced (on API 14+): Glide.with(...)
.load(Uri.withAppendedPath(contactUri, Contacts.Photo.DISPLAY_PHOTO) because the authority matches, but it doesn't need to be pushed through Useful resource for debugging: https://github.com/bumptech/glide/wiki/Debugging-and-Error-Handling. |
Thanks for the super helpful introduction! I'll try to do what I could, and I think I can do it, but I might ask some questions especially when writing tests. The branch that I should work on is 3.0, right? |
Yep. |
If I wanted to test loading a contact photo what is the best way to test? Do I create an application for that? or Do I use Robolectric? I don't know if Robolectric support testing a contact Content Uri or not, Is there any test class that might have a similar use case? |
I think you should use Roboelectric and mock the ContentResolver to return a MatrixCursor with the right columns; for visual test/debug I guess you can modify one of the sample apps. @sjudd probably can tell you more about this. |
For the time being I hacked an existing project to make sure that loading contacts works. It now supports these Uri variations.
|
Robolectric requires more or less mocking out the entire contacts provider. You can use it, but probably a better idea is to just create a small sample app. It can be as simple as just loading the contact photo from one particular contact, or just loading all of the contacts into a list. |
Closing since #1119 is merged. |
(minor cosmetic changes were applied and more examples added)
http://stackoverflow.com/questions/29438701/how-to-load-a-uri-with-content-prefix-using-glide-android
The text was updated successfully, but these errors were encountered: