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

Abstract image loading #12

Closed
zsoltk opened this issue Sep 13, 2015 · 4 comments
Closed

Abstract image loading #12

zsoltk opened this issue Sep 13, 2015 · 4 comments

Comments

@zsoltk
Copy link

zsoltk commented Sep 13, 2015

Hello there, great lib!

What first came to my mind is that loading the image could be abstracted away through an interface, so that client code can use whatever technique it wants (popular libraries like Picasso, Glide, Universal Image Loader, Fresco, etc.) instead of directly loading a Bitmap.

So rather than using addImage(Bitmap image), it would be addImage(ScrollGalleryViewItem item), where:

interface ScrollGalleryViewItem {
    View getView();
    View getThumbnail(int thumbnailSize);
}

(Just a rough sketch, but you get the idea)

Also, there would be a default implementation of this interface SimpleScrollGalleryViewItem, which simply does what the lib currently does, so that people can easily use the lib without any extra code right away.

What do you think?

Ps.: 👍 for the nice, clean code :)

@VEINHORN
Copy link
Owner

@zsoltk Thank you. 👍

@inver
Copy link
Contributor

inver commented Dec 6, 2015

@zsoltk I improved library for loading media through a loader. You can check it in my fork.

@zsoltk
Copy link
Author

zsoltk commented Dec 28, 2015

@inver did this eventually get merged in #21 ?

@inver
Copy link
Contributor

inver commented Dec 28, 2015

@zsoltk Yes

@zsoltk zsoltk closed this as completed Dec 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants