ButtonCustomShadow icon indicating copy to clipboard operation
ButtonCustomShadow copied to clipboard

Not working on API 28

Open rok5ek opened this issue 5 years ago • 6 comments

A crash happens in BeautyView 325 line: clipRect(shadowRect, Region.Op.REPLACE)

ClipRect method is deprecated.

rok5ek avatar Apr 15 '19 15:04 rok5ek

@rok5ek thanks I'm gonna look it up

subsub avatar Apr 15 '19 15:04 subsub

It turns out ops other then Region.Op.INTERSECT and Region.Op.DIFFERENCE are deprecated since API 26 as they have the ability to expand the clip (which is exactly what's needed here). Since Android P using any ops other than Region.Op.INTERSECT and Region.Op.DIFFERENCE in Canvas.clipPath(Path, Region.Op) leads to IllegalArgumentException. I haven't been able to find any other alternatives that behaves like what region.Op.REPLACE does. And this issue is not related to androidX (although it's nice to migrate to androidX)

subsub avatar Apr 15 '19 17:04 subsub

Yes exactly, I was able to avoid the crash also, but I couldn't make the shadow to display even by using a wider rect within clipRect(widerRect). The androidx migration is just to keep up with the latest libs.

rok5ek avatar Apr 15 '19 19:04 rok5ek

@rok5ek I've updated to androidX. And for the shadow for API 28, I think I need to find other solution. Perhaps to resize the actual view, but still not sure.

subsub avatar Apr 15 '19 19:04 subsub

@subsub Great, I will try to find a solution also.

rok5ek avatar Apr 15 '19 19:04 rok5ek

@subsub Have you figured out something? I haven't come up with a working solution...

rok5ek avatar Apr 24 '19 11:04 rok5ek