Stay organized with collections
Save and categorize content based on your preferences.
MaterialShapeUtils
public
class
MaterialShapeUtils
extends Object
java.lang.Object
|
↳ |
com.google.android.material.shape.MaterialShapeUtils
|
Utility methods for MaterialShapeDrawable
and related classes.
Summary
Inherited methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public methods
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 |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# MaterialShapeUtils\n\nSummary: [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nMaterialShapeUtils\n==================\n\n\n`\npublic\n\n\nclass\nMaterialShapeUtils\n`\n\n\n`\n\nextends Object\n\n\n`\n\n`\n\n\n`\n\n|---|------------------------------------------------------|\n| java.lang.Object ||\n| ↳ | com.google.android.material.shape.MaterialShapeUtils |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nUtility methods for [MaterialShapeDrawable](/reference/com/google/android/material/shape/MaterialShapeDrawable) and related classes.\n\nSummary\n-------\n\n| ### Public methods ||\n|----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` static void` | ` `[setElevation](/reference/com/google/android/material/shape/MaterialShapeUtils#setElevation(android.view.View,%20float))`(View view, float elevation) ` If the background of the provided `view` is a [MaterialShapeDrawable](/reference/com/google/android/material/shape/MaterialShapeDrawable), sets the drawable's elevation via [MaterialShapeDrawable.setElevation(float)](/reference/com/google/android/material/shape/MaterialShapeDrawable#setElevation(float)); otherwise does nothing. |\n| ` static void` | ` `[setParentAbsoluteElevation](/reference/com/google/android/material/shape/MaterialShapeUtils#setParentAbsoluteElevation(android.view.View))`(View view) ` If the background of the provided `view` is a [MaterialShapeDrawable](/reference/com/google/android/material/shape/MaterialShapeDrawable), sets the drawable's parent absolute elevation (see [setParentAbsoluteElevation(View, MaterialShapeDrawable)](/reference/com/google/android/material/shape/MaterialShapeUtils#setParentAbsoluteElevation(android.view.View,%20com.google.android.material.shape.MaterialShapeDrawable))); otherwise does nothing. |\n| ` static void` | ` `[setParentAbsoluteElevation](/reference/com/google/android/material/shape/MaterialShapeUtils#setParentAbsoluteElevation(android.view.View,%20com.google.android.material.shape.MaterialShapeDrawable))`(View view, `[MaterialShapeDrawable](/reference/com/google/android/material/shape/MaterialShapeDrawable)` materialShapeDrawable) ` Updates the `materialShapeDrawable` parent absolute elevation via [MaterialShapeDrawable.setParentAbsoluteElevation(float)](/reference/com/google/android/material/shape/MaterialShapeDrawable#setParentAbsoluteElevation(float)) to be equal to the absolute elevation of the parent of the provided `view`. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` java.lang.Object ` |-------------------|-------------------------------| | ` Object` | ` clone() ` | | ` boolean` | ` equals(Object arg0) ` | | ` void` | ` finalize() ` | | ` final Class\u003c?\u003e` | ` getClass() ` | | ` int` | ` hashCode() ` | | ` final void` | ` notify() ` | | ` final void` | ` notifyAll() ` | | ` String` | ` toString() ` | | ` final void` | ` wait(long arg0, int arg1) ` | | ` final void` | ` wait(long arg0) ` | | ` final void` | ` wait() ` | ||\n\nPublic methods\n--------------\n\n### setElevation\n\n```\npublic static void setElevation (View view, \n float elevation)\n```\n\nIf the background of the provided `view` is a [MaterialShapeDrawable](/reference/com/google/android/material/shape/MaterialShapeDrawable), sets the\ndrawable's elevation via [MaterialShapeDrawable.setElevation(float)](/reference/com/google/android/material/shape/MaterialShapeDrawable#setElevation(float)); otherwise does\nnothing.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------|----------------|\n| `view` | `View` \u003cbr /\u003e |\n| `elevation` | `float` \u003cbr /\u003e |\n\n### setParentAbsoluteElevation\n\n```\npublic static void setParentAbsoluteElevation (View view)\n```\n\nIf the background of the provided `view` is a [MaterialShapeDrawable](/reference/com/google/android/material/shape/MaterialShapeDrawable), sets the\ndrawable's parent absolute elevation (see [setParentAbsoluteElevation(View, MaterialShapeDrawable)](/reference/com/google/android/material/shape/MaterialShapeUtils#setParentAbsoluteElevation(android.view.View,%20com.google.android.material.shape.MaterialShapeDrawable))); otherwise does\nnothing.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|--------|---------------|\n| `view` | `View` \u003cbr /\u003e |\n\n### setParentAbsoluteElevation\n\n```\npublic static void setParentAbsoluteElevation (View view, \n MaterialShapeDrawable materialShapeDrawable)\n```\n\nUpdates the `materialShapeDrawable` parent absolute elevation via [MaterialShapeDrawable.setParentAbsoluteElevation(float)](/reference/com/google/android/material/shape/MaterialShapeDrawable#setParentAbsoluteElevation(float)) to be equal to the absolute elevation\nof the parent of the provided `view`.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-------------------------|--------------------------------|\n| `view` | `View` \u003cbr /\u003e |\n| `materialShapeDrawable` | `MaterialShapeDrawable` \u003cbr /\u003e |"]]