Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalStateException: Page can only be offset by a positive amount, not by-940 #148

Closed
luodongwen opened this issue Aug 11, 2020 · 6 comments
Assignees
Labels

Comments

@luodongwen
Copy link

luodongwen commented Aug 11, 2020

java.lang.IllegalStateException: Page can only be offset by a positive amount, not by -940
at androidx.viewpager2.widget.ScrollEventAdapter.updateScrollEventValues(ScrollEventAdapter.java:280)
at androidx.viewpager2.widget.ScrollEventAdapter.onScrolled(ScrollEventAdapter.java:178)
at androidx.recyclerview.widget.RecyclerView.dispatchOnScrolled(RecyclerView.java:5183)
at androidx.recyclerview.widget.RecyclerView$ViewFlinger.run(RecyclerView.java:5348)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1132)
at android.view.Choreographer.doCallbacks(Choreographer.java:943)
at android.view.Choreographer.doFrame(Choreographer.java:850)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1118)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7012)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:937)

<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">

        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/rv_classify_view"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginTop="@dimen/core_spa_small" />
    </com.scwang.smart.refresh.layout.SmartRefreshLayout>

addHeader Banner 的时候报错。BaseRecyclerViewAdapterHelper 把banner加进头部的时候报错。看异常像是动画导致的崩溃
2.6.6没事

@zhpanvip
Copy link
Owner

zhpanvip commented Aug 11, 2020

请改成用代码设置revealWidth。
这个问题会在下个版本会修复。

@luodongwen
Copy link
Author

代码设置revealWidth是啥。没看懂

@zhpanvip
Copy link
Owner

代码设置revealWidth是啥。没看懂

你是不是设置了一屏三页样式了?

@zhpanvip zhpanvip added the bug label Aug 20, 2020
@zhpanvip zhpanvip self-assigned this Aug 20, 2020
@zhpanvip
Copy link
Owner

Fixed in v3.1.6

@peter100u
Copy link

没搞懂,什么是revealWidth, 怎么解决 ?麻烦说下原因

@peter100u
Copy link

麻烦说下原因,我遇到类似问题,但是无法重现

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants