Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Pinch to Zoom and ScaleType.MATRIX support #86
See a manual implementation here:
Is there a way to make this work with Fresco?
You can implement your own zoomable view by extending SimpleDraweeView and overriding its
All you need to do now is to implement your zoomable controller that, based on touch events, image bounds and view bounds, computes the transformation matrix. Unfortunately, I can't provide more information on how to do that, but it seems that the link you provided does something similar...
Getting the view bounds is pretty straightforward:
Just to share my final solution with everybody, as I didn't have time to work on custom multi-touch to zoom implementation on SimpleDraweeView, I decided to directly call Frescos Image Pipeline to get a raw Bitmap, as it is possible, and set it on a normal ImageView. If you do this, make sure you manually destroy your view and free Bitmap memory to prevent memory leaks..
On to the point, if anybody for any reason wants to use Fresco to load image into a normal ImageView, here is the full code to do it:
I had to use the post Runnable thread, as it seems the "onNewResultImpl" method is not called from the UI thread, so it wouldn't work otherwise.
To make the kunny's zoomable sample enable doubleTap,
(1) on /com.facebook.samples.zoomable/DefaultZoomableController.java,
(2) on /com.facebook.samples.zoomable/ZoomableDraweeView.java,
(3) create /com.facebook.samples.zoomable/DoubleTapZoomableController.java file.
now you can even enable doubleTap gesture for zooming.
Is anyone able to use ZoomableDraweeView?
I'm displaying it in a fragment which is a page in ViewPager using basic controller setup.
if I'm seting the hierarchy after calling "setController" i'm not getting any crashes, but image is not set and "onFinalImageSet" is not called, if there is something wrong "onFailure" could be called, but it doesn' t.
If i'm calling "setHierarchy" before "setController" I'm getting another crash.
Can anyone provide an example of how to use the ZoomableDraweeView properly?
Hi, i am trying tow implements ZoomableDraweeView within my app images gallery. So basically it is a view pager with a set of fragment to display the images. The problem i am facing is that the images does not show and the controller listener does not even get notified !! No way to debug.
Here is a piece of code responsible of displaying the image within a fragment:
and below the fragment layout:
if anyone can help me please , it has been 2 days since i am stuck in this.
referenced this issue
Oct 15, 2015
I also tried to use ZoomableDraweeView in Fragment, but getting NPE error:
Here is my code
Can somebody provide sample code how should we use ZoomableDraweeView.
Sorry, found sample above in comments https://github.com/kunny/ZoomableDraweeView-sample
I implemented successfully ZoomableDraweeView. But have problem when doing zoom, and the rotating device.
To reproduce issue: Rotate device to landscape, zoom a bit, then rotate it to portait and you should see image moved to bottom(like in image below). If you touch image it will jump to correct position(will center image position).