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 | Field and Description |
|---|---|
static int |
MAX_ELEVATION
The maximum supported elevation in dp.
|
| Modifier and Type | Method and Description |
|---|---|
static android.graphics.Bitmap |
createElevationShadow(android.content.Context context,
int elevation,
ElevationUtil.Orientation orientation)
Creates and returns a bitmap, which can be used to emulate a shadow of an elevated view on
pre-Lollipop devices.
|
static android.graphics.Bitmap |
createElevationShadow(android.content.Context context,
int elevation,
ElevationUtil.Orientation orientation,
boolean parallelLight)
Creates and returns a bitmap, which can be used to emulate a shadow of an elevated view on
pre-Lollipop devices.
|
public static final int MAX_ELEVATION
public static android.graphics.Bitmap 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 the value of the constant
MAX_ELEVATIONorientation - 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, BOTTOM, TOP_LEFT,
TOP_RIGHT, BOTTOM_LEFT or BOTTOM_RIGHTBitmap or
null, if the given elevation is 0public static android.graphics.Bitmap createElevationShadow(android.content.Context context,
int elevation,
ElevationUtil.Orientation orientation,
boolean parallelLight)
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 the value of the constant
MAX_ELEVATIONorientation - 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, BOTTOM, TOP_LEFT,
TOP_RIGHT, BOTTOM_LEFT or BOTTOM_RIGHTparallelLight - True, if parallel light should be emulated, false otherwiseBitmap or
null, if the given elevation is 0