MaterialShapeUtils

public class MaterialShapeUtils


Utility methods for MaterialShapeDrawable and related classes.

Summary

Public methods

static void
setElevation(View view, float elevation)

If the background of the provided view is a MaterialShapeDrawable, sets the drawable's elevation via setElevation; otherwise does nothing.

static void

If the background of the provided view is a MaterialShapeDrawable, sets the drawable's parent absolute elevation (see setParentAbsoluteElevation); otherwise does nothing.

static void
setParentAbsoluteElevation(
    View view,
    MaterialShapeDrawable materialShapeDrawable
)

Updates the materialShapeDrawable parent absolute elevation via setParentAbsoluteElevation to be equal to the absolute elevation of the parent of the provided view.

Public methods

setElevation

public static void setElevation(View view, float elevation)

If the background of the provided view is a MaterialShapeDrawable, sets the drawable's elevation via setElevation; otherwise does nothing.

setParentAbsoluteElevation

public static void setParentAbsoluteElevation(View view)

If the background of the provided view is a MaterialShapeDrawable, sets the drawable's parent absolute elevation (see setParentAbsoluteElevation); otherwise does nothing.

setParentAbsoluteElevation

public static void setParentAbsoluteElevation(
    View view,
    MaterialShapeDrawable materialShapeDrawable
)

Updates the materialShapeDrawable parent absolute elevation via setParentAbsoluteElevation to be equal to the absolute elevation of the parent of the provided view.