I have a workaround for the postLayout issue. See the code and the commit comment for details

...adow set

Overwriting the setClipsToBounds method to check shadowOpacity if view
has shadows or not. If yes, clipToBounds is not passed through.
Otherwise everything works as before.