Comments (5)
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.
I also have this problem,How to fix it?
from photoview.
+1
from photoview.
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.
Dupe of #31
from photoview.
Related Issues (20)
- Error implementing dependency HOT 1
- Not working on Android Studio Bumblebee HOT 3
- Dragging gesture is consumed when used in scrollable composable HOT 5
- Exceptions occur when setZoomable(false) and setScaleType(FIT_XY) are used together HOT 1
- Canvas: trying to draw too large(432000000bytes) bitmap. HOT 1
- Profile
- Way to get location of tap outside view?
- Openharmony application
- Is there a Version Update and Release Plan after 2.3.0 HOT 1
- Picture
- Could not resolve all artifacts HOT 4
- Could not resolve all artifacts - com.github.chrisbanes:PhotoView:2.3.0 HOT 5
- Could not resolve com.github.chrisbanes:PhotoView:2.3.0 HOT 1
- Photo HOT 1
- It seems that the Viewpage that does not support sliding up and down? HOT 1
- Scrolling behavior in ViewPager HOT 1
- Why not Migrate to AndroidX
- 图片放大后 比较模糊 请问如何处理 谢谢 HOT 1
- The picture is blurred after enlarging. How to deal with it HOT 1
- How to use PhotoViewAttacher?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from photoview.