Google은 흑인 공동체를 위한 인종 간 평등을 진전시키기 위해 노력하고 있습니다. Google에서 어떤 노력을 하고 있는지 확인하세요.

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 MaterialShapeDrawable.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 MaterialShapeDrawable.setParentAbsoluteElevation(float) to be equal to the absolute elevation of the parent of the provided view.

Inherited methods

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 MaterialShapeDrawable.setElevation(float); otherwise does nothing.

Parameters
view View

elevation float

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(View, MaterialShapeDrawable)); otherwise does nothing.

Parameters
view View

setParentAbsoluteElevation

public static void setParentAbsoluteElevation (View view, 
                MaterialShapeDrawable materialShapeDrawable)

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

Parameters
view View

materialShapeDrawable MaterialShapeDrawable