MaterialShapeUtils

public class MaterialShapeUtils
extends Object

java.lang.Object
   ↳ com.google.android.material.shape.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(float); otherwise does nothing.

static void setParentAbsoluteElevation(View view)

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

static void setParentAbsoluteElevation(View view, MaterialShapeDrawable materialShapeDrawable)

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

Inherited methods

From class java.lang.Object

Public methods

setElevation

void setElevation (View view, 
                float elevation)

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

Parameters
view View

elevation float

setParentAbsoluteElevation

void setParentAbsoluteElevation (View view)

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

Parameters
view View

setParentAbsoluteElevation

void setParentAbsoluteElevation (View view, 
                MaterialShapeDrawable materialShapeDrawable)

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

Parameters
view View

materialShapeDrawable MaterialShapeDrawable