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

Related tags

GUI 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
A simple implementation of the Android In-App Billing API.

Google In-App Billing Library v4+ A simple implementation of the Android In-App Billing API. It supports: in-app purchases (both consumable and non-co

Moisoni Ioan 79 Dec 12, 2022
Methods in various programming languages to validate Croatian identification number called OIB

OIB validation [ENG] Methods in various programming languages to validate Croatian identification number called OIB. More info on www.oib.hr. Provjera

Domagoj 30 Nov 23, 2022
🍏 A collection of partial JNA bindings for various macOS frameworks. (e.g. Foundation, AppKit, etc.)

JNApple ?? A collection of partial JNA bindings for various macOS frameworks. (e.g. Foundation, AppKit, etc.) Usage These are just some common example

Iridescent 3 Jun 19, 2022
🌄 Image editor using native modules for iOS and Android. Inherit from 2 available libraries, Brightroom (iOS) and PhotoEditor (Android)

React Native Photo Editor (RNPE) ?? Image editor using native modules for iOS and Android. Inherit from 2 available libraries, Brightroom (iOS) and Ph

Baron Ha. 243 Jan 4, 2023
Tray Icon implementation for JavaFX applications. Say goodbye to using AWT's SystemTray icon, instead use a JavaFX Tray Icon.

FXTrayIcon Library intended for use in JavaFX applications that makes adding a System Tray icon easier. The FXTrayIcon class handles all the messy AWT

Dustin Redmond 248 Dec 30, 2022
Java implementation of BSP based CSG (Constructive Solid Geometry)

JCSG Java implementation of BSP based CSG (Constructive Solid Geometry). It is the only simple and free Java implementation I am aware of. This implem

Michael Hoffer 154 Sep 25, 2022
FlexBoxFX is a JavaFX implementation of CSS3 flexbox.

FlexBoxFX is a JavaFX implementation of CSS3 flexbox layout manager

null 5 Nov 4, 2021
Android Resource Manager application to manage and analysis your app resources with many features like image resize, Color, Dimens and code Analysis

AndroidResourceManager Cross-Platform tools to manage your resources as an Android Developer, AndroidResourceManager - ARM provide five main services

Amr Hesham 26 Nov 16, 2022
CSS-style shadows for Android

Fifty Shades: CSS-style shadows for Android What? In CSS, shadows are specified by (dx, dy, blurRadius, colour) (I call it ShadowSpec). This library i

Mike 73 Dec 19, 2022
Simple, maintained and highly customizable colorpicker library for Android.

Colorpicker Library for Android Simple, maintained and highly customizable color picker library for Android. It is packed with ColorPicker Popup, Colo

Mrudul Tora 31 Oct 3, 2022
A simple Android Tag EditText

TagEditText A simple Android Tag EditText. Setup The easiest way to add the TagEditText library to your project is by adding it as a dependency to you

HearSilent 15 May 5, 2022
A low intrusive, configurable android library that converts layout XML files into Java code to improve performance

qxml English 一个低侵入,可配置的 Android 库,用于将 layout xml 文件转换为 Java 代码以提高性能。 与X2C的对比 X2C: 使用注解处理器生成View类,使用时需要在类中添加注解,并替换setContentView方法,侵入性较强; 对于布局属性的支持不够完美

null 74 Oct 6, 2022
Lifecycle-aware shared observable data holder class for android.

Eyejet Lifecycle-aware shared observable data holder class for android. 1. Depend on our library Eyejet Library is available through Maven Repository.

ZeoFlow 16 Jul 27, 2021
An open source application to make your own android applications without coding!

Stif An Open source project for building Android Application at a go both with and without coding. This project was inspired from Scratch and Sketchwa

Nethical org 5 Aug 28, 2021
an android app to browse urls before open

link eye - kuesji koesnu - 8/8/2021 an android app to browse urls before open try to open a link, select link eye and choose always to start using

kuesji koesnu 25 Dec 31, 2022
Ini adalah Launcher SAMP untuk android, ini hanya untuk mengganti nama dan kemungkinan di update lanjutnya akan mendukung download client. Bersenang senanglah!!!

SAMP-Launcher-Android Ini adalah Launcher SAMP untuk android, ini hanya untuk mengganti nama dan kemungkinan di update lanjutnya akan mendukung downlo

Kiril 3 Nov 3, 2022
An Android library that allows you to easily create applications with slide-in menus.

An Android library that allows you to easily create applications with slide-in menus. You may use it in your Android apps provided that you cite this project and include the license in your app. Thanks!

Jeremy Feinstein 11.1k Jan 4, 2023
RxJava bindings for Android

RxAndroid: Reactive Extensions for Android Android specific bindings for RxJava 3. This module adds the minimum classes to RxJava that make writing re

ReactiveX 19.7k Dec 28, 2022
A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.

⚡ A powerful & easy to use chart library for Android ⚡ Charts is the iOS version of this library Table of Contents Quick Start Gradle Maven Documentat

Philipp Jahoda 36k Jan 9, 2023