Implementation of ImageView for Android that supports zooming, by various touch gestures.

Related tags

ImageView PhotoView
Overview

PhotoView

PhotoView aims to help produce an easily usable implementation of a zooming Android ImageView.

[

Dependency

Add this in your root build.gradle file (not your module build.gradle file):

allprojects {
    repositories {
        maven { url "https://www.jitpack.io" }
    }
}

buildscript {
    repositories {
        maven { url "https://www.jitpack.io" }
    }	
}

Then, add the library to your module build.gradle

dependencies {
    implementation 'com.github.chrisbanes:PhotoView:latest.release.here'
}

Features

  • Out of the box zooming, using multi-touch and double-tap.
  • Scrolling, with smooth scrolling fling.
  • Works perfectly when used in a scrolling parent (such as ViewPager).
  • Allows the application to be notified when the displayed Matrix has changed. Useful for when you need to update your UI based on the current zoom/scroll position.
  • Allows the application to be notified when the user taps on the Photo.

Usage

There is a sample provided which shows how to use the library in a more advanced way, but for completeness, here is all that is required to get PhotoView working:

<com.github.chrisbanes.photoview.PhotoView
    android:id="@+id/photo_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>
PhotoView photoView = (PhotoView) findViewById(R.id.photo_view);
photoView.setImageResource(R.drawable.image);

That's it!

Issues With ViewGroups

There are some ViewGroups (ones that utilize onInterceptTouchEvent) that throw exceptions when a PhotoView is placed within them, most notably ViewPager and DrawerLayout. This is a framework issue that has not been resolved. In order to prevent this exception (which typically occurs when you zoom out), take a look at HackyDrawerLayout and you can see the solution is to simply catch the exception. Any ViewGroup which uses onInterceptTouchEvent will also need to be extended and exceptions caught. Use the HackyDrawerLayout as a template of how to do so. The basic implementation is:

public class HackyProblematicViewGroup extends ProblematicViewGroup {

    public HackyProblematicViewGroup(Context context) {
        super(context);
    }

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        try {
            return super.onInterceptTouchEvent(ev);
        } catch (IllegalArgumentException e) {
						//uncomment if you really want to see these errors
            //e.printStackTrace();
            return false;
        }
    }
}

Usage with Fresco

Due to the complex nature of Fresco, this library does not currently support Fresco. See this project as an alternative solution.

Subsampling Support

This library aims to keep the zooming implementation simple. If you are looking for an implementation that supports subsampling, check out this project

License

