Giter VIP home page Giter VIP logo

Comments (5)

mkuprionis avatar mkuprionis commented on June 8, 2024 1

I have worked around this in the same way, as workaround for #4 - by simply catching exception. In order to do that, change HackyViewPager by adding another exception clause in onInterceptTouchEvent:

    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev) {
        try {
            return super.onInterceptTouchEvent(ev);
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
            return false;
        } catch (ArrayIndexOutOfBoundsException e) {
            e.printStackTrace();
            return false;
        }
    }

This issue seems actually related to https://code.google.com/p/android/issues/detail?id=18990 mentioned #4 - I've checked sources for MotionEventCompatEclair, pointerIndex is used there as well:

/**
 * Implementation of motion event compatibility that can call Eclair APIs.
 */
class MotionEventCompatEclair {
    public static int findPointerIndex(MotionEvent event, int pointerId) {
        return event.findPointerIndex(pointerId);
    }
    public static int getPointerId(MotionEvent event, int pointerIndex) {
        return event.getPointerId(pointerIndex);
    }
    public static float getX(MotionEvent event, int pointerIndex) {
        return event.getX(pointerIndex);
    }
    public static float getY(MotionEvent event, int pointerIndex) {
        return event.getY(pointerIndex);
    }
}

from photoview.

terryyhl avatar terryyhl commented on June 8, 2024

I also have this problem,How to fix it?

from photoview.

wangyiqian avatar wangyiqian commented on June 8, 2024

+1

from photoview.

shadowline avatar shadowline commented on June 8, 2024

The problem still exists.When zoom fast using two fingers,and then slide to the left.It's maybe a bug in ViewPager

04-11 10:04:11.709: E/AndroidRuntime(12274): java.lang.ArrayIndexOutOfBoundsException
04-11 10:04:11.709: E/AndroidRuntime(12274): at android.view.MotionEvent.getX(MotionEvent.java:889)
04-11 10:04:11.709: E/AndroidRuntime(12274): at android.support.v4.view.MotionEventCompatEclair.getX(MotionEventCompatEclair.java:32)
04-11 10:04:11.709: E/AndroidRuntime(12274): at android.support.v4.view.MotionEventCompat$EclairMotionEventVersionImpl.getX(MotionEventCompat.java:91)
04-11 10:04:11.709: E/AndroidRuntime(12274): at android.support.v4.view.MotionEventCompat.getX(MotionEventCompat.java:219)
04-11 10:04:11.709: E/AndroidRuntime(12274): at android.support.v4.view.ViewPager.onTouchEvent(ViewPager.java:1919)
04-11 10:04:11.709: E/AndroidRuntime(12274): at android.view.View.dispatchTouchEvent(View.java:3886)
04-11 10:04:11.709: E/AndroidRuntime(12274): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:909)
04-11 10:04:11.709: E/AndroidRuntime(12274): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:948)
04-11 10:04:11.709: E/AndroidRuntime(12274): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:948)
04-11 10:04:11.709: E/AndroidRuntime(12274): at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:948)
04-11 10:04:11.709: E/AndroidRuntime(12274): at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1796)
04-11 10:04:11.709: E/AndroidRuntime(12274): at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1132)
04-11 10:04:11.709: E/AndroidRuntime(12274): at android.app.Activity.dispatchTouchEvent(Activity.java:2120)
04-11 10:04:11.709: E/AndroidRuntime(12274): at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1780)
04-11 10:04:11.709: E/AndroidRuntime(12274): at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2210)
04-11 10:04:11.709: E/AndroidRuntime(12274): at android.view.ViewRoot.handleMessage(ViewRoot.java:1894)
04-11 10:04:11.709: E/AndroidRuntime(12274): at android.os.Handler.dispatchMessage(Handler.java:99)
04-11 10:04:11.709: E/AndroidRuntime(12274): at android.os.Looper.loop(Looper.java:130)
04-11 10:04:11.709: E/AndroidRuntime(12274): at android.app.ActivityThread.main(ActivityThread.java:3703)
04-11 10:04:11.709: E/AndroidRuntime(12274): at java.lang.reflect.Method.invokeNative(Native Method)
04-11 10:04:11.709: E/AndroidRuntime(12274): at java.lang.reflect.Method.invoke(Method.java:507)
04-11 10:04:11.709: E/AndroidRuntime(12274): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
04-11 10:04:11.709: E/AndroidRuntime(12274): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
04-11 10:04:11.709: E/AndroidRuntime(12274): at dalvik.system.NativeStart.main(Native Method)

from photoview.

chrisbanes avatar chrisbanes commented on June 8, 2024

Dupe of #31

from photoview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.