shadowCompat
Creates a shadow replacement that can be tinted with the library's color compat mechanism on API levels before 28, the earliest version to support the native shadow colors. If the current API level is 28 or above, shadowCompat falls back to the normal shadow, unless forceColorCompat is true.
Refer to shadow's docs for details on the first five parameters: elevation, shape, clip, ambientColor, and spotColor.
colorCompat takes a Color that's used to tint the shadow on API levels 27 and below. If the passed value is Color.Black – the default shadow color – this falls back to the normal shadow. If Color.Unspecified is passed, the actual value is calculated as a blend of the ambientColor and spotColor, mixed in proportion to their current theme alphas. Setting any other value disables this behavior.
NB: The color blending formula that's currently used gives good results only if the ambient and spot colors are both fully opaque; i.e., only if both have maximum alpha values.