Copyright 2018 Chris Banes

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • IllegalArgumentException (pointerIndex out of range) while using many fingers to zoom in and out

    IllegalArgumentException (pointerIndex out of range) while using many fingers to zoom in and out

    (Android 4.2.1 - Samsung Galaxy Nexus)

    java.lang.IllegalArgumentException: pointerIndex out of range at android.view.MotionEvent.nativeGetAxisValue(Native Method) at android.view.MotionEvent.getX(MotionEvent.java:1981) at android.support.v4.view.MotionEventCompatEclair.getX(MotionEventCompatEclair.java:32) at android.support.v4.view.MotionEventCompat$EclairMotionEventVersionImpl.getX(MotionEventCompat.java:86) at android.support.v4.view.MotionEventCompat.getX(MotionEventCompat.java:184) at android.support.v4.view.ViewPager.onInterceptTouchEvent(ViewPager.java:1339) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1817) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2174) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1917) at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1953) at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1405) at android.app.Activity.dispatchTouchEvent(Activity.java:2410) at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1901) at android.view.View.dispatchPointerEvent(View.java:7419) at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3220) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3165) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4292) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4271) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4363) at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:179) at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method) at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:171) at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4342) at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4382) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749) at android.view.Choreographer.doCallbacks(Choreographer.java:562) at android.view.Choreographer.doFrame(Choreographer.java:530) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735) at android.os.Handler.handleCallback(Handler.java:725) at android.os.Handler.dispatchMessage(Handler.java:92) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5191) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562) at dalvik.system.NativeStart.main(Native Method)

    bug duplicate 
    opened by adrien-aubel 34
  •  java.lang.ArrayIndexOutOfBoundsException: length=1; index=1

    java.lang.ArrayIndexOutOfBoundsException: length=1; index=1

    hi,

    I try to use your library but i have the exception bellow when zoom in.

    08-30 22:44:43.437  20210-20210/com.******E/AndroidRuntime: FATAL EXCEPTION: main
            java.lang.ArrayIndexOutOfBoundsException: length=1; index=1
            at android.support.v4.widget.ViewDragHelper.shouldInterceptTouchEvent(ViewDragHelper.java:1004)
            at android.support.v4.widget.DrawerLayout.onInterceptTouchEvent(DrawerLayout.java:855)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1852)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2209)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1952)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2209)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1952)
            at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2209)
            at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1952)
            at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1966)
            at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1418)
            at android.app.Activity.dispatchTouchEvent(Activity.java:2424)
            at android.support.v7.app.ActionBarActivityDelegateICS$WindowCallbackWrapper.dispatchTouchEvent(ActionBarActivityDelegateICS.java:255)
            at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1914)
            at android.view.View.dispatchPointerEvent(View.java:7564)
            at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:3883)
            at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3778)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
            at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429)
            at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398)
            at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3483)
            at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406)
            at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3540)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
            at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3429)
            at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3398)
            at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3406)
            at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3379)
            at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5419)
            at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5399)
            at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5370)
            at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5493)
            at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:182)
            at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
            at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:174)
            at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:5472)
            at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:5512)
            at android.view.Choreographer$CallbackRecord.run(Choreographer.java:749)
            at android.view.Choreographer.doCallbacks(Choreographer.java:562)
            at android.view.Choreographer.doFrame(Choreographer.java:530)
            at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:735)
            at android.os.Handler.handleCallback(Handler.java:730)
            at android.os.Handler.dispatchMessage(Handler.java:92)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:5103)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:525)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
            at dalvik.system.NativeStart.main(Native Method)
    
    bug 
    opened by Michenux 30
  • ViewPager memory issues and dev branch sample not working

    ViewPager memory issues and dev branch sample not working

    I was having the memory leak issues using a ViewPager, so I switched over to the dev branch to try out those changes. However, after trying for a while to get it to work, it never seemed to register to be able to zoom and tap the photo. So I decided to try the sample app from this repo (on the dev branch). That app wasn't working for me either.

    Could someone else please verify that I'm not crazy or missing something?

    In the meantime, I've gone back to the master branch and just implemented the cleanup function in the attacher myself for now.

    opened by kutothe 21
  • Crash

    Crash

    When i zoom out the image i'm facing this crash.

    java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 at android.support.v4.widget.ViewDragHelper.saveLastMotion(ViewDragHelper.java:849) at android.support.v4.widget.ViewDragHelper.shouldInterceptTouchEvent(ViewDragHelper.java:1057) at android.support.v4.widget.DrawerLayout.onInterceptTouchEvent(DrawerLayout.java:1434) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2059) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172) at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2430) at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2172) at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2376) at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1727) at android.app.Activity.dispatchTouchEvent(Activity.java:2783) at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:60) at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2337) at android.view.View.dispatchPointerEvent(View.java:8585) at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4074) at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:3940) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3485) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3538) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3504) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3512) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3485) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3538) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3504) at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3614) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3512) at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3671) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3485) at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3538) at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3504) at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3512) at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3485) at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:5759) at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:5733) at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:5704) at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:5878) at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:185) at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method) at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:176) at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:5828) at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:5901) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:767) at android.view.Choreographer.doCallbacks(Choreographer.java:580) at android.view.Choreographer.doFrame(Choreographer.java:548) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:753) at android.os.Handle

    opened by alcntml 20
  •  ImageView no longer exists. You should not use this PhotoViewAttacher any more.

    ImageView no longer exists. You should not use this PhotoViewAttacher any more.

    05-02 17:21:59.583: E/AndroidRuntime(6325): FATAL EXCEPTION: main 05-02 17:21:59.583: E/AndroidRuntime(6325): java.lang.IllegalStateException: ImageView no longer exists. You should not use this PhotoViewAttacher any more. 05-02 17:21:59.583: E/AndroidRuntime(6325): at com.yijian.app.view.photoview.PhotoViewAttacher.getImageView(PhotoViewAttacher.java:210) 05-02 17:21:59.583: E/AndroidRuntime(6325): at com.yijian.app.view.photoview.PhotoViewAttacher.update(PhotoViewAttacher.java:482) 05-02 17:21:59.583: E/AndroidRuntime(6325): at com.yijian.app.view.photoview.PhotoView.setImageDrawable(PhotoView.java:114) 05-02 17:21:59.583: E/AndroidRuntime(6325): at android.widget.ImageView.setImageBitmap(ImageView.java:377) 05-02 17:21:59.583: E/AndroidRuntime(6325): at com.yijian.app.activity.GalleryActivity$TestAdapter$1.onLoadingComplete(GalleryActivity.java:287) 05-02 17:21:59.583: E/AndroidRuntime(6325): at com.nostra13.universalimageloader.core.DisplayBitmapTask.run(DisplayBitmapTask.java:64) 05-02 17:21:59.583: E/AndroidRuntime(6325): at android.os.Handler.handleCallback(Handler.java:605) 05-02 17:21:59.583: E/AndroidRuntime(6325): at android.os.Handler.dispatchMessage(Handler.java:92) 05-02 17:21:59.583: E/AndroidRuntime(6325): at android.os.Looper.loop(Looper.java:137) 05-02 17:21:59.583: E/AndroidRuntime(6325): at android.app.ActivityThread.main(ActivityThread.java:4424) 05-02 17:21:59.583: E/AndroidRuntime(6325): at java.lang.reflect.Method.invokeNative(Native Method) 05-02 17:21:59.583: E/AndroidRuntime(6325): at java.lang.reflect.Method.invoke(Method.java:511) 05-02 17:21:59.583: E/AndroidRuntime(6325): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787) 05-02 17:21:59.583: E/AndroidRuntime(6325): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554) 05-02 17:21:59.583: E/AndroidRuntime(6325): at dalvik.system.NativeStart.main(Native Method)

    opened by fanei 17
  • ImageView inside ViewPager ignores layout params

    ImageView inside ViewPager ignores layout params

    I have an ImageView in a fragment hosted by a view pager. The fragment layout is a RelativeLayout and the ImageView is centerPositioned inside of it. When I initialize the PhotoAttacher with the ImageView the image starts at the top of the screen instead of in the center of the screen. If I touch and drag a tiny bit in any direction the image immediately snaps into place. The image is loaded dynamically from the web if that is useful.

    bug 
    opened by pfives 15
  • Cannot move around a zoomed image in 1.2.2 when it is placed inside ViewPager

    Cannot move around a zoomed image in 1.2.2 when it is placed inside ViewPager

    In the latest version 1.2.2 the PhotoView behavior when it is placed inside a ViewPager is different from 1.2.1. In the previous version you can easily perform an image zoom and move around the image. In this new version, it is hard to move to the image bounds as the ViewPager is intercepting touch events and tries to switch page instead of moving inside zoomed image.

    bug 
    opened by alvarolb 15
  • the imgview is not int the center, when i use the PhotoViewAttacher

    the imgview is not int the center, when i use the PhotoViewAttacher

    the imgview is not int the center, when i use the PhotoViewAttacher. The photo is always at the top ,but when i touch the photo , the photo move to the center.Please help me .

    opened by AnswerZhao 14
  • Failed to resolve: com.github.chrisbanes.photoview:library:2.0.0

    Failed to resolve: com.github.chrisbanes.photoview:library:2.0.0

    When I use it at Android studio ,I have Add "maven { url "https://jitpack.io" } " in root build.gradle file ,and dependencies { implementation 'com.github.chrisbanes:PhotoView:2.0.0' }... but Failed to resolve: com.github.chrisbanes.photoview:library:2.0.0

    opened by zhangzhen92 13
  • pointerIndex out of range exception

    pointerIndex out of range exception

    I read the issue about the array out of range but i don't know if those problem are related....anyway, while "abusing" the zoom i get this pointer out of range exception.. here is the full stack trace:

    04-14 01:24:53.365  14157-14157/niry.mygrandsons E/InputEventReceiver﹕ Exception dispatching input event.
    04-14 01:24:53.385  14157-14157/niry.mygrandsons E/AndroidRuntime﹕ FATAL EXCEPTION: main
        java.lang.IllegalArgumentException: pointerIndex out of range
                at android.view.MotionEvent.nativeGetAxisValue(Native Method)
                at android.view.MotionEvent.getX(MotionEvent.java:1981)
                at android.support.v4.view.MotionEventCompatEclair.getX(MotionEventCompatEclair.java:32)
                at android.support.v4.view.MotionEventCompat$EclairMotionEventVersionImpl.getX(MotionEventCompat.java:91)
                at android.support.v4.view.MotionEventCompat.getX(MotionEventCompat.java:219)
                at android.support.v4.view.ViewPager.onInterceptTouchEvent(ViewPager.java:1839)
                at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1827)
                at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2241)
                at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1946)
                at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2241)
                at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1946)
                at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2241)
                at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:1946)
                at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1989)
                at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1432)
                at android.app.Activity.dispatchTouchEvent(Activity.java:2428)
                at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1937)
                at android.view.View.dispatchPointerEvent(View.java:7443)
                at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3603)
                at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3531)
                at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4783)
                at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4743)
                at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4895)
                at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:179)
                at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
                at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:171)
                at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4863)
                at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4917)
                at android.view.Choreographer$CallbackRecord.run(Choreographer.java:776)
                at android.view.Choreographer.doCallbacks(Choreographer.java:579)
                at android.view.Choreographer.doFrame(Choreographer.java:546)
                at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:762)
                at android.os.Handler.handleCallback(Handler.java:800)
                at android.os.Handler.dispatchMessage(Handler.java:100)
                at android.os.Looper.loop(Looper.java:194)
                at android.app.ActivityThread.main(ActivityThread.java:5371)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:525)
                at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:833)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
                at dalvik.system.NativeStart.main(Native Method)
    04-14 01:24:53.524      500-526/? E/AppErrorDialog﹕ Failed to get ILowStorageHandle instance
    
    opened by Niryo 13
  • How to save state of image

    How to save state of image

    i just want to save the current state of image in photoview. when i change the zoom and apply some effects to it then the current state of image restore back to original state and i lose my zoomed state. i want to keep my current zoomed state and apply effects. is there any way to lock the panning and translation at the time i want and activate it again when i need

    opened by nithinpmolethu 11
  • Could not resolve all artifacts - com.github.chrisbanes:PhotoView:2.3.0

    Could not resolve all artifacts - com.github.chrisbanes:PhotoView:2.3.0

    Today we started with the following issues in our build! Do you have any issues with this repository?

    Thanks!

    
    **Task :app:dataBindingMergeDependencyArtifactsDevDebug FAILED**
    FAILURE: Build failed with an exception.
    * What went wrong:
    Execution failed for task ':app:dataBindingMergeDependencyArtifactsDevDebug'.
    > Could not resolve all dependencies for configuration ':app:devDebugRuntimeClasspath'.
       > Could not determine artifacts for **com.github.chrisbanes:PhotoView:2.3.0**: Skipped due to earlier error
    * Try:
    > Run with --stacktrace option to get the stack trace.
    > Run with --info or --debug option to get more log output.
    > Run with --scan to get full insights.
    * Get more help at https://help.gradle.org/
    Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
    You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
    See https://docs.gradle.org/7.4.2/userguide/command_line_interface.html#sec:command_line_warnings
    
    opened by ctellechea2001 4
  • Could not resolve all artifacts

    Could not resolve all artifacts

    Hi,

    Is it possible something is wrong with the repository for this project. Builds suddenly started failing over and over with error message:

    Could not determine the dependencies of task ':android:lintVitalInternalRelease'.
     Could not resolve all artifacts for configuration ':android:productionDebugCompileClasspath'.
     Could not resolve com.github.chrisbanes:PhotoView:1.3.0.
      Required by:
             project :android
    

    Is this something you are aware of?

    opened by Dumoulin-Lander 3
  • Openharmony  application

    Openharmony application

    I am developing an Openharmony application with JavaScript langue which used your library,will your library support Openharmony platform by JavaScript language? If so,I want to contribute to the Openharmony build of this library. Expecte for your repley!

    opened by chenguangweixi 0
  • Way to get location of tap outside view?

    Way to get location of tap outside view?

    I am looking at OnOutsidePhotoTapListener and void onOutsidePhotoTap(ImageView imageView);:

    https://github.com/Baseflow/PhotoView/blob/master/photoview/src/main/java/com/github/chrisbanes/photoview/OnOutsidePhotoTapListener.java

    🚀 Feature Requests

    This callback appears to only say what ImageView the tap was outside of but not where it was.

    Contextualize the feature / Describe the feature.

    It would be useful to get, if not the exact location of the tap, the nearest point to the tap. As it is, if the user is trying to tap on a point on the edge of the photo view they might have to try several times accidentally tapping on the wrong side of the border.

    Expected behavior, if this is possible: onOutsidePhotoTap should have the same signature as void onPhotoTap(ImageView view, float x, float y);. The coordinates returned should (probably) be clamped to the range 0..1, 0..1.

    opened by mcclure 0
