qhutch / ElevationImageView

Imageview with elevation shadow
396 stars 46 forks source link

Android P Issue: java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed #11

Closed 0megaD closed 6 years ago

0megaD commented 6 years ago

As subject title states the following error occurs: java.lang.IllegalArgumentException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed When attempting to draw the ElevationImageView on Android P.

This is due to the following line: canvas.clipRect(rect, Region.Op.REPLACE)

See the following issue on stackoverflow for a suggested replacement: https://stackoverflow.com/questions/50231950/what-is-the-best-alternative-to-canvas-cliprect-with-region-op-replace

jlurena commented 6 years ago

I'm addressing this issue with PR https://github.com/qhutch/ElevationImageView/pull/12 @qhutch please review