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

Region.Op.XOR 在9.0不能使用,动画会失效 #82

Open
Oyama-Oyama opened this issue Sep 30, 2019 · 8 comments
Open

Region.Op.XOR 在9.0不能使用,动画会失效 #82

Oyama-Oyama opened this issue Sep 30, 2019 · 8 comments

Comments

@Oyama-Oyama
Copy link

canvas.clipPath(path, Region.Op.XOR);
XOR在9.0被删除了,有替代方法吗实现动画吗

@Android-xiaole
Copy link

同问

@jackom
Copy link

jackom commented Oct 25, 2019

我改成调用其他的方法没问题了:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { canvas.clipOutPath(mPath0); } else { canvas.clipPath(mPath0, Region.Op.XOR);// REPLACE、UNION 等类型 }

@HandSomeMaster
Copy link

我改成调用其他的方法没问题了:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { canvas.clipOutPath(mPath0); } else { canvas.clipPath(mPath0, Region.Op.XOR);// REPLACE、UNION 等类型 }

有没有发现这样改了以后 翻页的时候被翻的页面变成了空白的,我遇到了 这种解决了吗

@jackom
Copy link

jackom commented Nov 26, 2019

我改成调用其他的方法没问题了:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { canvas.clipOutPath(mPath0); } else { canvas.clipPath(mPath0, Region.Op.XOR);// REPLACE、UNION 等类型 }

有没有发现这样改了以后 翻页的时候被翻的页面变成了空白的,我遇到了 这种解决了吗

暂时没发现这种情况。。

@HandSomeMaster
Copy link

我改成调用其他的方法没问题了:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { canvas.clipOutPath(mPath0); } else { canvas.clipPath(mPath0, Region.Op.XOR);// REPLACE、UNION 等类型 }

有没有发现这样改了以后 翻页的时候被翻的页面变成了空白的,我遇到了 这种解决了吗

暂时没发现这种情况。。

老哥有联系方式吗 我想问问你

@jackom
Copy link

jackom commented Dec 13, 2019

我改成调用其他的方法没问题了:
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { canvas.clipOutPath(mPath0); } else { canvas.clipPath(mPath0, Region.Op.XOR);// REPLACE、UNION 等类型 }

有没有发现这样改了以后 翻页的时候被翻的页面变成了空白的,我遇到了 这种解决了吗

暂时没发现这种情况。。

老哥有联系方式吗 我想问问你

因为现在的开源库一直没有更新,我现在主要是参考 https://github.com/390057892/reader 这个项目来搞了。会不会跟没有开启硬件加速有关?具体我也不是很清楚(手动狗头)

@zizikoth
Copy link

尝试一下

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.P){
            Path mPathXOR = new Path();
            mPathXOR.moveTo(0,0);
            mPathXOR.lineTo(getWidth(),0);
            mPathXOR.lineTo(getWidth(),getHeight());
            mPathXOR.lineTo(0,getHeight());
            mPathXOR.close();
            //以上根据实际的Canvas或View的大小,画出相同大小的Path即可
            mPathXOR.op(mPath0, Path.Op.XOR);
            canvas.clipPath(mPathXOR);
        }else {
            canvas.clipPath(mPath0, Region.Op.XOR);
        }

@Android-xiaole
Copy link

我的项目里面将targetsdk从28改为27就没问题了,相当于绕过了api检查的机制

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

No branches or pull requests

5 participants