-
Notifications
You must be signed in to change notification settings - Fork 206
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
Use a NetworkBitmapClient as a wrapper for Picasso #139
Use a NetworkBitmapClient as a wrapper for Picasso #139
Conversation
c54611a
to
662479a
Compare
Yes yes yes + 1000 to that proposal, I'll try to review PR in a few days (very busy, sorry), thanks! |
No problem mate! |
Current coverage is
|
|
||
private final Picasso picasso; | ||
|
||
public PicassoBitmapClient(final Picasso picasso) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could not we just use Constructor injection here?
Nice 👍 left a few comments here and there |
Thanks @vanniktech, I'm going to fix them. |
662479a
to
d9aca5c
Compare
import android.widget.ImageView; | ||
|
||
public interface NetworkBitmapClient { | ||
void downloadInto(String url, ImageView imageView); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nullability annotations
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to put @UiThread
annotation here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need it? Idk
Just wake up, and receive a lot of comments. Thanks you guys. I'm gonna fix them. Have a nice day ^^ |
d274e19
to
cbca2d1
Compare
Just want to check status of this PR, no rush. I fixed some comments and replied some comments. How do you think about this @artem-zinnatullin, @vanniktech 😄 |
|
||
@SuppressWarnings("NullableProblems") // Initialized in @Before. | ||
@NonNull | ||
RequestCreator loadRequestCreator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be private
Few nits 👍 |
@@ -49,4 +51,9 @@ public Picasso providePicasso(@NonNull Application qualityMattersApp, @NonNull O | |||
.downloader(new OkHttp3Downloader(okHttpClient)) | |||
.build(); | |||
} | |||
|
|||
@Provides @NonNull @Singleton | |||
public QualityMattersImageLoader provideNetworkBitmapClient(@NonNull PicassoImageLoader picassoBitmapClient) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be renamed to provideImageLoader
or something :)
few things, otherwise 👍 |
331e25e
to
e6a5e38
Compare
Fixed all the comments and some inaccurate variable names. |
👍 |
@NonNull | ||
private final Picasso picasso; | ||
|
||
@Inject |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed
Sorry, didn't see |
We need
Follow this comment: #139 (comment) |
Oh damn, can you please just |
Fix it now :) |
e6a5e38
to
c975bfc
Compare
Fixed it, just wait for CIs ;) |
Great, thanks! |
@artem-zinnatullin why don't you like constructor injection there? |
It's same implicit thing as Not a fan of all Square decisions/solutions but they said that they switched to modules-only too because of implicity and some other problems https://www.youtube.com/watch?v=3B7F7emCc64 |
We should use a wrapper for Picasso instead of using it directly. With a wrapper we can easily switch to another ImageCaching client such as: Glide.