Releases(2.0.0)
  • 2.0.0(Mar 18, 2017)

    • MinSDK bumped to 14
    • Listeners moved into their own classes outside of PhotoView
    • You should not need to have a reference to PhotoViewAttacher as most things can be called via the PhotoView itself.
    • PhotoView package change. Updated package will be com.github.chrisbanes.photoview.PhotoView
    Source code(tar.gz)
    Source code(zip)
  • 1.3.1(Oct 26, 2016)

    Update to the latest support library which allows for more granular dependencies. Requires an min SDK bump to 9. Sorry for those of you that were holding out!

    Source code(tar.gz)
    Source code(zip)
  • 1.3.0(Aug 2, 2016)

  • 1.2.7(Jul 26, 2016)

  • 1.2.6(Apr 15, 2016)

    Deprecate getOnPhotoTapListener and getOnViewTapListener. Change dependency to be available on jitpack instead of jcenter for easier/quicker releases

    Source code(tar.gz)
    Source code(zip)
Owner
Baseflow
We provide software, skills and knowledge and with this we want to make a contribution to the world. We love to make innovation happen.
Baseflow
ImageView and FrameLayout with gestures control and position animation

GestureViews ImageView and FrameLayout with gestures control and position animation. Main goal of this library is to make images viewing process as sm

