public final class ElevationUtil
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ElevationUtil.Orientation
Contains all possible orientations of a shadow in relation to an elevated view.
|
| Modifier and Type | Method and Description |
|---|---|
static android.graphics.drawable.Drawable |
createElevationShadow(android.content.Context context,
int elevation,
ElevationUtil.Orientation orientation)
Creates and returns a drawable, which can be used to emulate the shadow of an elevated view
on pre-Lollipop devices.
|
static int |
getElevationShadowWidth(android.content.Context context,
int elevation,
ElevationUtil.Orientation orientation)
Returns the width of the drawable, which can be used to emulate the shadow of an elevated
view on pre-Lollipop devices.
|
public static android.graphics.drawable.Drawable createElevationShadow(android.content.Context context,
int elevation,
ElevationUtil.Orientation orientation)
context - The context, which should be used, as an instance of the class Context. The
context may not be nullelevation - The elevation, which should be emulated, in dp as an Integer value. The
elevation must be at least 0 and at maximum 5orientation - The orientation of the shadow in relation to the elevated view as a value of the enum
ElevationUtil.Orientation. The orientation may either be LEFT,
RIGHT, TOP or BOTTOMDrawable or
null, if the given elevation is 0public static int getElevationShadowWidth(android.content.Context context,
int elevation,
ElevationUtil.Orientation orientation)
context - The context, which should be used, as an instance of the class Context. The
context may not be nullelevation - The elevation, which should be emulated, in dp as an Integer value. The
elevation must be at least 0 and at maximum 5orientation - The orientation of the shadow in relation to the elevated view as a value of the enum
ElevationUtil.Orientation. The orientation may either be LEFT,
RIGHT, TOP or BOTTOMInteger value or 0, if the given
elevation is 0