ShadowOverlayHelper.Builder


public final class ShadowOverlayHelper.Builder


Builder for creating ShadowOverlayHelper.

Summary

Public constructors

Public methods

ShadowOverlayHelper
build(Context context)

Create ShadowOverlayHelper object

ShadowOverlayHelper.Builder
keepForegroundDrawable(boolean keepForegroundDrawable)

Set if not using foreground drawable for overlay color.

ShadowOverlayHelper.Builder
needsOverlay(boolean needsOverlay)

Set if needs overlay color.

ShadowOverlayHelper.Builder
needsRoundedCorner(boolean needsRoundedCorner)

Set if needs rounded corner.

ShadowOverlayHelper.Builder
needsShadow(boolean needsShadow)

Set if needs shadow.

ShadowOverlayHelper.Builder

Set option values e.g. Shadow Z value, rounded corner radius.

ShadowOverlayHelper.Builder
preferZOrder(boolean preferZOrder)

Set if prefer z-order shadow.

Public constructors

Builder

Added in 1.1.0
public Builder()

Public methods

build

Added in 1.1.0
public ShadowOverlayHelper build(Context context)

Create ShadowOverlayHelper object

Parameters
Context context

The context uses to read Resources settings.

Returns
ShadowOverlayHelper

The ShadowOverlayHelper object.

keepForegroundDrawable

Added in 1.1.0
public ShadowOverlayHelper.Builder keepForegroundDrawable(boolean keepForegroundDrawable)

Set if not using foreground drawable for overlay color. For example if the view has already assigned a foreground drawable for other purposes. When it's true, helper will use a ShadowOverlayContainer for overlay color.

Parameters
boolean keepForegroundDrawable

True to keep the original foreground drawable.

Returns
ShadowOverlayHelper.Builder

The Builder object itself.

needsOverlay

Added in 1.1.0
public ShadowOverlayHelper.Builder needsOverlay(boolean needsOverlay)

Set if needs overlay color.

Parameters
boolean needsOverlay

True if needs overlay.

Returns
ShadowOverlayHelper.Builder

The Builder object itself.

needsRoundedCorner

Added in 1.1.0
public ShadowOverlayHelper.Builder needsRoundedCorner(boolean needsRoundedCorner)

Set if needs rounded corner.

Parameters
boolean needsRoundedCorner

True if needs rounded corner.

Returns
ShadowOverlayHelper.Builder

The Builder object itself.

needsShadow

Added in 1.1.0
public ShadowOverlayHelper.Builder needsShadow(boolean needsShadow)

Set if needs shadow.

Parameters
boolean needsShadow

True if needs shadow.

Returns
ShadowOverlayHelper.Builder

The Builder object itself.

options

Added in 1.1.0
public ShadowOverlayHelper.Builder options(ShadowOverlayHelper.Options options)

Set option values e.g. Shadow Z value, rounded corner radius.

Parameters
ShadowOverlayHelper.Options options

The Options object to create ShadowOverlayHelper.

preferZOrder

Added in 1.1.0
public ShadowOverlayHelper.Builder preferZOrder(boolean preferZOrder)

Set if prefer z-order shadow. On old devices, z-order shadow might be slow, set to false to fall back to static 9-patch shadow. Recommend to read from system wide Setting value: see Settings.

Parameters
boolean preferZOrder

True if prefer Z shadow. Default is true.

Returns
ShadowOverlayHelper.Builder

The Builder object itself.