Alex Vasilkov 2.3k Dec 30, 2022
Adds touch functionality to Android ImageView.

TouchImageView for Android Capabilities TouchImageView extends ImageView and supports all of ImageView’s functionality. In addition, TouchImageView ad

Michael Ortiz 2.4k Mar 28, 2021
Android ImageView that supports different radii on each corner.

SelectableRoundedImageView Note that this project is no longer maintained. Android ImageView that supports different radii on each corner. It also sup

Joonho Kim 1.1k Mar 17, 2021
Customizable Android full screen image viewer for Fresco library supporting "pinch to zoom" and "swipe to dismiss" gestures. Made by Stfalcon

This project is no longer supported. If you're able to switch from Fresco to any other library that works with the Android's ImageView, please migrate

Stfalcon LLC 1.8k Dec 19, 2022
Custom ImageView for android with polygon shape (Android)

PolygonImageView Create a custom ImageView with polygonal forms. Usage To use PolygonImageView, add the module into your project and start to build xm

Albert Grobas 531 Dec 25, 2022
A circular ImageView for Android

CircleImageView A fast circular ImageView perfect for profile images. This is based on RoundedImageView from Vince Mi which itself is based on techniq

Henning Dodenhof 13.8k Mar 29, 2021
Custom shaped android imageview components

