ButtonCustomShadow
ButtonCustomShadow copied to clipboard
Not working on API 28
A crash happens in BeautyView 325 line:
clipRect(shadowRect, Region.Op.REPLACE)
ClipRect method is deprecated.
@rok5ek thanks I'm gonna look it up
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)
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 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 Great, I will try to find a solution also.
@subsub Have you figured out something? I haven't come up with a working solution...