Bug P2
Status Update
Comments
jg...@google.com <jg...@google.com> #2
I face with the same problem. I have different pageMargin in landscape and portrait and when viewpager is scrolled for the more than first position, after rotating device it is shifted.
I beleive the problem is inside onSizeChanged that is called after onConfigurationChanged, it has following code:
if (w != oldw) {
recomputeScrollPosition(w, oldw, mPageMargin, mPageMargin);
}
w always not equals oldw when changing orientation, so recomputeScrollPosition is called, but whit the same values for margin and oldMargin.
This should be fixed.
I beleive the problem is inside onSizeChanged that is called after onConfigurationChanged, it has following code:
if (w != oldw) {
recomputeScrollPosition(w, oldw, mPageMargin, mPageMargin);
}
w always not equals oldw when changing orientation, so recomputeScrollPosition is called, but whit the same values for margin and oldMargin.
This should be fixed.
ca...@digitalchargingsolutions.com <ca...@digitalchargingsolutions.com> #3
[Comment deleted]
mo...@gmail.com <mo...@gmail.com> #4
I found the same problem in suport library v4, wrong align happens only when ViewPager has a page margin > 0.
ca...@digitalchargingsolutions.com <ca...@digitalchargingsolutions.com> #5
[Comment deleted]
Description
our app uses a Viewpager to show some Intro screens. We got this crash on a Samsung Galaxy S8+ (dream2lte) device:
java.lang.IllegalArgumentException:
at android.view.MotionEvent.nativeGetAxisValue (MotionEvent.java)
at android.view.MotionEvent.getX (MotionEvent.java:2608)
at androidx.viewpager.widget.ViewPager.onInterceptTouchEvent (ViewPager.java:2072)
at PACKAGE_ID.view.ActivatableViewPager.onInterceptTouchEvent (ActivatableViewPager.java:26)
This is our code:
override fun onInterceptTouchEvent(event: MotionEvent): Boolean {
return if (this.mSwipingEnabled) {
super.onInterceptTouchEvent(event)
} else {
false
}
}
Googling a bit, I found many issue reports for this bug, but as of today, they don't seem to be resolved.
Also see:
All of these could be related but I'm not sure. It would be great if this were fixed or if the method was at least marked with throws. Thanks in advance!