compositeOverlayIfNeeded

open fun compositeOverlayIfNeeded(@ColorInt backgroundColor: Int, elevation: Float, @NonNull overlayView: View): Int

See compositeOverlayIfNeeded.

The absolute elevation of the parent of the provided overlayView will also be factored in when determining the overlay color.


open fun compositeOverlayIfNeeded(@ColorInt backgroundColor: Int, elevation: Float): Int

Blends the calculated elevation overlay color (@see #compositeOverlay(int, float)) with the backgroundColor, only if the current theme's R.attr.elevationOverlayEnabled is true and the backgroundColor matches the theme's surface color ( R.attr.colorSurface); otherwise returns the backgroundColor.