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

app:checkDebugDuplicateClasses Duplicate Picasso #23

Closed
zebhi opened this issue Jul 8, 2019 · 6 comments
Closed

app:checkDebugDuplicateClasses Duplicate Picasso #23

zebhi opened this issue Jul 8, 2019 · 6 comments
Assignees

Comments

@zebhi
Copy link

zebhi commented Jul 8, 2019

Query
I used Picasso Library before use this AutoImageFlipper. After compile my App, I got error Duplicate Picasso Class. Can you help me, how to fix this issue?

Version of the library used
I used AutoImageFlipper version com.github.technolifestyle:imageslider:1.5.6 which conflict with Picasso-2.5.2.

@therealshabi
Copy link
Owner

You don't need to include Picasso library explicitly, it's already included in AutoImageFlipper, so use that maybe? This is the reason for your issue.

@vitorhugods
Copy link

I don't think Picasso should be included into the library by default.

The developer might already be using using Glide, Volley, Picasso, or doing it manually, processing the image and resizing, applying filters, and so on.

Adding Picasso forces an extra dependency, and forces the current version.
Currently Picasso is in the version 2.71828. So the version bundled here is outdated.

And you cannot use exclude in Gradle to replace the bundled Picasso from this library, as the bundled version 2.5.2 uses Picasso.with(context).load("url"). And the current, updated version of Picasso, uses Picasso.get().load("url"). So they are completely incompatible.

My suggestion:
The only usage of Picasso in this library is in the bindData method, here.

Replace it with an interface. So the developers can do:

flipperView.setBinder{ imageView, url, imageRes ->
    Picasso.get().load(url).into(imageView)
    //Or whatever the developer wants to do here. Can use any library of choice.
}

Another suggestion would be to allow any Object as the image resource. If the developer does not have a URL, but has a Bitmap, or any other source. And use this Object instead of url and imageRes, when binding.

@therealshabi
Copy link
Owner

Hey @vitorhugods, Many thanks for your suggestions and I understand some of the bad practices I used here. I already have these things in my mind, and I'm aware that I shouldn't have used Picasso here as a dependency. I, in fact, developed this library for my personal project work but thereafter thought of releasing this as an open-source library.

The thing is that I am not getting much time to work on this, and it is really not "developed" since 2017.
I liked all your suggestions especially regarding the usage of an interface, with which I can expose the image to the user and they can load whatever way they want to load. I'll definitely try to implement all of them ASAP.

This is what open source is all about, worthy suggestions like these. Even you are most welcome to contribute to this library if you want. Thanks again :)

@vitorhugods
Copy link

Don't know if I sounded harsh or rude. I'm really sorry if I did, it was not my intention.

Very wholesome of you to be open to suggestions. I've came across too many too-proud people in the open source community that won't accept criticism, or are willing to let a big project die instead of passing the torch when there is no personal time left to dedicate to moderating it.

Don't get me wrong, I'm not using your library, I was searching libraries for other purposes when found this project and figured I could just give my honest opinion.

Great work, and keep it up!

@therealshabi
Copy link
Owner

Hey @vitorhugods, thanks again buddy and you were absolutely neither harsh nor rude in anyways, rather I am open to more suggestions like these, it will only help this library getting better and better and subsequently will help the community too.

@therealshabi therealshabi self-assigned this Jul 23, 2019
@therealshabi
Copy link
Owner

Fixed in 7662b15

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants