imablanco / Zoomy

Zoomy is an easy to use pinch-to-zoom Android library
918 stars 120 forks source link

Gif/complex layout support #15

Closed katie-cb closed 5 years ago

katie-cb commented 5 years ago

Allow dev define the view to be used for zooming. This will allow gif support as well as complex layout zoom support.

imablanco commented 5 years ago

This would not even work...

katie-cb commented 5 years ago

This is live code in my project, its been tested and working.

katie-cb commented 5 years ago

Did you test it?

imablanco commented 5 years ago

Yes I checkout the code and tested it. Did you forget tu push something else? If duplicatedTarget is passed to Builder it will crash, as the given View already has a parent.

katie-cb commented 5 years ago

You need to create a new view that doesn't have a parent attached, instead of reusing the view. Maybe I can add some documentations.

For example


if (imageUrl.endsWith(".gif")) {
                val duplicate = MyImageView(itemView.context)
                // load gif
                duplicate.loadImage(imageUrl)
                builder.setTargetDuplicate(duplicate)
}
imablanco commented 5 years ago

Please update the MR with an example.