Nested classes |
class |
ShadowOverlayHelper.Builder
Builder for creating ShadowOverlayHelper.
|
class |
ShadowOverlayHelper.Options
Option values for ShadowOverlayContainer.
|
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()
|
|
Constants
SHADOW_DYNAMIC
public static final int SHADOW_DYNAMIC
Shadows depend on the size, shape, and position of the view.
Constant Value:
3
(0x00000003)
SHADOW_NONE
public static final int SHADOW_NONE
No shadow.
Constant Value:
1
(0x00000001)
SHADOW_STATIC
public static final int SHADOW_STATIC
Shadows are fixed.
Constant Value:
2
(0x00000002)
Public methods
createShadowOverlayContainer
public ShadowOverlayContainer createShadowOverlayContainer (Context context)
Create ShadowOverlayContainer for this helper.
| Parameters |
context |
Context: Context to create view. |
getShadowType
public int getShadowType ()
needsOverlay
public boolean needsOverlay ()
needsRoundedCorner
public boolean needsRoundedCorner ()
needsWrapper
public boolean needsWrapper ()
Returns true if a "wrapper" ShadowOverlayContainer is needed.
When needsWrapper() is true, call createShadowOverlayContainer(Context)
to create the wrapper.
onViewCreated
public void onViewCreated (View view)
Must be called when view is created for cases needsWrapper() is false.
prepareParentForShadow
public void prepareParentForShadow (ViewGroup parent)
prepareParentForShadow(ViewGroup) must be called on parent of container
before using shadow. Depending on Shadow type, optical bounds might be applied.
| Parameters |
parent |
ViewGroup |
setNoneWrapperOverlayColor
public static void setNoneWrapperOverlayColor (View view,
int color)
Set overlay color for view other than ShadowOverlayContainer.
See also ShadowOverlayContainer.setOverlayColor(int).
| Parameters |
view |
View |
color |
int |
setNoneWrapperShadowFocusLevel
public static void setNoneWrapperShadowFocusLevel (View view,
float level)
Set shadow focus level (0 to 1). 0 for unfocused, 1 for fully focused.
This is for view other than ShadowOverlayContainer.
See also ShadowOverlayContainer.setShadowFocusLevel(float).
| Parameters |
view |
View |
level |
float |
setOverlayColor
public void setOverlayColor (View view,
int color)
Set overlay color for view, it can be a ShadowOverlayContainer if needsWrapper() is true,
or other view type.
| Parameters |
view |
View |
color |
int |
setShadowFocusLevel
public void setShadowFocusLevel (View view,
float level)
Set shadow focus level (0 to 1). 0 for unfocused, 1 for fully focused.
| Parameters |
view |
View |
level |
float |
supportsDynamicShadow
public static boolean supportsDynamicShadow ()
Returns true if the platform sdk supports dynamic shadows.
supportsForeground
public static boolean supportsForeground ()
Returns true if view.setForeground() is supported.
supportsRoundedCorner
public static boolean supportsRoundedCorner ()
Returns true if the platform sdk supports rounded corner through outline.
supportsShadow
public static boolean supportsShadow ()
Return true if the platform sdk supports shadow.
Content and code samples on this page are subject to the licenses described in the Content License. Java is a registered trademark of Oracle and/or its affiliates.