okaybroda / imagezoom Goto Github PK
View Code? Open in Web Editor NEWAn Android library that makes any view to be zoomable.
License: GNU General Public License v3.0
An Android library that makes any view to be zoomable.
License: GNU General Public License v3.0
how to set minimum scale so the zoom image can't be smaller than original imageview size?
Hello, I found this issue on various devices, it mostly happens in Samsung devices, any idea how to fix it?
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setScaleX(float)' on a null object reference at com.viven.imagezoom.ImageZoomHelper$2.onAnimationUpdate(ImageZoomHelper.java:213) at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1463) at android.animation.ValueAnimator.animationFrame(ValueAnimator.java:1384) at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1427) at android.animation.ValueAnimator$AnimationHandler.doAnimationFrame(ValueAnimator.java:759) at android.animation.ValueAnimator$AnimationHandler$1.run(ValueAnimator.java:801) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911) at android.view.Choreographer.doCallbacks(Choreographer.java:686) at android.view.Choreographer.doFrame(Choreographer.java:619) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:7325) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Seems likes when we reach the onAnimationUpdate in ImageZoomHelper(line 162) the zoomableView is null, any idea why this happends?
If we add a this.zoomableView != null
in that method do you think it will be fixed?
Any help I'll be grateful.
I am facing one issue when using ImageZoom inside recyclerview. The issue is that, whole image or some part of image becomes invisible at the time of zooming.
(I have wrapped ImageView in FrameLayout as mention in library use case description )
Please refer following screenshots for more details of issues.
Before zooming:
As you can seen in second screenshot after zooming first image multiple time first image goes invisible and after zooming second image multiple times , some part of image goes invisible...
Your library is really good but It s crash when render a bigger image.
AppCompatImageView not displayed because it is too large to fit into a software layer (or drawing cache), needs 10765440 bytes, only 8294400 available
java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
at android.graphics.Bitmap.createBitmap(Bitmap.java:773)
at com.viven.imagezoom.ImageZoomHelper.onDispatchTouchEvent(ImageZoomHelper.java:106)
i want only zoom on pinch not move any where on screen. how can i achieve it
When i do a zoom out, there is a little flick in the imageview.
The ImageView is inside a RecyclerView and its loaded with Glide.
This library is working well with Fragment, but not DialogFragment. How to solve this issue?
I need my image to be only able to zoom in
The application element in the manifest causes merge failures when the library is used in an application with allowBackup="true".
https://github.com/okaybroda/ImageZoom/blob/master/library/src/main/AndroidManifest.xml
It is possible to override with 'tools:replace="android:allowBackup", but it would be nice if the property can be used as intended.
Hi, some compliments for the lib, it is the most powerful pinch to zoom that exist ๐
But I have a problem after release one finger: the view is moved down.
Here the xml: https://www.dropbox.com/s/qhy607wi45rb803/activity.xml?dl=0
Here the view before zoom: https://www.dropbox.com/s/mfe0ocijvrolggi/1.png?dl=0
Here the view after release one finger from zoom: https://www.dropbox.com/s/4am83s6tnonnqko/2.png?dl=0
I've colored view to know which is moved.
Can you help me?
Thanks!
I have one recyclerview which needs to be zoomed, i wrapped it with frame layout and gave id 'zoomable'. There are other view also, in my case recyclerview should be zoomed within its bound only.
Issue is : recyclerview is poped out of its place and is zooming all over the screen.
When pinch start on image and end , image view flikers due to setting placeHolderView background
@OverRide
public boolean dispatchTouchEvent(MotionEvent ev) {
return imageZoomHelper.onDispatchTouchEvent(ev) || super.dispatchTouchEvent(ev);
}
11-23 16:40:50.623 17535-17535/compro.a99vr E/AndroidRuntime: FATAL EXCEPTION: main
Process: compro.a99vr, PID: 17535
java.lang.ClassCastException: android.widget.FrameLayout$LayoutParams cannot be cast to android.widget.LinearLayout$LayoutParams
at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
at android.view.View.measure(View.java:17562)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5536)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
at android.view.View.measure(View.java:17562)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5536)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
at android.view.View.measure(View.java:17562)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5536)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:436)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139)
at android.view.View.measure(View.java:17562)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5536)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
at android.view.View.measure(View.java:17562)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5536)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:436)
at android.view.View.measure(View.java:17562)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5536)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1436)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:722)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:613)
at android.view.View.measure(View.java:17562)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5536)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:436)
at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2871)
at android.view.View.measure(View.java:17562)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2015)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1173)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1379)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1061)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5891)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767)
at android.view.Choreographer.doCallbacks(Choreographer.java:580)
at android.view.Choreographer.doFrame(Choreographer.java:550)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5294)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
How to get time of video ? Means when a button clicked on which second or minute my video was ?
When you initially grab the image, there is a huge flicker! I found this even on your sample app, so I know it's not anything I did when integrating into my project.
Hello,
This is not a issue but I am trying to achieve the functionality like zooming image from its touch coordinates. can you help me through it ?
updateZoomableViewMargins(newCenter[0] - twoPointCenter[0] + originalXY[0], newCenter[1] - twoPointCenter[1] + originalXY[1]);
I tried a lot to tweaking above code segment but couldn't get success.
How I can override this method in fragment?
@Override public boolean dispatchTouchEvent(MotionEvent ev) { return imageZoomHelper.onDispatchTouchEvent(ev) || super.dispatchTouchEvent(ev); }
Hi I'm really proud and apprciate it about this library help me on Activity, can you give me knowledge how to setup in RecyclerView Adapter event we have create adapter on Class? Because I didn't know how to setup ImageZoomHelper imageZoomHelper; and imageZoomHelper = new ImageZoomHelper(this); also for dispatchTouchEvent.
Thanks and Regards
Edi Kurniawan
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.