Elevation Overlay Provider
Utility for calculating elevation overlay alpha values and colors.
Constructors
Functions
Link copied to clipboard
Calculates the alpha value, between 0 and 255, that should be used with the elevation overlay color, based on the provided
elevation
value.Link copied to clipboard
Calculates the alpha fraction, between 0 and 1, that should be used with the elevation overlay color, based on the provided
elevation
value.Link copied to clipboard
Blends the calculated elevation overlay color with the provided
backgroundColor
.open fun compositeOverlay(@ColorInt backgroundColor: Int, elevation: Float, @NonNull overlayView: View): Int
See compositeOverlay.
Link copied to clipboard
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
.Link copied to clipboard
Blends the calculated elevation overlay color (@see #compositeOverlayIfNeeded(int, float)) with the current theme's color int value for
R.attr.colorSurface
if needed.open fun compositeOverlayWithThemeSurfaceColorIfNeeded(elevation: Float, @NonNull overlayView: View): Int
Link copied to clipboard
Returns the absolute elevation of the parent of the provided
overlayView
, or in other words, the sum of the elevations of all ancestors of the overlayView
.Link copied to clipboard
Returns the current theme's color int value for
R.attr.elevationOverlayColor
.Link copied to clipboard
Returns the current theme's color int value for
R.attr.colorSurface
.Link copied to clipboard
Returns the current theme's boolean value for
R.attr.elevationOverlayEnabled
.