Shape Image View Provides a set of custom shaped android imageview components, and a framework to define more shapes. Implements both shader and bitma

Siyamed SINIR 2.6k Mar 29, 2021
Android ImageView widget with zoom and pan capabilities

ImageViewTouch for Android ImageViewTouch is an android ImageView widget with zoom and pan capabilities. This is an implementation of the ImageView wi

Alessandro Crugnola 1.9k Jan 4, 2023
Android ImageView replacement which allows image loading from URLs or contact address book, with caching

Smart Image View for Android SmartImageView is a drop-in replacement for Android’s standard ImageView which additionally allows images to be loaded fr

James Smith 1.3k Dec 24, 2022
Implements pinch-zoom, rotate, pan as an ImageView for Android 2.1+

GestureImageView This is a simple Android View class which provides basic pinch and zoom capability for images. Can be used as a replacement for a sta

Jason 1.1k Nov 10, 2022
Android ImageView that handles animated GIF images

GifImageView Android ImageView that handles Animated GIF images Usage In your build.gradle file: dependencies { compile 'com.felipecsl:gifimageview:

Felipe Lima 1.1k Mar 9, 2021
ImageView with a tag on android

SimpleTagImageView ImageView with a tag in android. So it's a ImageView. Demo ####Warning:When you set the round radius,the simpletagimageview scale t

null 944 Nov 10, 2022
Custom ImageView for moving image around the screen (Android)

MovingImageView Create a custom ImageView for moving image around the screen. Usage To use MovingImageView, add the module into your project and start

Albert Grobas 819 Nov 18, 2022
Flickable ImageView for Android. It's like a view of twitter's detail image.

FlickableView Flickable ImageView for Android. It's like a view of twitter's detail image. It's possible that other views animate with FlickableView.

goka 153 Nov 14, 2022
Create parallax and any other transformation effects on scrolling android ImageView

Android Parallax Image View Creates effect such as vertical parallax, horizontal parallax etc. on android ImageView when it's being vertically or hori

Aris 164 Dec 7, 2022
Create circular ImageView in Android in the simplest way possible

CircularImageView This is an Android project allowing to realize a circular ImageView in the simplest way possible. USAGE To make a circular ImageView

Lopez Mikhael 1.9k Dec 29, 2022
A library for Android provides blurred drop shadows to ImageView similar to iOS image backdrop shadows

A library for Android provides blurred drop shadows to ImageView similar to iOS image backdrop shadows.Provides fast canvas draw as no renderscript needed .The similar shadow blurred effects can also be seen in iOS Music App.

Vivek Verma 163 Dec 31, 2022
Crop and Rounded Corners added to an ImageView.

SuperImageView Extra features for your ImageView provided in a modularized way Documentation for v2 coming this week. CropImageView An ImageView that

César Díez Sánchez 657 Jan 5, 2023