oubowu / PinnedSectionItemDecoration

A powerful ItemDecoration for Recyclerview, supports the common layoutmanager.
Apache License 2.0
2.09k stars 218 forks source link

android P Beta Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed #54

Closed Leonw2229 closed 6 years ago

Leonw2229 commented 6 years ago

java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed at android.graphics.Canvas.checkValidClipOp(Canvas.java:779) at android.graphics.Canvas.clipRect(Canvas.java:826) at com.oushangfeng.pinnedsectionitemdecoration.PinnedHeaderItemDecoration.onDrawOver(PinnedHeaderItemDecoration.java:243) at android.support.v7.widget.RecyclerView.draw(RecyclerView.java:4177) at android.view.View.updateDisplayListIfDirty(View.java:19082) at android.view.View.draw(View.java:19935) at android.view.ViewGroup.drawChild(ViewGroup.java:4333) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112) at android.view.View.draw(View.java:20210) at android.view.View.updateDisplayListIfDirty(View.java:19082) at android.view.View.draw(View.java:19935) at android.view.ViewGroup.drawChild(ViewGroup.java:4333) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112) at android.view.View.draw(View.java:20210) at android.support.v4.view.ViewPager.draw(ViewPager.java:2426) at android.view.View.updateDisplayListIfDirty(View.java:19082) at android.view.View.draw(View.java:19935) at android.view.ViewGroup.drawChild(ViewGroup.java:4333) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112) at android.view.View.draw(View.java:20210) at android.view.View.updateDisplayListIfDirty(View.java:19082) at android.view.View.draw(View.java:19935) at android.view.ViewGroup.drawChild(ViewGroup.java:4333) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112) at android.view.View.updateDisplayListIfDirty(View.java:19073) at android.view.View.draw(View.java:19935) at android.view.ViewGroup.drawChild(ViewGroup.java:4333) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112) at android.view.View.updateDisplayListIfDirty(View.java:19073) at android.view.View.draw(View.java:19935) at android.view.ViewGroup.drawChild(ViewGroup.java:4333) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112) at android.view.View.updateDisplayListIfDirty(View.java:19073) at android.view.View.draw(View.java:19935) at android.view.ViewGroup.drawChild(ViewGroup.java:4333) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112) at android.view.View.updateDisplayListIfDirty(View.java:19073) at android.view.View.draw(View.java:19935) at android.view.ViewGroup.drawChild(ViewGroup.java:4333) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4112) at android.view.View.draw(View.java:20210) at com.android.internal.policy.DecorView.draw(DecorView.java:780) at android.view.View.updateDisplayListIfDirty(View.java:19082) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:686) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:692) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:801) at android.view.ViewRootImpl.draw(ViewRootImpl.java:3312) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3116) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2485) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1460) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7184) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:949) at android.view.Choreographer.doCallbacks(Choreographer.java:761) at android.view.Choreographer.doFrame(Choreographer.java:696) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:935) at android.os.Handler.handleCallback(Handler.java:873) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6669) 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:858)

oubowu commented 6 years ago

我用模拟器测试下

oubowu commented 6 years ago

模拟器Andorid 9,API28木有报错哎 你用的是真实的机子吗?

pengjunhong commented 6 years ago

@oubowu 系统版本:android P 报错:Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed 我这边也使用模拟器 出现一样的问题

pengjunhong commented 6 years ago

@oubowu 作者你好 你可以直接模拟这个场景 把demo中的sdk升级到28 然后使用AndroidP的模拟器跑 问题就出来了

pengjunhong commented 6 years ago

暂时把c.clipRect(mClipBounds, Region.Op.UNION);换成 c.clipRect(mClipBounds, Region.Op.INTERSECT);没发现什么问题。

oubowu commented 6 years ago

明白了 是编译版本到28 谷歌改了canvas的源码了 只允许clipRect只允许INTERSECT and DIFFERENCE这两种模式了 我改下重新上传适配下

oubowu commented 6 years ago

改好了,可以升级看下